Skip to main content

A global search for Django Admin UI

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Django Admin Global Search

Downloads Downloads Downloads

Introduction

This Django application introduces a GlobalSearchView, designed to perform a global search across various models within the Django admin site. alt text alt text

Features

  • Global Search: Enables searching across multiple models from a single query.
  • Dynamic Model Inclusion: Automatically includes models that define global_search_fields, allowing for flexible search configurations.
  • Admin Integration: Provides direct links to the admin change page for each search result, facilitating easy editing.

Getting Started:

Prerequisites

  • Python versions 3.8+.
  • Django version 3+

Installation Steps

Install with command pip install django-admin-global-search.

Usage

To use django-admin-global-search in your Django project, you need to update your models and URL configurations.

  1. Add admin_global_search to your INSTALLED_APPS setting before django.contrib.admin.
INSTALLED_APPS = [
    "admin_global_search",
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    ...
]
  1. Ensure your models have a global_search_fields attribute that specifies the fields to be included in the search. Example:
class Artist(models.Model):
    name = models.CharField(max_length=100)
    bio = models.TextField(blank=True)

    global_search_fields = ("name", "bio")

    def __str__(self):
        return self.name
  1. Update your project's urls.py to include the GlobalSearchView. Example:
...
from admin_global_search.views import GlobalSearchView


urlpatterns = [
    path("admin/", admin.site.urls),
    path("search/", GlobalSearchView.as_view(), name="admin_global_search"),
    ...
]

Contributing

Contributions to the project are welcome. To contribute:

  1. Fork the repository.
  2. Create a new feature branch for your contribution.
  3. Commit your changes with a descriptive message.
  4. Push your changes to GitHub.
  5. Submit a pull request for review.

License

The project is made available under the BSD 3-Clause License. Please refer to the LICENSE file for more details.

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_admin_global_search-0.0.6.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_admin_global_search-0.0.6-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file django_admin_global_search-0.0.6.tar.gz.

File metadata

  • Download URL: django_admin_global_search-0.0.6.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.14 Linux/6.11.0-1018-azure

File hashes

Hashes for django_admin_global_search-0.0.6.tar.gz
Algorithm Hash digest
SHA256 4172432d1f857d8611ad5b146a5ed997960de4c6e964be382550bee2eb198a49
MD5 5de57dcdaf4fdbfb94f7ce795d47d260
BLAKE2b-256 acaff63c8820c2a1cfee05fb821ff60d317b1fbe94f510f20ecf2b2e0ee6ac71

See more details on using hashes here.

File details

Details for the file django_admin_global_search-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_global_search-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 338457d7ae70294246cc014e547d8fa95d64e27ad7531cbc8cbde7c533a9b87c
MD5 969ecbdef030b2b30ae00803f3151cba
BLAKE2b-256 76d28f1c7acdcd0d1a4fc6923b46eec9de9d35c10287b399e5a11a8fb0214f2b

See more details on using hashes here.

Supported by

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