-
Notifications
You must be signed in to change notification settings - Fork 801
Closed
Labels
Category: BugSomething isn't rightSomething isn't right
Description
For example:
class Location(InnerDoc):
country = Text()
city = Text()
class User(Document):
name = Text()
location = Object(Location)
class Index:
...
user = User(name='alice', location=Location(country='foo', city='bar'))
user.save()
user.update(location=Location(city='baz'))then it will raise the following error
InnerDoc inherits from AttrDict, and merge method accepts AttrDict to be merged, the problem is that not all AttrDict subclasses implement a dict-like interface for iterate, such as InnerDoc
I think, its better to first convert AttrDict to dict in merge method to make it iterable. After this fix, doc creation & update can both accept InnerDoc.
Metadata
Metadata
Assignees
Labels
Category: BugSomething isn't rightSomething isn't right
