Skip to main content

Ajax call in Django admin interface

Project description

Auto load field data on change of other field value in django admin with Ajax call

https://github.com/farajim25/django-indo/blob/master/docs/images/example.gif

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.4.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

django_indo-1.0.4-py2.py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 2 Python 3

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