コード例 #1
0
    def __init__(self, prop, cls, name, primary, variable_class,
                 variable_kwargs):
        Column.__init__(
            self, name, cls, primary,
            VariableFactory(variable_class, column=self, **variable_kwargs))

        self.cls = cls  # Used by references

        # Copy attributes from the property to avoid one additional
        # function call on each access.
        for attr in ["__get__", "__set__", "__delete__"]:
            setattr(self, attr, getattr(prop, attr))
コード例 #2
0
    def __init__(self, prop, cls, name, primary,
                 variable_class, variable_kwargs):
        Column.__init__(self, name, cls, primary,
                        VariableFactory(variable_class, column=self,
                                        **variable_kwargs))

        self.cls = cls # Used by references

        # Copy attributes from the property to avoid one additional
        # function call on each access.
        for attr in ["__get__", "__set__", "__delete__"]:
            setattr(self, attr, getattr(prop, attr))
コード例 #3
0
ファイル: properties.py プロジェクト: DamnWidget/mamba-storm
    def __init__(self, prop, cls, attr, name, primary,
                 variable_class, variable_kwargs):
        self.size = variable_kwargs.pop('size', Undef)
        self.unsigned = variable_kwargs.pop('unsigned', False)
        self.index = variable_kwargs.pop('index', False)
        self.unique = variable_kwargs.pop('unique', False)
        self.auto_increment = variable_kwargs.pop('auto_increment', False)
        self.array = variable_kwargs.pop('array', None)

        Column.__init__(self, name, cls, primary,
                        VariableFactory(variable_class, column=self,
                                        validator_attribute=attr,
                                        **variable_kwargs))

        self.cls = cls  # Used by references

        # Copy attributes from the property to avoid one additional
        # function call on each access.
        for attr in ["__get__", "__set__", "__delete__", '_creation_order']:
            setattr(self, attr, getattr(prop, attr))
コード例 #4
0
ファイル: database.py プロジェクト: aroshni/mamba
    def __init__(self, prop, cls, attr, name, primary, variable_class,
                 variable_kwargs):
        # here we go!
        self.size = variable_kwargs.pop('size', Undef)
        self.unsigned = variable_kwargs.pop('unsigned', False)
        self.auto_increment = variable_kwargs.pop('auto_increment', False)
        self.array = variable_kwargs.pop('array', None)

        Column.__init__(
            self, name, cls, primary,
            properties.VariableFactory(variable_class,
                                       column=self,
                                       validator_attribute=attr,
                                       **variable_kwargs))

        self.cls = cls  # Used by references

        # Copy attributes from the property to avoid one additional
        # function call on each access.
        for attr in ["__get__", "__set__", "__delete__"]:
            setattr(self, attr, getattr(prop, attr))