You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/customization.rst
+14-11
Original file line number
Diff line number
Diff line change
@@ -40,13 +40,12 @@ A ModelAdmin example::
40
40
}),
41
41
)
42
42
43
-
An InlineModelAdmin example::
43
+
With `StackedInlines <https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.StackedInline>`_, an additional property ``inline_classes`` is available to define the default collapsible state of the inline items (in contrast to the whole group)::
44
44
45
45
class NavigationItemInline(admin.StackedInline):
46
46
classes = ('collapse open',)
47
+
inline_classes = ('collapse open',)
47
48
48
-
.. note::
49
-
With Inlines, only the Inline-Group (and not the Inline-items) are affected by the ``classes`` property.
50
49
51
50
.. _customizationinlinessortables:
52
51
@@ -150,11 +149,19 @@ For the represantation of an object, we first check for a callable ``related_lab
150
149
Autocomplete Lookups
151
150
--------------------
152
151
152
+
.. versionchanged:: 2.3.5
153
+
staticmethod ``autocomplete_search_fields`` is required, ``related_autocomplete_lookup`` has been removed.
153
154
.. versionadded:: 2.3.4
154
155
``autocomplete_lookup_fields``.
155
156
156
-
.. note::
157
-
Please note that this feature is fairly new. It´s well tested, but we still consider it experimental with this version of |grappelli|.
157
+
Add the staticmethod ``autocomplete_search_fields`` to all models you want to search for::
158
+
159
+
class MyModel(models.Model):
160
+
name = models.CharField(u"Name", max_length=50)
161
+
162
+
@staticmethod
163
+
def autocomplete_search_fields():
164
+
return ("id__iexact", "name__icontains",)
158
165
159
166
Defining autocomplete lookups is very similar to related lookups::
160
167
@@ -202,17 +209,13 @@ If your generic relation points to a model using a custom primary key, you need
202
209
def id(self):
203
210
return self.cpk
204
211
205
-
For the represantation of an object, we first check for a callable ``related_label``. If not given, ``__unicode__`` is being used.
206
-
The lookup checks for a callable ``related_autocomplete_lookup`` with your model. If not given, ``__unicode__`` is being used::
212
+
For the represantation of an object, we first check for a callable ``related_label``. If not given, ``__unicode__`` is being used::
Copy file name to clipboardexpand all lines: docs/index.rst
+8-2
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
contain the root `toctree` directive.
5
5
.. |grappelli| replace:: Grappelli
6
6
.. |filebrowser| replace:: FileBrowser
7
+
.. |version| replace:: 2.3.8
7
8
8
9
.. _index:
9
10
@@ -12,10 +13,10 @@ Documentation
12
13
13
14
**A jazzy skin for the Django admin interface**.
14
15
15
-
This documentation covers version 2.3.5 of |grappelli|. |grappelli| is a grid-based alternative/extension to the `Django <http://www.djangoproject.com>`_ administration interface.
16
+
This documentation covers version |version| of |grappelli|. |grappelli| is a grid-based alternative/extension to the `Django <http://www.djangoproject.com>`_ administration interface.
16
17
17
18
.. note::
18
-
|grappelli| 2.3.5 requires Django 1.3. |grappelli| is always developed against the lastest stable Django release and is NOT tested with Djangos trunk.
19
+
|grappelli| |version| requires Django 1.3. |grappelli| is always developed against the lastest stable Django release and is NOT tested with Djangos trunk.
0 commit comments