forked from typeddjango/django-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing admin filter and fix model indexes (typeddjango#149)
Hello, this PR actually makes two changes: - add the missing `EmptyFieldListFilter`. - fix the model `Index` class which also accepts positional parameters. I am not sure if this is the right way to contribute to this repository. - Is it ok to submit both changes in a single PR? - How can I be sure everything is working fine? (a.k.a. tests)
- Loading branch information
Showing
6 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.contrib import admin | ||
|
||
from .models import IndexModel | ||
|
||
|
||
@admin.register(IndexModel) | ||
class IndexModelAdmin(admin.ModelAdmin[IndexModel]): | ||
list_display = [ | ||
"pub_date", "title", "author", "height", "weight", | ||
] | ||
list_filter = [ | ||
("author", admin.filters.EmptyFieldListFilter), | ||
"pub_date", | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters