j2labs/dictshield — Issue #51: demos/diff_obj_id.py fails
Author: talos
Created: 2011-12-07 04:55:09+00:00
State: open

This demo throws the following error:

SimpleDoc:
Traceback (most recent call last):
File "demos/diff_obj_id.py", line 29, in
print 'SimpleDoc:', sd.to_python()
File "/Users/talos/.virtualenvs/caustic/lib/python2.7/site-packages/dictshield/document.py", line 424, in to_python
data = self._to_fields(fun)
File "/Users/talos/.virtualenvs/caustic/lib/python2.7/site-packages/dictshield/document.py", line 406, in _to_fields
data[field.uniq_field] = field_converter(field, value)
File "/Users/talos/.virtualenvs/caustic/lib/python2.7/site-packages/dictshield/document.py", line 423, in
fun = lambda f, v: f.for_python(v)
File "/Users/talos/.virtualenvs/caustic/lib/python2.7/site-packages/dictshield/fields/mongo.py", line 42, in for_python
raise ShieldException('Invalid ObjectId', self.field_name, value)
dictshield.base.ShieldException: Invalid ObjectId - id:4edef13acc50ff07e4000000

ObjectIdField appears to never validate properly once it is assigned.