-
Couldn't load subscription status.
- Fork 1.2k
Closed
Description
I have a document called Product, and call the Mongoengine provided convenience method get_type_display() to return the correct display name of the current choice for the field "type".
This works when I display a single Product, but when displaying this for each Product in a QuerySet, it returns a default value for all fields. So the result is:
print product.type => 'digital'
print product.get_type_display() => 'item' (incorrect value)
print product._BaseDocument__get_field_display(self._fields['type']) => 'digital' (the correct value)
I was not able to find the root cause of the error, but want to start this issue thread to get some pointers. Right now, I'm using the last line in above example as a workaround.
Metadata
Metadata
Assignees
Labels
No labels