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: README.md
+3-4
Original file line number
Diff line number
Diff line change
@@ -154,6 +154,8 @@ Each element of the list consists of three values.
154
154
- checkbox label
155
155
- filtering expression applied to the DB model in the form of [Django Q-objects](https://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects)
156
156
157
+
In the `parameter_name` attribute, you need to specify the name of the GET request parameter for sending filter data.
158
+
157
159
For our example, the code will look like this.
158
160
159
161
```python
@@ -163,6 +165,7 @@ from django_admin_filters import MultiChoiceExt
@@ -176,10 +179,6 @@ class Admin(admin.ModelAdmin):
176
179
admin.site.register(Log, Admin)
177
180
```
178
181
179
-
When specifying the field to which the filter is applied, you must specify the name of an existing model field (for example, 'is_online' in the example above),
180
-
and not the name of the virtual property ('color').
181
-
You can specify the name of any field in the model. This is necessary so that Django will recognize it as valid when creating an instance of the filter.
182
-
183
182
Otherwise, the behavior and settings of the `MultiChoiceExt` filter are similar to the `MultiChoice` filter described earlier.
- применяемое к таблице модели в БД выражение фильтрации в виде [Q-объектов Django](https://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects)
151
151
152
+
В атрибуте `parameter_name` нужно указать имя параметра GET-запроса, в котором будут передаваться данные фильтра.
153
+
152
154
Для нашего примера код будет таким.
153
155
154
156
```python
@@ -158,6 +160,7 @@ from django_admin_filters import MultiChoiceExt
0 commit comments