Skip to main content

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' to INSTALLED_APPS, before 'django.contrib.admin'. Order matters for template loading!
  • Install and add 'spurl' to INSTALLED_APPS.
  • Check that 'APP_DIRS' is True in TEMPLATES 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_edit_mode-0.1.1.tar.gz (15.3 kB view hashes)

Uploaded Source

Built Distribution

django_admin_edit_mode-0.1.1-py3-none-any.whl (17.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page