class Class(object): __storm_table__ = "table" __storm_primary__ = "prop2", "prop1" # Define primary=True to ensure that the attribute # has precedence. prop1 = Property("column1", primary=True) prop2 = Property("column2")
def __init__(self, name=None, primary=False, type=None, **kwargs): if type is None: type = Property() kwargs["value"] = kwargs.pop("default", Undef) kwargs["value_factory"] = kwargs.pop("default_factory", Undef) Property.__init__(self, name, primary, self.variable_class, kwargs)
class Class(object): __storm_table__ = "table" prop1 = Property("column1", primary=True) prop2 = Property("column2")
class Class2(object): __storm_table__ = Class1 id = Property(primary=True)
class Class1(object): __storm_table__ = "class1" id = Property(primary=True)
class Class(six.with_metaclass(MetaClass, object)): __storm_table__ = "table" prop1 = Property("column1", primary=True)
class Class(object): __storm_table__ = "table" prop = Property(primary=True, variable_kwargs={"validator": validator})
class Class(object): __storm_table__ = "table" prop1 = Property("column1") prop2 = Property("column2")
class Class(object): __metaclass__ = MetaClass __storm_table__ = "table" prop1 = Property("column1", primary=True)
class Class(Storm): __storm_table__ = "table_name" prop = Property(primary=True)