Custom fields as foreign keys fix
|Reported by:||msopacua||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||no|
Custom fields which have a different database representation as python representation are not handled correctly when rendered as Select fields. The underlying cause is that the value on the model that has the foreign key is the database representation and it is not converted to python representation when model_to_dict is called.
The ForeignKey field subclasses RelatedField and Field, but RelatedField does not override it's value_from_object method to convert the value to python.
Change History (9)
Changed 3 years ago by msopacua
comment:1 Changed 3 years ago by aaugustin
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset