Skip to main content

Dynamic Search in Array Field in Django Admin# django_search_arrayfield

Project description

A package that allows Dynamic Search in Array Field in Django Admin# django_search_arrayfield

Quickstart

Install Django better admin ArrayField:

pip install django-search-arrayfield

Add it to your `INSTALLED_APPS`:

INSTALLED_APPS = (
    ...
    'django_search_arrayfield',
    ...
)

Usage

django_search_arrayfield provide dyanimic search in text boxes provides by django_better_admin_arrayfield,

Import it like below and use it in your model class definition.

from django_search_arrayfield.models.fields import ArrayField as SearchArrayField

as is use to aviod any unneccary conflict with django-better-admin

Import DynamicArrayMixin like below

from django_search_arrayfield.admin.mixins import DynamicArrayMixin

In your admin class add DynamicArrayMixin: ...

class MyModelAdmin(admin.ModelAdmin, DynamicArrayMixin):

Inside your admin class add this line: ...

change_form_template = 'abc.html'

abc.html is a file which will add that javascript file(def.js) in which function with name RouteToFunction is present

<script src="{% static 'js/def.js' %}" ></script>

Inside def.js file add a function with name RouteToFunction which will get the input-id of the text box selected

function RouteToFunction(input_id){
}

That's it.

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_search_arrayfield-1.2.1.tar.gz (18.9 kB view hashes)

Uploaded Source

Built Distribution

django_search_arrayfield-1.2.1-py3-none-any.whl (20.3 kB view hashes)

Uploaded 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