Previous topic

stalker.db.mixin

Next topic

stalker.db.mixin.StatusMixinDB

This Page

stalker.db.mixin.ReferenceMixinDB

Inheritance diagram of stalker.db.mixin.ReferenceMixinDB

class stalker.db.mixin.ReferenceMixinDB[source]

Bases: object

A helper class for ReferenceMixin table and mapper setup.

Helps setting up tables and mappers for classes mixed in with ReferenceMixin

See examples/extending/great_entity.py for an example.

__init__()

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Methods

setup(class_, class_table[, mapper_arguments]) creates the necessary tables and properties for the mappers for the
classmethod setup(class_, class_table, mapper_arguments={})[source]

creates the necessary tables and properties for the mappers for the mixed in class

use the returning dictionary (mapper_arguments) in your mapper

Parameters:
  • class – the mixed in class, in other words the class which will be extended with the mixin functionalities
  • class_table – the table holding the information about the class
  • mapper_arguments – incoming mapper arugments for the SQLAlchemy.Orm.Mapper, it will be updated with the properties of the current mixin
Returns:

a dictionary holding the mapper_arguments