mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[1.4.X] Fixed #9471 - Expanded ModelAdmin.raw_id_fields docs; thanks adroffne for the suggestion.
Backport of da958eb209 from master
This commit is contained in:
parent
ce168bb899
commit
baf1f1dcde
BIN
docs/ref/contrib/admin/_images/raw_id_fields.png
Normal file
BIN
docs/ref/contrib/admin/_images/raw_id_fields.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
@ -814,6 +814,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
|
||||||
|
|
||||||
.. versionadded:: 1.2
|
.. versionadded:: 1.2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user