Custom fields as foreign keys fix
|Reported by:||Melvyn Sopacua||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.