Metadata-Version: 2.1
Name: search-placeholder
Version: 0.2.0
Summary: Auto add placeholder content for django admin
Home-page: https://github.com/waketzheng/django-search-placeholder
License: MIT
Keywords: django,search,placeholder
Author: Waket Zheng
Author-email: waketzheng@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Requires-Dist: Django (>=4.0,<5.0)
Project-URL: Repository, https://github.com/waketzheng/django-search-placeholder
Description-Content-Type: text/markdown

# django-search-placeholder
Auto add placeholder content for django admin

## Install
- By git
```bash
pip install search-placeholder
```

## Usage

1. Add app name to settings
```py
INSTALLED_APPS = [
    ...
    "django.contrib.admin",
    ...
    "search_placeholder",
    ...
]
```
2. 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')
```

