BLOG

A LITTLE STORY ABOUT MY JOURNEY
Screen Shot 2015-09-05 at 17.24.26

Weekend exercise with django-mptt

Welcome to Django Mptt Demo

Welcome to Django mptt demo module. This demo explains how to create tree level category and demonstrate mtpp library

Repo : https://bitbucket.org/cyberkishor/django-mptt-demo/wiki/Home

Screen Shot 2015-09-05 at 17.24.01 category-list-admin

Django Mtpp demo features

  • Create Tree level category
  • Display tree level category list in admin panel
  • Display category as tree in another db relation like forenkeyTree (example used in product model)

This demo demonstrate use of django-mptt model.

Have a try here:

Requirements

  • django-mptt

Here’s an example of some Python code:

Now Copy and Paste inside admin.py

Now inside view.py

And now you need to setup template for display hierarchy inside the template:

 

For more detail : http://django-mptt.github.io/django-mptt/

Have fun!

4107 Total Views 18 Views Today