Merge branch 'master' into DAL-modular

* master: (58 commits)
  changed version number
  better types by default, given that we're on 2005 at least
  fix for StorageList and tests added
  improved coverage, fix bug with IS_LIST_OF and items not being strings
  fix cache.increment, added tests
  R-2.9.11
  reverted simplejson
  R-2.9.10
  upgraded memcache and markdown2
  upgraded pypyodbc.py
  upgraded simplejson
  no more split in contains, thanks Niphlod
  fixed wording and bug on contains(), made smart_query use ilike instead of like
  ilike, thanks Niphlod
  CROSS JOIN, thanks jotbe
  added custom represent to GoogleDatastoreAdapter, thanks Alan
  postgresql: identifies what adapter auto-loads json values
  added more tests for json Field
  fixed typo in driver_auto_json
  Improve the graphing to show the name of the application.
  ...

Conflicts:
	gluon/dal.py
	gluon/globals.py
	gluon/tests/test_dal.py
This commit is contained in:
gi0baro
2014-09-25 12:49:16 +02:00
55 changed files with 2932 additions and 1954 deletions
+7 -6
View File
@@ -372,14 +372,18 @@ class IS_JSON(Validator):
if self.native_json:
simplejson.loads(value) # raises error in case of malformed json
return (value, None) # the serialized value is not passed
return (simplejson.loads(value), None)
else:
return (simplejson.loads(value), None)
except JSONErrors:
return (value, translate(self.error_message))
def formatter(self,value):
if value is None:
return None
return simplejson.dumps(value)
if self.native_json:
return value
else:
return simplejson.dumps(value)
class IS_IN_SET(Validator):
@@ -1164,11 +1168,8 @@ class IS_LIST_OF_EMAILS(object):
def __call__(self, value):
bad_emails = []
emails = []
f = IS_EMAIL()
for email in self.split_emails.findall(value):
if not email in emails:
emails.append(email)
error = f(email)[1]
if error and not email in bad_emails:
bad_emails.append(email)
@@ -2516,7 +2517,7 @@ class IS_LIST_OF(Validator):
if not isinstance(other, (list,tuple)):
other = [other]
for item in ivalue:
if item.strip():
if str(item).strip():
v = item
for validator in other:
(v, e) = validator(v)