All Projects → shinneider → django-admin-search

shinneider / django-admin-search

Licence: MIT license
Modal filter for django admin

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to django-admin-search

BioBalanceDetector
Bio Balance Detector's products aim to show the weak electromagnetic fields around every living being (including plants, animals and humans) and display it in a heat-map like hyper-spectral image.
Stars: ✭ 18 (-70%)
Mutual labels:  filter, filters
Ewma
Exponentially Weighted Moving Average Filter
Stars: ✭ 21 (-65%)
Mutual labels:  filter, filters
Exopite-Multifilter-Multi-Sorter-WordPress-Plugin
Display and/or sort/filter any page or post types by multiple taxonomies or terms (like post by categories and/or tags) with AJAX. Exopite multifilter, multi-sortable, multi selectable, multi filterable sortable Wordpress Plugin.
Stars: ✭ 18 (-70%)
Mutual labels:  filter, filters
express-mquery
Expose mongoose query API through HTTP request.
Stars: ✭ 37 (-38.33%)
Mutual labels:  filter, filters
Obs Streamfx
StreamFX is a plugin for OBS Studio which adds many new effects, filters, sources, transitions and encoders - all for free! Be it 3D Transform, Blur, complex Masking, or even custom shaders, you'll find it all here.
Stars: ✭ 1,128 (+1780%)
Mutual labels:  filter, filters
spark-ar-creators
List of 9500 (and counting) Spark AR Creators. Open an issue or contact me if you want to be added.❤️
Stars: ✭ 122 (+103.33%)
Mutual labels:  filter, filters
Gaussianblur
An easy and fast library to apply gaussian blur filter on any images. 🎩
Stars: ✭ 473 (+688.33%)
Mutual labels:  filter, filters
Hypermark
Markdown for Humans.
Stars: ✭ 266 (+343.33%)
Mutual labels:  filter, filters
Pgo
Go library for PHP community with convenient functions
Stars: ✭ 51 (-15%)
Mutual labels:  filter, filters
Pornlist
Ad-blocking porn websites filter list for Adblock Plus and uBlock Origin.
Stars: ✭ 21 (-65%)
Mutual labels:  filter, filters
Android-FilterView
Build a simple filter view with customizable controls.
Stars: ✭ 20 (-66.67%)
Mutual labels:  filter, filters
Pixelsdk
The modern photo and video editor for your iPhone / iPad app. A fully customizable image & video editing iOS Swift framework.
Stars: ✭ 192 (+220%)
Mutual labels:  filter, filters
vesdk-android-demo
VideoEditor SDK: A fully customizable video editor for your app.
Stars: ✭ 90 (+50%)
Mutual labels:  filter, filters
iirj
An efficient IIR filter library written in JAVA
Stars: ✭ 95 (+58.33%)
Mutual labels:  filter, filters
Django Admin Numeric Filter
Numeric filters for Django admin
Stars: ✭ 46 (-23.33%)
Mutual labels:  filters, django-admin
Django Suit Daterange Filter
Filter for django-admin allowing lookups by date range
Stars: ✭ 13 (-78.33%)
Mutual labels:  filter, django-admin
Gl React Instagramfilters
Instagram filters for gl-react and gl-react-native
Stars: ✭ 157 (+161.67%)
Mutual labels:  filter, filters
Iir1
IIR realtime filter library written in C++
Stars: ✭ 224 (+273.33%)
Mutual labels:  filter, filters
Tablefilter
A Javascript library making HTML tables filterable and a bit more :)
Stars: ✭ 248 (+313.33%)
Mutual labels:  filter
amino-bot
Bot for aminoapps.com
Stars: ✭ 21 (-65%)
Mutual labels:  filter

Django Admin Search

Downloads Downloads Downloads

Coverage Quality Gate Status PyPI version
The "Django Admin Search" is a advanced search modal for django admin.

If you use or like the project, click Star and Watch to generate metrics and i evaluate project continuity.

Install:

pip install django-admin-search

Usage:

  1. Add to your INSTALLED_APPS, in settings.py:

    INSTALLED_APPS = [  
        ...
        'django_admin_search',
        ...
    ]
    
  2. Create a search form for model:

    from .models import Area
    from django.forms import ModelForm, Form
    from django.forms import DateField, CharField, ChoiceField, TextInput
    
    
    class YourFormSearch(Form):
        name = CharField(required=False)
        date = DateField(required=False, widget=TextInput(
            attrs={ 
                'filter_method': '__gte',
            }
        ))
    
  3. In your admin:

    from django_admin_search.admin import AdvancedSearchAdmin
    from .models import YourModel
    from .form import YourForm, YourFormSearch
    
    @register(YourModel)
    class YourAdmin(AdvancedSearchAdmin):
        form = YourForm
        search_form = YourFormSearch
    

Advanced:

  1. to multiple filters in same field:

    class YourFormSearch(Form):
        ...
        name = CharField(required=False)
        begin = DateField(required=False, widget=TextInput(
            attrs={
                'filter_field': 'date', 
                'filter_method': '__gte',
            }
        ))
        end = DateField(required=False, widget=TextInput(
            attrs={
                'filter_field': 'date', 
                'filter_method': '__lte',
            }
        ))
    
  2. add placeholder and mask

    class YourFormSearch(Form):
        ...
        date = DateField(required=False, widget=TextInput(
            attrs={
                'data-mask': "00/00/0000", 
                'placeholder': 'MM/DD/YYYY'
            }
        ))
    
  3. Custom filter query for a field

    from django_admin_search.admin import AdvancedSearchAdmin
    from .models import YourModel
    from .form import YourForm, YourFormSearch
    
    @register(YourModel)
    class YourAdmin(AdvancedSearchAdmin):
        def search_FieldNameHere(request, field_value, param_values):
            """
                intercept query filter for description field
            """
            query = Q()
            # your Q logic here
            return query
    

Images:

Button in admin list: input

Modal opened: modal

Development and Running the Tests

To do development work for Django Admin Search, clone it locally, make and activate a virtualenv for it, then from within the project directory:

pip install -e ".[dev]"

To run the tests:

pytest

If your work in high difficult test, and need to re run the test every time, use pytest-watch:

ptw  # this see file change and re run a test

when you need to see passed lines by test, run

pytest --cov-report html

after this, will be created a htmlcov folder in the root

To run sonar

pytest --cov-report xml
pylint ./django_admin_search/ --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" | tee pylint.txt
sonar-scanner

See your code quality in Sonar (in testing, no metrics to approve yet)

https://sonarcloud.io/dashboard?id=shinneider_django-admin-search

For future i want to run test's in Travis CI, to check if PR is Ok, but to be effective, i need to cover 80% or more of the code, help-me creating a test case, see this issue PR - 20

Need a Maintainer

In the last months i don't have much time, health problemas, change of country and others problems.
i have some surgeries for first part of 2022, and all of my current project don't use django-admin.
for these reasons, i need a help for a project continuation!!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].