gensaschema._constraint module

Constraint inspection and representation

Constraint inspection and representation.

Copyright

Copyright 2010 - 2019 André Malo or his licensors, as applicable

License

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class gensaschema._constraint.Constraint(constraint, table, symbols, options=None)

Reflected Constraint

IVariables
constraintSA Constraint

Constraint

__cmp__(other)

Compare

__dict__ = mappingproxy({'__module__': 'gensaschema._constraint', '__doc__': '\n Reflected Constraint\n\n :IVariables:\n `constraint` : SA Constraint\n Constraint\n ', '_SYMBOL': None, '_IMPORT': None, '__new__': <staticmethod object>, '__init__': <function Constraint.__init__>, 'copy': <function Constraint.copy>, '__cmp__': <function Constraint.__cmp__>, '__lt__': <function Constraint.__lt__>, 'repr': <function Constraint.repr>, '__dict__': <attribute '__dict__' of 'Constraint' objects>, '__weakref__': <attribute '__weakref__' of 'Constraint' objects>})
__init__(constraint, table, symbols, options=None)

Initialization

Parameters
constraintSA Constraint

Constraint

tablestr

Table varname

__lt__(other, _cmp=<function Constraint.__cmp__>)

Check for ‘<’

__module__ = 'gensaschema._constraint'
static __new__(cls, constraint, table, symbols, options=None)

Constraint factory

__weakref__

list of weak references to the object (if defined)

copy()

Create shallow copy

repr(symbol, args, keywords=(), short=False)

Base repr for all constraints

Parameters
argsiterable

Positional arguments

Return

The constraint repr

Rtype

str

class gensaschema._constraint.ForeignKeyConstraint(constraint, table, symbols, options=None)

ForeignKey constraint

__module__ = 'gensaschema._constraint'
__repr__()

Make string representation

Return

The string representation

Rtype

str

class gensaschema._constraint.PrimaryKeyConstraint(constraint, table, symbols, options=None)

Primary Key constraint

__module__ = 'gensaschema._constraint'
class gensaschema._constraint.UniqueConstraint(constraint, table, symbols, options=None)

Unique constraint

__module__ = 'gensaschema._constraint'
__repr__()

Make string representation

Return

The string representation

Rtype

str

gensaschema._constraint.access_col(col)

Generate column access string (either as attribute or via dict access)

Parameters
colSA Column

Column

Return

Access string

Rtype

str