Ticket #6843: newforms_label.patch

File newforms_label.patch, 648 bytes (added by Jan Rademaker <j.rademaker@…>, 7 years ago)
  • docs/newforms.txt

     
    15541554string to represent it.
    15551555
    15561556The labels for the choice field call the ``__unicode__`` method of the model to
    1557 generate string representations. To provide custom labels, subclass ``ModelChoiceField`` and override ``label_for_model``::
     1557generate string representations. To provide custom labels, subclass ``ModelChoiceField`` and override ``label_from_instance``::
    15581558
    15591559    class MyModelChoiceField(ModelChoiceField):
    15601560        def label_from_instance(self, obj):
Back to Top