-
Couldn't load subscription status.
- Fork 1.2k
Closed
Description
import mongoengine
mongoengine.connect()
class Project(mongoengine.Document):
id = mongoengine.StringField()
meta = {'abstract': True}
project = Project(id="TestProject")
project.save()Running the above example fails with the following:
Traceback (most recent call last):
File "test_project.py", line 10, in <module>
project.save()
File "C:\Python27\lib\site-packages\mongoengine\document.py", line 314, in save
collection = self._get_collection()
File "C:\Python27\lib\site-packages\mongoengine\document.py", line 207, in _get_collection
cls._collection = db[collection_name]
File "C:\Python27\lib\site-packages\pymongo\database.py", line 226, in __getitem__
return Collection(self, name)
File "C:\Python27\lib\site-packages\pymongo\collection.py", line 135, in __init__
"of %s" % (string_type.__name__,))
TypeError: name must be an instance of basestring
I feel like it should fail with some mongoengine.error class rather than a TypeError.
wojcikstefan
Metadata
Metadata
Assignees
Labels
No labels