Extra filters for django admin site
Project description
Collection of extra filters for the Django admin site
Demo can be found at https://django-smart-admin.herokuapp.com/
Filters
AutocompleteFilter
AllValuesComboFilter
AllValuesRadioFilter
BooleanRadioFilter
NumberFilter
RelatedFieldComboFilter
RelatedFieldRadioFilter
RelatedFieldCheckBoxFilter
StartWithFilter
PermissionPrefixFilter
MultipleSelectFieldListFilter
IntersectionFieldListFilter
UnionFieldListFilter
ForeignKeyFieldFilter
Usage examples
class MyModel(models.Model):
index = models.CharField(max_length=255)
name = models.CharField(max_length=255)
age = models.IntegerField()
flag = models.CharField(default="1", choices=(("0", "Flag 1"), ("1", "Flag 2"))
household = models.ForeignKey('Household')
custom = JSONField(default=dict, blank=True)
class MyModelAdmin(ModelAdmin):
list_filter = (
("custom", JsonFieldFilter.factory(can_negate=False, options=True)),
("flag", ChoicesFieldComboFilter),
('household', AutoCompleteFilter)
GenericLookupFieldFilter.factory('name__istartswith', can_negate=False, negated=True),
("age", NumberFilter),
)
Run demo app
Note: django-adminfilters is also included in django-smart-admin, there is a running demo at https://django-smart-admin.herokuapp.com/
$ git clone https://github.com/saxix/django-adminfilters.git
$ cd django-adminfilters
$ python3 -m venv .venv
$ source .venv/bin/activate
$ make develop
$ make demo
Project links
Project home page: https://github.com/saxix/django-adminfilters
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for django-adminfilters-1.9.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73c876b6039053ed39572b977d113ad220ba6b73a24330d08326927d6b013cdb |
|
MD5 | 67dd4127e7207978067b28efa2b5dabe |
|
BLAKE2b-256 | 6e1d4480819bbf76d1ae2cbb9495ed116bd5b68758ef09a5fea8bb712504f952 |