[mezzanine-users] Nested inline admins

2015-05-13 Thread Tom Cook
Is it possible to nest inline admins in pace admins in mezzanine?

-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Nested inline admins

2015-05-13 Thread Tom Cook
Hi Josh,

Yes, s/pace/page/.  Typing on a phone late at night, I'm afraid.

I don't quite get what you've suggested.  Won't that give me several 
inlines one after the other?  What I mean is a model like this:

class TopLevel(Page):
pass

class SecondLevel(Orderable):
parent = ForeignKey('TopLevel')

class ThirdLevel(Orderable):
parent = ForeignKey('SecondLevel')

and an admin like this:

class ThirdLevelInline(TabularDynamicInlineAdmin):
model = ThirdLevel

class SecondLevelInline(StackedDynamicInlineAdmin):
model = SecondLevel
inlines = (ThirdLevelInline,)

class TopLevelAdmin(PageAdmin):
inlines = (SecondLevelInline,)

admin.site.register(TopLevel, TopLevelAdmin)

Is it possible?


On Thursday, 14 May 2015 00:35:52 UTC+9:30, Josh Cartmell wrote:

 Hi Tom, I'm guessing you meant page.  The answer is yes.

 Do something like this in your admin.py:

 from mezzanine.pages.admin import PageAdmin

 from .models import MyPageModel

 ...set up some inlines here...

 class MyPageModelAdmin(PageAdmin):
 inlines = ['whatever', 'inlines', 'you', 'want']
 admin.site.register(MyPageModel, MyPageModelAdmin)

 Good luck!

 On Wed, May 13, 2015 at 9:47 AM, Tom Cook tom.k...@gmail.com 
 javascript: wrote:

 Is it possible to nest inline admins in pace admins in mezzanine?

 --
 You received this message because you are subscribed to the Google Groups 
 Mezzanine Users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to mezzanine-use...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.