[storm] Using Storm with Django

James Henstridge james at jamesh.id.au
Fri Aug 1 08:23:41 BST 2008


On Fri, Aug 1, 2008 at 2:36 PM, Paul Hummer <paul.hummer at canonical.com> wrote:
>
>> 1. install the "zope.interface" and "transaction" modules (either from
>> pypi.python.org or Zope subversion should do).
>>
>> 2. In the settings file for your application, add
>> storm.django.middleware.ZopeTransactionMiddleware to
>> MIDDLEWARE_CLASSES.  This configures the Zope transaction manager to
>> run a transaction over each Django request.
>
> Ew.  What's the reasoning for using the zope stuff?  Is there a
> possibility, at some point, to remove that zope dependency?  I'm not
> really fond on adding more dependencies than needed, especially Zope
> dependencies.

Two reasons:
1. there does not appear to be any equivalent functionality in Django.
2. the code to integrate Storm with Zope's transaction manager had
already been written.

Olaf's decision to reuse the Zope's transaction module for Pylons
integration reinforced my own decision.  Besides, we are talking about
a small fraction of the total Zope 3 infrastructure.  We aren't
pulling in the component framework, ZODB or any other large pieces.

Lastly, reusing the code means that we benefit from storm.zope
improvements (e.g. to implement two phase commit you need a global
transaction manager to plug into).

>> One thing this branch does not help you do is to use some of the
>> existing Django infrastructure with Storm classes.  At a minimum I'd
>> like to get the Django admin interface working with Storm classes.
>>
> This is what I'd really like to see.  I don't think it'd be too
> terribly difficult, and if you'd like to work together on this, Storm
> integration is quite high on my Django priorities.

I'll keep publishing to my branch, and ask for help when I need it.  Thanks.

James.



More information about the storm mailing list