Better ArrayField widget for admin
Project description
Django better admin ArrayField
Better ArrayField widget for admin
Supported Python versions: 3.5, 3.6, 3.7 Supported Django versions: 1.11, 2.0, 2.1, 2.2
It changes comma separated widget to list based in admin panel.
Before:
After:
Quickstart
Install Django better admin ArrayField:
pip install django-better-admin-arrayfield
Add it to your `INSTALLED_APPS`:
INSTALLED_APPS = (
...
'django_better_admin_arrayfield.apps.DjangoBetterAdminArrayfieldConfig',
...
)
Usage
django_better_admin_arrayfield.models.fields.ArrayField
is a drop-in replacement for standard Django ArrayField
.
In your admin class add DynamicArrayMixin
:
class MyModelAdmin(admin.ModelAdmin, DynamicArrayMixin):
...
That's it.
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox
Pre-commit hooks
Install pre-commit black hook
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_dev.txt
(myenv) $ pre-commit install
Credits
Inspired by: https://stackoverflow.com/a/49370480/4638248
Tools used in rendering this package:
History
1.0.2 (2019-04-03)
- If field is required empty list raises ValidationError on clean.
1.0.1 (2019-02-23)
Fh&VtW*k9vh27Y@z58nk
- Empty list is no longer recognized as changed.
1.0.0 (2019-02-21)
- First release on PyPI.
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-better-admin-arrayfield-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 803faa908e186dd9a331d2a83876fcb7fce7743f5f32de28c23d1b5052fac7c9 |
|
MD5 | 31d5fb11f24d349bac24f0df84841e88 |
|
BLAKE2b-256 | bc81f620fe90c21bda98d10d1a9fb6b105ae92efc54518185442ef4f17235825 |
Hashes for django_better_admin_arrayfield-1.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55b4c8bed75e5c5d3959761c67c45e9b8e3f3b48d08a455a94b173d472b4bfa5 |
|
MD5 | a01d1fc60f503535b6a42cb197a6a7b7 |
|
BLAKE2b-256 | 849c5d69272e784369de960467b650b7b74bf33e0d3c80ce8d8eae50f0e0c199 |