[storm] Overriding database column for Storm subclass property?

Justin Warren daedalus at eigenmagic.com
Mon Jul 7 06:33:42 BST 2008


Hi folks,

I'm new to Storm, by way of Twisted, and so far I like what I see! I
look forward to playing more with DeferredStore sometime soon.

My question: When defining a Storm subclass, is it possible to define
the database column to use for the Property, rather than having it
automagically use the name of the class attribute? Something like the
following syntax (which doesn't work):

class Person(Storm):
    """
    My Person class, linked to an existing database schema
    """
    id = Int()
    name = Unicode()
    # I want to use Person.surname, not Person.person_lastname
    surname = Unicode(column='person_lastname') 

Is there something like this available?

-- 
Justin Warren <daedalus at eigenmagic.com>




More information about the storm mailing list