[Grok-dev] Re: Grok ORM with Storm
Martijn Faassen
faassen at startifact.com
Wed Jan 23 07:44:58 EST 2008
Kevin Teague wrote:
[snip]
> I have a Grok app which provides user/group management functionality for
> an LDAP database, and I have User and Group objects that subclass from
> grok.Model but are only ever loaded with LDAP data and are never
> persisted to the ZODB, so it'd be great to see a better way of declaring
> something is a grok.Model without getting the persistence implementation
> in the base class.
Mixing in grok.Model is actually fairly safe for non-persistent objects,
as it's a very bare-bones class. I'd be more wary of mixing in
grok.Container, as it implements all kinds of methods that you'd need to
override almost completely to replace it with a non-persistent
version. Note that one should be able to use grok.Model safely enough to
implement a container too (you just need to make sure that your new
container provides the right container interfaces, the same ones as
grok.Container).
Still, I'd like there to be something like grok.ModelBase that has
absolutely nothing (not even persistence). that you can mix in that Grok
will recognize as a model.
Regards,
Martijn
More information about the Grok-dev
mailing list