浏览代码

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

Tim Graham 12 年之前
父节点
当前提交
da958eb209
共有 2 个文件被更改,包括 8 次插入0 次删除
  1. 二进制
      docs/ref/contrib/admin/_images/raw_id_fields.png
  2. 8 0
      docs/ref/contrib/admin/index.txt

二进制
docs/ref/contrib/admin/_images/raw_id_fields.png


+ 8 - 0
docs/ref/contrib/admin/index.txt

@@ -803,6 +803,14 @@ subclass::
         class ArticleAdmin(admin.ModelAdmin):
             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
 
     By default the admin shows all fields as editable. Any fields in this