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