Skip to content

Document Queryset: TypeError: __init__() got an unexpected keyword argument '__auto_convert' #1794

@theseanathan

Description

@theseanathan

Using mongoengine=0.15.0, pymongo=3.6.1.

When calling a Document.objects, I get a Queryset for the Collection, but when trying to iterate through it, creating the actual Document from the set fails with:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/sdarryanto/Documents/workspace/betterblend/venv/lib/python3.6/site-packages/mongoengine/queryset/queryset.py", line 99, in _iter_results
    self._populate_cache()
  File "/Users/sdarryanto/Documents/workspace/betterblend/venv/lib/python3.6/site-packages/mongoengine/queryset/queryset.py", line 118, in _populate_cache
    self._result_cache.append(next(self))
  File "/Users/sdarryanto/Documents/workspace/betterblend/venv/lib/python3.6/site-packages/mongoengine/queryset/base.py", line 1473, in __next__
    only_fields=self.only_fields)
  File "/Users/sdarryanto/Documents/workspace/betterblend/venv/lib/python3.6/site-packages/mongoengine/base/document.py", line 721, in _from_son
    obj = cls(__auto_convert=False, _created=created, __only_fields=only_fields, **data)
TypeError: __init__() got an unexpected keyword argument '__auto_convert'

Any ideas?

Looking at the base.document.Document class, __auto_convert attribute definitely exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions