import mongoengine as mg
class Team(mg.Document):
# ......
meta = mg.DictField()
Traceback (most recent call last):
File "api.py", line 10, in <module>
from models import *
File "/Users/j/Source/ColorCommentary/models.py", line 11, in <module>
class Team(mg.Document):
File "/Users/j/.virtualenvs/colorcommentary/lib/python2.7/site-packages/mongoengine/base/metaclasses.py", line 260, in __new__
attrs['_meta']['abstract'] = attrs['_meta'].get('abstract', False)
AttributeError: 'DictField' object has no attribute 'get'
Nevermind. tl;dr don't use probably-reserved words as column names, derp. Changing the field to team_meta did the job.
What are the chances that I would exactly create a meta field with DictField and end up seeing this issue 5 years later :)
Most helpful comment
What are the chances that I would exactly create a meta field with DictField and end up seeing this issue 5 years later :)