Skip to content

Easy way to order and rename models in the django admin page.

License

Notifications You must be signed in to change notification settings

NatanSlvdr/django-admin-reorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

django-admin-reorder

Easy way to order and rename models in the django admin page.

Features

  • Ordering Models inside Categories (ex: model truck before model car)
  • Ordering Categories (ex: app vehicules before app orders)
  • Changing the Model Label (ex: renaming the CarPartType model to Types of Car parts )

Installation

(not published yet)

Install with pip

  pip install django-admin-reorder

Then in settings.py

INSTALLED_APPS = (
    ...
    'admin-reorder',
    ...
)

Documentation

Renaming a model :

@admin.register(MyExampleModel)
class MyExampleModelAdmin(admin.ModelAdmin):
    reorder_label = "Changed the model name"

    list_display = ('one', 'two')

Ordering a model in a category :

@admin.register(MyExampleModel)
class MyExampleModelAdmin(admin.ModelAdmin):
    reorder_label = "Changed the model name"
    reorder_priority = 10

    list_display = ('one', 'two')

Supported Versions

Works on Django:

  • 5.0
  • 4.2

These are the only versions i tested, might work on more.

Roadmap

  • Support listing a model more than once

Origin

When searching alternatives to django-modeladmin-reorder, i found this thread that gave me the idea of changing model names and order just by adding the data to the modeladmin.

FAQ

How does it work

The admin.AdminSite.get_app_list method is replaced for custom behaviour.

About

Easy way to order and rename models in the django admin page.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published