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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dfa938c727d3bee3c0f0a943d713a3921fd5eb22667c4efffc6c66e3ca8cd76 |
|
MD5 | f026ceda190aacf1407289065e312b2f |
|
BLAKE2b-256 | c549447dcd622ee8757232ad60f5148e0eaddfd953342360153e934a9ca773a5 |
Hashes for django_admin_edit_mode-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e66bd35f7eb02d6b8e76c415c56091198ba07363c41be9db620dc272766293a7 |
|
MD5 | adc9b151b98896f2fbff10cd228bd420 |
|
BLAKE2b-256 | 8f692363df5b499a662752a85ad40f3c476363ddf2c854549e3c3e5c138de7f6 |