Closed davidchua closed 6 years ago
I've traced it down to
What was the reason we stripped underscores in dynamic fields?
Hi,
when you look at: https://github.com/heynemann/motorengine/blob/76373643924def366756f0de0b886ede692658e1/motorengine/document.py#L29 and https://github.com/heynemann/motorengine/blob/76373643924def366756f0de0b886ede692658e1/motorengine/document.py#L59
You will see that all fields in the document are stored and accessed with the field name without . The name method therefore returns the name without . Only in the database itsself the dynamic field is stored with _ to identify them.
chris
@christ0pher's PR is now merged. It should work now as expected. Have a nice day!
Version: 0.9.0
When attempting to output a Document's fields, if there is an attribute with an underscore (ie. _aasm_state), it will return an error on the 2nd time a self._values is called.
My Model:
Example Object
When I remove the attribute _aasm_state, calls made to
trip.output()
repeatedly returns no errors.Also, if I were to add a debugger in
And make a single call, the debugger will hit the breakpoint twice instead of once.