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.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

django_better_search-0.1.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_better_search-0.1.3.tar.gz
  • Upload date:
  • Size: 5.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.3.tar.gz
Algorithm Hash digest
SHA256 0482775408d2f5fbb3f58e65ae5f50f81f55361fba7314b519cc47025ae70b0a
MD5 dc20f5880db4e1f893cae1b56b499653
BLAKE2b-256 e70383aa42a2552dc2170e9cf4ae210b6f969c0b9d979b571183a0f2d8fb86f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_better_search-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e7c1b5586571bee096ff803044aba2835c2cff0dec4ed0efa781850fc8dd3aa
MD5 f2eb0c9219d91f41e7e16f65363335d9
BLAKE2b-256 87c25b97351d7e812cf00173776fe3d291fe659d9fa5c965704aeaad7a75c6c2

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