Kaydet (Commit) da958eb2 authored tarafından Tim Graham's avatar Tim Graham

Fixed #9471 - Expanded ModelAdmin.raw_id_fields docs; thanks adroffne for the suggestion.

üst 1b096ad7
...@@ -803,6 +803,14 @@ subclass:: ...@@ -803,6 +803,14 @@ subclass::
class ArticleAdmin(admin.ModelAdmin): class ArticleAdmin(admin.ModelAdmin):
raw_id_fields = ("newspaper",) raw_id_fields = ("newspaper",)
The ``raw_id_fields`` ``Input`` widget should contain a primary key if the
field is a ``ForeignKey`` or a comma separated list of values if the field
is a ``ManyToManyField``. The ``raw_id_fields`` widget shows a magnifying
glass button next to the field which allows users to search for and select
a value:
.. image:: _images/raw_id_fields.png
.. attribute:: ModelAdmin.readonly_fields .. attribute:: ModelAdmin.readonly_fields
By default the admin shows all fields as editable. Any fields in this By default the admin shows all fields as editable. Any fields in this
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment