Skip to content

Instantly share code, notes, and snippets.

@icarovirtual
Last active April 21, 2020 22:18
Show Gist options
  • Save icarovirtual/65fb8624f9021d89b4d532d2c3c6b222 to your computer and use it in GitHub Desktop.
Save icarovirtual/65fb8624f9021d89b4d532d2c3c6b222 to your computer and use it in GitHub Desktop.
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