Last active
April 21, 2020 22:18
-
-
Save icarovirtual/65fb8624f9021d89b4d532d2c3c6b222 to your computer and use it in GitHub Desktop.
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
class StatusFilter(admin.SimpleListFilter): | |
# Change your lookups function and include the class method | |
def lookups(self, request, model_admin): | |
return self._lookups() | |
@classmethod | |
def _lookups(cls): | |
# Static choices that will be used in the forms | |
return Article.Status.choices |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment