Skip to main content

Auto add placeholder content for django admin

Project description

django-search-placeholder

Auto add placeholder content for django admin

Install

  • By git
pip install search-placeholder

Usage

  1. Add app name to settings
INSTALLED_APPS = [
    ...
    "django.contrib.admin",
    ...
    "search_placeholder",
    ...
]
  1. Use search_placeholder.ModelAdmin to replace admin.ModelAdmin
from django.contrib import admin
from search_placeholder import ModelAdmin

@admin.register(ModelClass)
class ModelClassAdmin(ModelAdmin):
    # Just inherit from search_placeholder.ModelAdmin
    # it will auto generate placeholder of search input by
    # the verbose_name of 'field1' and 'field2'
    # Or you can uncomment the next line to custom placeholder
    #search_placeholder = 'Custom content'
    search_fields = ('field1', 'field2')

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

search_placeholder-0.2.0.tar.gz (4.7 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page