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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django_search_arrayfield-1.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4907744a1cd343c59340790a27e0433ee7d00d17a8a40582f510817feaec1dd |
|
MD5 | c22caa436191d413a0f1383d99e4ed0d |
|
BLAKE2b-256 | 02997989a33860fa7b70d19ceb7628f2608d7b36d72b8c68940fd7250739eb2e |
Hashes for django_search_arrayfield-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bed7297eb49f5e66c61b80819ab24f9d80d0d441486cd9e4f587636a58d9e59 |
|
MD5 | be4d9adb3859d0c56b1932fac3ee2150 |
|
BLAKE2b-256 | 0749779e12bc4af1b006977b3c6e283fa74cd3bb8b23f61a9f80f41a870076e3 |