Adding support for Dictionaries on Forms
WIP converting datetime string to datetime
This commit is contained in:
parent
1ebe3c302f
commit
a605acb856
@ -14,6 +14,10 @@ from bson import ObjectId
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
|
|
||||||
|
RFC1123_DATE_FORMAT = '%a, %d %b %Y %H:%M:%S GMT'
|
||||||
|
|
||||||
|
|
||||||
class SystemUtility():
|
class SystemUtility():
|
||||||
def __new__(cls, *args, **kwargs):
|
def __new__(cls, *args, **kwargs):
|
||||||
raise TypeError("Base class may not be instantiated")
|
raise TypeError("Base class may not be instantiated")
|
||||||
@ -126,6 +130,13 @@ class ValidateCustomFields(Validator):
|
|||||||
lookup['_id'] = ObjectId(self.document['node_type'])
|
lookup['_id'] = ObjectId(self.document['node_type'])
|
||||||
node_type = node_types.find_one(lookup)
|
node_type = node_types.find_one(lookup)
|
||||||
|
|
||||||
|
# TODO make this REAL!
|
||||||
|
try:
|
||||||
|
value['time']['start'] = datetime.strptime(
|
||||||
|
value['time']['start'], RFC1123_DATE_FORMAT)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
v = Validator(node_type['dyn_schema'])
|
v = Validator(node_type['dyn_schema'])
|
||||||
val = v.validate(value)
|
val = v.validate(value)
|
||||||
if val:
|
if val:
|
||||||
|
@ -132,9 +132,15 @@ def populate_node_types(old_ids={}):
|
|||||||
"schema": {
|
"schema": {
|
||||||
"users": {
|
"users": {
|
||||||
"type": "list",
|
"type": "list",
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"groups": {
|
"groups": {
|
||||||
"type": "list",
|
"type": "list",
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user