MongoEngine/mongoengine — pull request #777 by andrewelkins (2014-10-03 21:09:21+00:00)
Title: Update document.py

First, I could have missed a config item in my class. If I did, just point me to the docs for it.

Now for my issue. For me I had a EmbeddedDocument class
```
class EventRaw(mongodb.EmbeddedDocument):
timestamp = mongodb.DateTimeField(default=datetime.now)
data = mongodb.ListField()
```

Which a document class is using.

```

class Events(mongodb.Document):
events = mongodb.ListField(mongodb.EmbeddedDocumentField(EventRaw))
date = mongodb.DateTimeField(default=datetime.now)
....
```
Which was giving me an error.
```
File "/usr/local/lib/python2.7/dist-packages/mongoengine/document.py", line 65, in __init__
super(EmbeddedDocument, self).__init__(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/mongoengine/base/document.py", line 47, in __init__
if self._auto_id_field:
AttributeError: 'EventRaw' object has no attribute '_auto_id_field'
```
You might want the fix instead in the EmbeddedDocument class instead.

My temporary fix was to set the auto id of the EventRaw class.
```
class EventRaw(mongodb.EmbeddedDocument):
timestamp = mongodb.DateTimeField(default=datetime.now)
data = mongodb.ListField()

_auto_id_field = False
```