[Grok-dev] Folders for nested pages in Grok
sebastian at urbantalk.se
Tue Jan 5 05:40:45 EST 2010
I would create objects based on grok.Container and create management
views on that. (The simple approach)
Or I would have a simple grok.Model based object with a grok.Container
attribute. (The more complex approach)
In the latter case I might even use adapters to separate the logic of
adding the containment support at runtime and providing CRUD (i.e. I
would end up with a model and two adapters with context being one of
two marker interfaces ICanBeMadeIntoAContainer, IAmAContainer)
if not hasattr(self.context, 'content'):
self.context.content = grok.Container()
# and probably add some marker interface
5 jan 2010 kl. 07.45 skrev Dan Jacka:
> Hi people,
> What are my choices for simple nested pages in a Grok site?
> For example, I have a Page model and want my logged-in users to be
> to create/edit/delete Page objects in the UI so that they can easily
> create paths like:
> ... all of which are URLs to Pages.
> Coming from Plone, my inclination is to have a Folder model. I'll be
> able to set which of its contained Pages appears as the default
> page. So
> in the example above, 'about' is a Folder with a page (called 'index'
> maybe?) set as the default.
> What's the Grok way? Do I subclass grok.Container and create all the
> views and functionality myself, or should I (can I?) start from
> zope.app.folder? Can I do the latter without my users having to see
> Or should I be putting my Plone-centric Folder thinking to one side?
> Pointers in the right direction much appreciated. I'm using Grok 1.0.
> Grok-dev mailing list
> Grok-dev at zope.org
More information about the Grok-dev