Skip to content

Commit

Permalink
Fixed #9471 - Expanded ModelAdmin.raw_id_fields docs; thanks adroffne…
Browse files Browse the repository at this point in the history
… for the suggestion.
  • Loading branch information
timgraham committed Oct 24, 2012
1 parent 1b096ad commit da958eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Binary file added docs/ref/contrib/admin/_images/raw_id_fields.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/ref/contrib/admin/index.txt
Expand Up @@ -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
Expand Down

0 comments on commit da958eb

Please sign in to comment.