Code Monkey home page Code Monkey logo

django-read-only-admin's Introduction

A django-read-only-admin documentation

django-read-only-admin is a django reusable application that fully implement read only admin
  • Obtain your copy of source code from the git repository: git clone https://github.com/vint21h/django-read-only-admin.git. Or download the latest release from https://github.com/vint21h/django-read-only-admin/tags/.
  • Run python ./setup.py install from the repository source tree or the unpacked archive. Or use pip: pip install django-read-only-admin.

Add "read_only_admin" to settings.INSTALLED_APPS.

INSTALLED_APPS += (
    "read_only_admin",
)

Run ./manage.py migrate for django modern versions (>= 1.7) or ./manage.py syncdb for legacy django versions (< 1.7). Then add user/group change/delete/add/readonly model permissions.

Just inherit your custom django admin class from read_only_admin.admin.ReadonlyAdmin.

For example:

from read_only_admin.admin import ReadonlyAdmin

class MyCustomAdmin(ReadonlyAdmin):

    pass

Also tabular and stacked inlines are supported.

For example:

from read_only_admin.admin import (
    ReadonlyStackedInline,
    ReadonlyTabularInline,
)

class MyCustomTabularInline(ReadonlyTabularInline):

    model = MyModel
    extra = 0


class MyCustomStackedInline(ReadonlyStackedInline):

    model = MyModel
    extra = 0

If you use list_editable in your custom admin classes, copy read_only_admin/templates/admin/pagination.html to your project templates/admin directory.

READONLY_ADMIN_PERMISSION_PREFIX
Read only permission prefix. Defaults to: readonly.
READONLY_ADMIN_PERMISSION_NAME_PREFIX
Read only permission name prefix. Defaults to: Read only.
READONLY_ADMIN_EMPTY_ACTIONS
Empty admin actions list or just remove delete selected action. Defaults to: True.

django-read-only-admin uses the MIT license. Please check the MIT-LICENSE file for more details.

Some part of code fairly stolen from teh internets with reference to source. So, if you author of this code, please contact me.

Project Website: https://github.com/vint21h/django-read-only-admin/

Author: Alexei Andrushievich <[email protected]>

For other authors list see AUTHORS file.

django-read-only-admin's People

Contributors

vint21h avatar

Watchers

James Cloos avatar Ángel Galicia avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.