[Grok-dev] ModelTraverse on the application
Wichert Akkerman
wichert at wiggy.net
Thu Aug 16 05:11:28 EDT 2007
Previously Wichert Akkerman wrote:
> I'm working on an application which does not use the ZODB but keeps all
> data in SQL. It seems that the best way to model that in grok is to use
> model classes that map the SQL data and use the standard ModelTraverse
> to go over them.
>
> Unfortunately this does not seem to work for the application. I use
> this simple test:
>
> import grok
> from saturn.status import Status
> # Status is a simple grok.Model derived class
>
> class saturn(grok.Application):
> def __init__(self):
> super(saturn, self).__init__(self)
> self.status = Status()
>
> class Index(grok.View):
> grok.context(saturn)
Seems I found my problem: grok.Application itself is not a persistent
type which makes the ZODB somewhat unhappy.
I would still love some feedback about my basic approach though.
Wichert.
--
Wichert Akkerman <wichert at wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
More information about the Grok-dev
mailing list