mirror of https://github.com/django/django.git
Remove an extraneous comma that I left behind in [7386], and clean up the wording a bit more.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b8110ed537
commit
502f0c18b0
|
@ -1552,12 +1552,11 @@ additional required argument:
|
||||||
Allows the selection of a single model object, suitable for
|
Allows the selection of a single model object, suitable for
|
||||||
representing a foreign key.
|
representing a foreign key.
|
||||||
|
|
||||||
The labels for the choice field call the ``__unicode__`` method of the
|
The ``__unicode__`` method of the model will be called to generate
|
||||||
model to generate string representations to use in the field's
|
string representations of the objects for use in the field's choices;
|
||||||
choices; to provide customized representations,, subclass
|
to provide customized representations, subclass ``ModelChoiceField``
|
||||||
``ModelChoiceField`` and override ``label_for_model``; this method
|
and override ``label_for_model``. This method will receive model
|
||||||
will receive an object, and should return a string suitable for
|
object, and should return a string suitable for representing it::
|
||||||
representing it::
|
|
||||||
|
|
||||||
class MyModelChoiceField(ModelChoiceField):
|
class MyModelChoiceField(ModelChoiceField):
|
||||||
def label_from_instance(self, obj):
|
def label_from_instance(self, obj):
|
||||||
|
|
Loading…
Reference in New Issue