Skip to main content

A different implementation of Django's admin search

Project description

django-better-search

This repo is heavily influenced by django-admin-search and copies some of the components as well.

This repo implements search on Django admin page differently. It generates different search boxes for separate fields and doesn't treat all of those fields as string.

Requirements

This app requires the following:

  • Django >= 3.2

Usage

Note: This project is not yet ready for production use.

  1. Create a search form to have search fields on your admin page. Example:
from django.forms import CharField, Form, IntegerField


class UserSearchForm(Form):
    name = CharField(required=False, label="User's Name", help_text="Some help_text")
    age = IntegerField(required=False, label="User's Age", help_text="Another help_text")
    ...
  1. Use the search form in your AppAdmin in your admin.py. Example:
from django_separate_search.admin import SeparateSearchAdmin


class UserAssessmentAdmin(SeparateSearchAdmin):
    ...
    search_form = UserSearchForm
    ...

This will render your search-form fields on the listview admin page.

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

django_better_search-0.1.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

django_better_search-0.1.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file django_better_search-0.1.2.tar.gz.

File metadata

  • Download URL: django_better_search-0.1.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for django_better_search-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e0f4840469003231557a4a3e37141fdce94219734c668976f189eb41eed573a6
MD5 8f3851456ece5a6ee8dd325063f7ced8
BLAKE2b-256 2f9487100a5af8b3f524db3e5bc18e730a22ad5da1c382838a303015912c13bc

See more details on using hashes here.

File details

Details for the file django_better_search-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_better_search-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 852754b34589f4dba30ed933e035b7e746ab4e8e5e95f5426faaec82963a6b9a
MD5 d2e64fc88ef058d18a17fd3324cde9db
BLAKE2b-256 8fc7db67d3d00ac4ed1a543a321cbae04a5fce3ffb11c92e9207e0c6f8abb15d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page