Exemple #1
0
 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")
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
 class Class(object):
     __storm_table__ = "table"
     prop1 = Property("column1", primary=True)
     prop2 = Property("column2")
Exemple #5
0
 class Class2(object):
     __storm_table__ = Class1
     id = Property(primary=True)
Exemple #6
0
 class Class1(object):
     __storm_table__ = "class1"
     id = Property(primary=True)
Exemple #7
0
 class Class(six.with_metaclass(MetaClass, object)):
     __storm_table__ = "table"
     prop1 = Property("column1", primary=True)
Exemple #8
0
 class Class(object):
     __storm_table__ = "table"
     prop = Property(primary=True,
                     variable_kwargs={"validator": validator})
Exemple #9
0
 class Class(object):
     __storm_table__ = "table"
     prop1 = Property("column1")
     prop2 = Property("column2")
Exemple #10
0
 class Class(object):
     __metaclass__ = MetaClass
     __storm_table__ = "table"
     prop1 = Property("column1", primary=True)
Exemple #11
0
 class Class(Storm):
     __storm_table__ = "table_name"
     prop = Property(primary=True)