Provides a possibility to open objects in django-admin in read-only mode by default, with a special button "Go to edit mode" to open the same change-object page in regular editable mode.
Project description
djang-admin-edit-mode
The intention of this library is provide a possibility to open objects in django-admin in read-only mode by default, with a special button "Go to edit mode" to open the same change-object page in regular editable mode.
Why read-only mode in the beginning is needed ? For some applications, django-admin serves mostly for reading the info. Readonly mode looks better, doesn't allow to make some changes accidentially, and the page loads quicker (no need to load a list of choices for the fields).
But despite this, sometimes you want to change the object. Then you can go to edit mode!
Installation
pip install -e git+https://github.com/mihasK/djang-admin-edit-mode.git#egg=django_admin_edit_mode
- Add
'django_admin_edit_mode'
toINSTALLED_APPS
, before'django.contrib.admin'
. Order matters for template loading! - Install and add
'spurl'
toINSTALLED_APPS
. - Check that
'APP_DIRS'
isTrue
inTEMPLATES
settings.
Usage
Use the mixins for the model admins you want to have "readonly by default and edit by clicking button" mode:
import django_admin_edit_mode.admin
@admin.register(models.Respondent)
class RespondentAdmin(django_admin_edit_mode.admin.EditModeAdminMixin,
admin.ModelAdmin):
...
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_admin_edit_mode-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e3ca4d5ed81ec5010e51018c2d8efc7d6d50cc3bd3058560adab22851c369cd |
|
MD5 | e6c8bfb161171493e8b2e0621e304694 |
|
BLAKE2b-256 | 93a84213a0e35d1251885626904e454791c6ccf85c5f751b8607c15d0cfb765b |
Hashes for django_admin_edit_mode-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c9f159fea570dcc8a0f9593d8b65e03a3dd3e1848ff8b55393bec39c825e6e5 |
|
MD5 | d8c4c2afd2fb58b121f52f3ef598da29 |
|
BLAKE2b-256 | a9ff5bfeeb38a64d8063d48576359c69846f25b2fad7ea8da78332b30c731e0a |