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.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
Close
Hashes for django-better-admin-arrayfield-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b040a42078a91c9677378248ef0aac53cf206dccdbe28b4facc77c2096c65504 |
|
MD5 | d959c39ff5be80e83c89fb5fdb50a6c6 |
|
BLAKE2b-256 | bea04e3a476b7621e3332c6a57aac70835f6878565df73e9689705e94c6b02ea |
Close
Hashes for django_better_admin_arrayfield-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b096efeb68e43dda924654cb46c095c17af5773e9e113a6ffdde5aea40c5206 |
|
MD5 | b446eb4a7d24561c7effb110b85eb1ca |
|
BLAKE2b-256 | e521bf567bfcad38ce1321703e4bc3755816949ce3ad45a14ab97cd49eae0fdc |