SQLAlchemy 0.4 Documentation - module sqlalchemy.orm.properties

# SQLAlchemy 0.4 Documentation

Multiple Pages | One Page
Version: 0.4.6 Last Updated: 05/14/08 14:36:43

### 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 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 ComparableProperty(MapperProperty)

Instruments a Python property for use in query expressions.

def __init__(self, comparator_factory, descriptor=None)

Construct a new `ComparableProperty`.

def create_row_processor(self, selectcontext, mapper, row)
def do_init(self)

Set up a proxy to the unmanaged descriptor.

def setup(self, querycontext, **kwargs)
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, _local_remote_pairs=None)

Construct a new `PropertyLoader`.

def cascade_iterator(self, type_, state, visited_instances, halt_on=None)
def compare(self, op, value, value_is_parent=False)
def do_init(self)
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, descriptor=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