Code

Ticket #2638: 2638.diff

File 2638.diff, 1.8 KB (added by heckj@…, 8 years ago)

attaching patch (from trunk) for a suggested resolution. Includes update to documentation

Line 
1Index: django/db/models/fields/generic.py
2===================================================================
3--- django/db/models/fields/generic.py  (revision 3710)
4+++ django/db/models/fields/generic.py  (working copy)
5@@ -252,7 +252,7 @@
6         self.filter_interface = None
7         self.limit_choices_to = limit_choices_to or {}
8         self.edit_inline = False
9-        self.raw_id_admin = False
10+        self.raw_id_admin = True
11         self.symmetrical = symmetrical
12         self.multiple = True
13         assert not (self.raw_id_admin and self.filter_interface), \
14Index: docs/model-api.txt
15===================================================================
16--- docs/model-api.txt  (revision 3710)
17+++ docs/model-api.txt  (working copy)
18@@ -767,10 +767,13 @@
19     ``num_in_admin``         The default number of inline objects to display
20                              on the object page at the add stage.
21 
22-    ``raw_id_admin``         Only display a field for the integer to be entered
23-                             instead of a drop-down menu. This is useful when
24-                             related to an object type that will have too many
25-                             rows to make a select box practical.
26+    ``raw_id_admin``         When set to False, display a drop-down menu instead
27+                             of an integer only field. This is useful when
28+                             related to an object type that has few enough rows
29+                             to make a select box practical. When ``raw_id_admin``
30+                             is to False, any use of an to save will cause that
31+                             AddManipulator to load all the potential relations
32+                             to this object.
33 
34                              Not used with ``edit_inline``.
35