2

I'm using Django Mezzanine to create a site. I've added some custom content types that I'd like to be able to add using the Pages admin tree. Here's the gist of what I'm doing:

class top_level_nav1(Page): #should only be a top level parent
    stuff
class second_level_nav1(Page): #should only be nested under top_level_nav1
    stuff 
class top_level_nav2(Page): #should only be a top level parent
    stuff
class second_level_nav2(Page): #should only be nested under top_level_nav2
    stuff

Is there any way to enforce these rules in the Admin Tree "Add" list (ie the Add dropdown for top_level_nav1 wouldn't contain any top_level_navs or second_level_navs that shouldn't go under it)?

The number of choices in the "Add" list is growing rather long, and I'd rather not have my users need to remember the structure on their own.

Also, please tell me if there's a better way to go about accomplishing what I've shown.

Thanks!

Danack
  • 24,939
  • 16
  • 90
  • 122
D_Naish
  • 543
  • 4
  • 20

1 Answers1

2

Only way to do this would be to override the admin menu template and build your own template tags that perform the checks.

Steve
  • 1,726
  • 10
  • 16