The ChoiceField creates a select html element and the options show the choice_label which is the __unicode__ of each model object.
How can I change the text of the choice_label without modifying __unicode__ ?
I have a Product model and I want to show in the options text the product name + price + link to edit.
I’ve searched in fields.py and widgets.py but couldn’t find what needed to be changed.
Thanks
The from field class, eg.
ModelChoiceFieldhas a methodlabel_from_instancethat you can override in your subclass.Originally it looks like this:
Should be no big problem to adjust this to your needs!