Skip to content

inueni/django-subadmin-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-subadmin-example

Sample application to demonstrate django-subadmin usage.

Installation

Checkout code from GitHub

   git clone https://github.com/inueni/django-subadmin-example.git 

Switch to django-subadmin-example directory and run the following commands (you should do this in virtualenv).

pip install -r requirements.txt

python manage.py migrate
python manage.py createsuperuser
python manage.py fakedata
python manage.py runserver

Then open django admin (http://127.0.0.1:8000/admin/) in your browser, log-in and explore MailingList section to see django-subadmin in action.

Screenshots

alt text

SubAdmin instances are accesible from edit view of the ModelAdmin instance they are nested in. In the screenshot above you can see links to Subscribers and Messages subadmins (marked with red rectangle) for MailingList instance Mailing list 5.


alt text

SubAdmin looks and behaves just like a regular ModelAdmin, but looking at breadcrumbs (marked with red rectangle), you can see it is nested within another ModelAdmin. Displayed Subscribers are limited to those related to MailingList instance Mailing list 5.


alt text

When adding or editing objects with SubAdmin, ForeignKey fields to parent instances are removed from the form and automatically set when saving. In this example mailing_list field is removed and value is set to parent MailingList instance Mailing list 5.

About

An example Django app showcasing how to use django-subadmin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages