SQLAlchemy 0.4 Documentation

Multiple Pages | One Page
Version: 0.4.2 Last Updated: 01/01/08 20:56:05

module sqlalchemy.orm.properties

MapperProperty implementations.

This is a private module which defines the behavior of invidual ORM-mapped attributes.

class BackRef(object)

Attached to a PropertyLoader to indicate a complementary reverse relationship.

Can optionally create the complementing PropertyLoader if one does not exist already.

def __init__(self, key, _prop=None, **kwargs)

Construct a new BackRef.

def compile(self, prop)
def get_extension(self)

Return an attribute extension to use with this backreference.

back to section top

class ColumnProperty(StrategizedProperty)

Describes an object attribute that corresponds to a table column.

def __init__(self, *columns, **kwargs)

The list of columns describes a single object property. If there are multiple tables joined together for the mapper, this list represents the equivalent column as it appears across each table.

def copy(self)
def create_strategy(self)
def do_init(self)
def get_col_value(self, column, value)
def getattr(self, state, column)
def getcommitted(self, state, column)
def merge(self, session, source, dest, dont_load, _recursive)
def setattr(self, state, value, column)
back to section top

class CompositeProperty(ColumnProperty)

subclasses ColumnProperty to provide composite type support.

def __init__(self, class_, *columns, **kwargs)

Construct a new CompositeProperty.

def copy(self)
def do_init(self)
def get_col_value(self, column, value)
def getattr(self, state, column)
def getcommitted(self, state, column)
def setattr(self, state, value, column)
back to section top

class PropertyLoader(StrategizedProperty)

Describes an object property that holds a single item or list of items that correspond to a related database table.

def __init__(self, argument, secondary=None, primaryjoin=None, secondaryjoin=None, entity_name=None, foreign_keys=None, foreignkey=None, uselist=None, private=False, association=None, order_by=False, attributeext=None, backref=None, is_backref=False, post_update=False, cascade=None, viewonly=False, lazy=True, collection_class=None, passive_deletes=False, passive_updates=True, remote_side=None, enable_typechecks=True, join_depth=None, strategy_class=None)

Construct a new PropertyLoader.

def cascade_iterator(self, type, state, recursive, halt_on=None)
def compare(self, op, value, value_is_parent=False)
def create_strategy(self)
def do_init(self)
def get_join(self, parent, primary=True, secondary=True, polymorphic_parent=True)

return a join condition from the given parent mapper to this PropertyLoader's mapper.

The resulting ClauseElement object is cached and should not be modified directly.

parent
a mapper which has a relation() to this PropertyLoader. A PropertyLoader can have multiple "parents" when its actual parent mapper has inheriting mappers.
primary
include the primary join condition in the resulting join.
secondary
include the secondary join condition in the resulting join. If both primary and secondary are returned, they are joined via AND.
polymorphic_parent
if True, use the parent's 'select_table' instead of its 'mapped_table' to produce the join.
def merge(self, session, source, dest, dont_load, _recursive)
private = property()
def register_dependencies(self, uowcommit)
back to section top

class SynonymProperty(MapperProperty)

def __init__(self, name, map_column=None)

Construct a new SynonymProperty.

def create_row_processor(self, selectcontext, mapper, row)
def do_init(self)
def merge(self, session, source, dest, _recursive)
def setup(self, querycontext, **kwargs)
back to section top
Up: API Documentation | Previous: module sqlalchemy.orm.mapper | Next: module sqlalchemy.orm.query