
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
django-admin-search-filter
Advanced tools
Allows to create admin list filter as a search box for free-input
.. image:: https://img.shields.io/pypi/v/django_admin_search_filter.svg :target: https://pypi.python.org/pypi/django_admin_search_filter :alt: Latest PyPI version
.. image:: https://travis-ci.org/kragniz/cookiecutter-pypackage-minimal.png :target: https://travis-ci.org/kragniz/cookiecutter-pypackage-minimal :alt: Latest Travis CI build status
Provides special type of django-admin list filter -- search box with free user input allowed.
Some cases when you need such functionality:
The solution provided by this package is you place special (configurable) search input as a list filter.
Idea is taken from this Medium article: https://hakibenita.medium.com/how-to-add-a-text-filter-to-django-admin-5d1db93772d8
.. code-block:: python
from django_admin_search_filter import get_exact_equals_input_filter, get_icontains_input_filter
...
class SomeModelAdmin(...):
...
list_filter = (
...
get_icontains_input_filter(title_='name', attrs='name', ), # Substring search, one field
get_icontains_input_filter(title_='(alt)name', attrs=('name', 'alt_name') ), # Substring search, several fields
get_exact_equals_input_filter(title_='ID of transaction', attrs='transaction_id', ), # Exact search, one field
get_exact_equals_input_filter('ID of transaction/sender/reciever', # Exact search, several field
attrs=('transaction_id', 'sender_id', 'reciever_id' ))
)
Will result in the following UI:
.. image:: docs/admin_list_filters_screenshot.png :width: 300 :alt: Alternative text
#. pip install django-admin-search-filter
#. Add "django_admin_search_filter"
to django's INSTALLED_APPS
(to allow template to be loaded)
#. Ensure APP_DIRS
set to True
in templates configuration <https://docs.djangoproject.com/en/4.2/topics/templates/#support-for-template-engines>
_
Requirements ^^^^^^^^^^^^
MIT
django_admin_search_filter
was written by Mikhail Koipish <mkoypish@gmail.com>
_.
FAQs
Allows to create admin list filter as a search box for free-input
We found that django-admin-search-filter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.