Ajax call in Django admin interface
Project description
Auto load field data on change of other field value in django admin with Ajax call
Requirements
Django 2.0+
Installation
pip install django-indo
Add indo to INSTALLED_APPS:
INSTALLED_APPS = [
...
'indo',
...
]
Example usage
from indo.admin import IndoResponseMixin, IndoSetFieldMixin
@admin.register(Customer)
class CustomerAdmin(IndoResponseMixin, admin.ModelAdmin):
fields = (
'name',
'address',
)
@admin.register(Order)
class OrderAdmin(IndoSetFieldMixin, admin.ModelAdmin):
fields = (
'customer',
'delivery_address',
)
indo_fields = {
'delivery_address': 'customer__address'
}
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-indo-1.0.2.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for django_indo-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d624a580cf93e021aa9808c9fc7f85bf7298f90402809ff5b1a8c5a205feccd |
|
MD5 | 47dbb6a634eab13ee79e7c1493c61a12 |
|
BLAKE2b-256 | e6e4b4b743de6de7c8f3f8b14a43aea811fd7b739bd8dabfcab0e2fff66c7ec4 |