You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "", line 1, in
File "/home/user/env/local/lib/python2.7/site-packages/couchdbkit/schema/base.py", line 405, in init
DocumentSchema.init(self, _d, **kwargs)
File "/home/user/env/local/lib/python2.7/site-packages/couchdbkit/schema/base.py", line 113, in init
prop.property_init(self, value)
File "/home/user/env/local/lib/python2.7/site-packages/couchdbkit/schema/properties.py", line 95, in property_init
value = self.to_json(self.validate(value, required=False))
File "/home/user/env/local/lib/python2.7/site-packages/couchdbkit/schema/properties.py", line 304, in validate
(self.name, self.data_type.name, type(value).name))
couchdbkit.exceptions.BadValueError: Property update must be a datetime, current is unicode
having a little look at what was going on, it appears the validate method is being called before the to_python so yes it is a unicode string and not a datetime object
The text was updated successfully, but these errors were encountered:
I've created a Document class as so:
class Base(Document):
... doc_schema = IntegerProperty(required=True)
... name = StringProperty(required=True)
... update = DateTimeProperty(required=True, auto_now=True)
... created = DateTimeProperty(required=True, auto_now_add=True)
I have some json returned by a db.get(doc_id)
{u'created': u'2012-01-07T18:17:39Z',
u'doc_schema': 0,
u'doc_type': u'test',
u'name': u'abc',
u'update': u'2012-01-07T18:17:39Z'}
I've also tried db.open_doc()
Traceback (most recent call last):
File "", line 1, in
File "/home/user/env/local/lib/python2.7/site-packages/couchdbkit/schema/base.py", line 405, in init
DocumentSchema.init(self, _d, **kwargs)
File "/home/user/env/local/lib/python2.7/site-packages/couchdbkit/schema/base.py", line 113, in init
prop.property_init(self, value)
File "/home/user/env/local/lib/python2.7/site-packages/couchdbkit/schema/properties.py", line 95, in property_init
value = self.to_json(self.validate(value, required=False))
File "/home/user/env/local/lib/python2.7/site-packages/couchdbkit/schema/properties.py", line 304, in validate
(self.name, self.data_type.name, type(value).name))
couchdbkit.exceptions.BadValueError: Property update must be a datetime, current is unicode
having a little look at what was going on, it appears the validate method is being called before the to_python so yes it is a unicode string and not a datetime object
The text was updated successfully, but these errors were encountered: