diff --git a/attract/application/__init__.py b/attract/application/__init__.py index ae8af7ac..d783e9af 100644 --- a/attract/application/__init__.py +++ b/attract/application/__init__.py @@ -14,6 +14,10 @@ from bson import ObjectId from datetime import datetime from datetime import timedelta + +RFC1123_DATE_FORMAT = '%a, %d %b %Y %H:%M:%S GMT' + + class SystemUtility(): def __new__(cls, *args, **kwargs): raise TypeError("Base class may not be instantiated") @@ -126,6 +130,13 @@ class ValidateCustomFields(Validator): lookup['_id'] = ObjectId(self.document['node_type']) 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']) val = v.validate(value) if val: diff --git a/attract/manage.py b/attract/manage.py index cf993242..a7549240 100644 --- a/attract/manage.py +++ b/attract/manage.py @@ -132,9 +132,15 @@ def populate_node_types(old_ids={}): "schema": { "users": { "type": "list", + "schema": { + "type": "string", + } }, "groups": { "type": "list", + "schema": { + "type": "string", + } } } },