[Grok-dev] Grok ORM with Storm

Christian Klinger cklinger at novareto.de
Tue Jan 22 11:36:51 EST 2008


Hi Grokkers,

the last weeks a played a bit with "grok storm orm".

I have written a stormcontainer [1], which is heavily based on
the zachlemy container. In think the stormcontainer is in a
relativ good state.

On the new grok website i have written an howto [2], which shows
you the basic usage of my approach. (Sorry for the bad english!)
After discussing this on irc there are some
suggestions for inproving things.


1. SMASH ZCML
--------------

In the package zope.storm it´s necesarry to define a store in zcml.
I think we can SMASH this zcml-slug.

   <store name="contact" uri="sqlite:/tmp/contact.db"/>


2. Make the grok config in our grok.Model easier:
-------------------------------------------------

This is the example Model of the Howto [2]:

   class Contact(grok.Model, Storm):
       grok.implements(IContact)
       __storm_table__ = "Contacts"

       id = Int(primary=True)
       name = Unicode()
       city = Unicode()

Maybe we can do something like megrok.storm.StormTable('Contacts') 
instead of __storm_table__ = Contacts.

3. The container config:
------------------------

This is the config of the Container in the Howto [2]:

   class contacts(StormContainer, grok.Application, grok.Container):
       """ this application inherits from StormContainer too """
       def __init__(self):
           super(contacts, self).__init__()
           self.setClassName('contacts.contact.Contact')
           self.setStoreUtilityName('contact')

Maybe it´s possible to say megrok.storm.setClassName('xxx') and 
megrok.storm.setStoreUtiltiyName('xxx')

So i think i have to work on megrok.storm package which includes
these simplifications.

Please give me some feedback.

Thanks in advance
Christian


[1]http://stormcontainer.googlecode.com/svn/trunk/src/stormcontainer/
[2]http://plone.grok.quintagroup.com/documentation/how-to/grok-orm-with-storm



More information about the Grok-dev mailing list