Coder Social home page Coder Social logo

georgski / django-modeladmin-reorder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mishbahr/django-modeladmin-reorder

0.0 1.0 0.0 32 KB

Custom ordering for the apps and models in the admin app.

Home Page: https://pypi.python.org/pypi/django-modeladmin-reorder/

License: BSD 3-Clause "New" or "Revised" License

Makefile 12.45% Python 81.19% HTML 6.36%

django-modeladmin-reorder's Introduction

django-modeladmin-reorder

image

Latest Version

Downloads

License

Custom ordering for the apps and models in the admin app. You can also rename, cross link or exclude models from the app list.

Features

  • Reorder apps in admin index - this will allow you to position most used apps in top of the page, instead of listing apps alphabetically. e.g. sites app before the auth app
  • Rename app labels easily for third party apps without having to modify the source code. e.g. rename auth app to Authorisation for the django admin app.
  • Split large apps into smaller groups of models.
  • Reorder models within an app. e.g. auth.User model before the auth.Group model.
  • Exclude any of the models from the app list. e.g. Exclude auth.Group from the app list. Please note this only excludes the model from the app list and it doesn't protect it from access via url.
  • Cross link models from multiple apps. e.g. Add sites.Site model to the auth app.
  • Rename individual models in the app list. e.g. rename auth.User from User to Staff

Documentation

The full documentation is at https://django-modeladmin-reorder.readthedocs.org.

Install

Install django-modeladmin-reorder:

pip install django-modeladmin-reorder

Configuration

  1. Add admin_reorder to `INSTALLED_APPS`:

    INSTALLED_APPS = (
        ...
        'admin_reorder',
        ...
    )
  2. Add the ModelAdminReorder to `MIDDLEWARE_CLASSES`:

    MIDDLEWARE_CLASSES = (
        ...
        'admin_reorder.middleware.ModelAdminReorder',
        ...
    )
  3. Add the setting ADMIN_REORDER to your settings.py:

    ADMIN_REORDER = (
        # Keep original label and models
        'sites',
    
        # Rename app
        {'app': 'auth', 'label': 'Authorisation'},
    
        # Reorder app models
        {'app': 'auth', 'models': ('auth.User', 'auth.Group')},
    
        # Exclude models
        {'app': 'auth', 'models': ('auth.User', )},
    
        # Cross-linked models
        {'app': 'auth', 'models': ('auth.User', 'sites.Site')},
    
        # models with custom name
        {'app': 'auth', 'models': (
            'auth.Group',
            {'model': 'auth.User', 'label': 'Staff'},
        )},
    )

django-modeladmin-reorder's People

Contributors

dvarrazzo avatar georgski avatar hasb4k avatar mishbahr avatar zhangkaizhao avatar

Watchers

 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.