Queryset can be filtered by a given list on the django admin page, just like: qs.filter(field__in=[list])
Project description
dCEjango-valueinlist-filter
=========================
Queryset can be filtered by a given list on the django admin page, just like: qs.filter(field__in=[list]).
Installation
------------
.. code-block:: bash
cd django-valueinlist-filter
python setup.py install
Add valueinlist_filter to settings.INSTALLED_APPS:
.. code-block:: python
INSTALLED_APPS = (
...
'valueinlist_filter'
)
And then, set a CharField field in a model like this:
.. code-block:: python
class Model(models.Model):
...
serial_number = models.CharField(max_length=32)
If you want to filter the **serial_number** field by a given value list(split string by space), you can bind ValueInListFilter to this field:
.. code-block:: python
from valueinlist_filter.filter import ValueInListFilter
from django.contrib import admin
from models import Model
class ModelAdmin(admin.ModelAdmin):
list_filter = (
('serial_number', ValueInListFilter), # bind filter to CharField
...
)
Finally, you will get a textarea form on the filter side bar, the textarea's change event will trigger form.
Added a 'screenshot.png' picture.
=========================
Queryset can be filtered by a given list on the django admin page, just like: qs.filter(field__in=[list]).
Installation
------------
.. code-block:: bash
cd django-valueinlist-filter
python setup.py install
Add valueinlist_filter to settings.INSTALLED_APPS:
.. code-block:: python
INSTALLED_APPS = (
...
'valueinlist_filter'
)
And then, set a CharField field in a model like this:
.. code-block:: python
class Model(models.Model):
...
serial_number = models.CharField(max_length=32)
If you want to filter the **serial_number** field by a given value list(split string by space), you can bind ValueInListFilter to this field:
.. code-block:: python
from valueinlist_filter.filter import ValueInListFilter
from django.contrib import admin
from models import Model
class ModelAdmin(admin.ModelAdmin):
list_filter = (
('serial_number', ValueInListFilter), # bind filter to CharField
...
)
Finally, you will get a textarea form on the filter side bar, the textarea's change event will trigger form.
Added a 'screenshot.png' picture.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-valueinlist-filter-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc8673bd08ab32cadd1056582474ee6f830604f0bb07b1122183b9419f6fde8f |
|
MD5 | cd47142372cb97853bc9f5f80db32085 |
|
BLAKE2b-256 | 202ba897574bbe37cfec85bf945447fedceda2be8668fad7e8a47aa351d1b7e5 |
Close
Hashes for django-valueinlist-filter-0.1.linux-i686.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65d02b6feba9bd8a0a3b1f683c7b3845533e926f8b85d5012a661e483cba91eb |
|
MD5 | 745ee0fac90ea301ed84586ed38a5625 |
|
BLAKE2b-256 | 84018af52707c2c8d99490d6443092cfbee6e1a4b9d4177b452ea3938f4b2bdb |