

configure ( cascade = False ) ¶Ĭonfigure all as-yet unconfigured mappers in this Registry.as_declarative_base() are passedĪlong to registry.generate_base(). lower () id = Column ( Integer, primary_key = True ) class MyMappedClass ( Base ): #. as_declarative_base () class Base ( object ): def _tablename_ ( cls ): return cls. as_declarative_base ( ** kw ) ¶įrom sqlalchemy.orm import registry mapper_registry = registry (). To share the same registry of class names for simplified Allows two or more declarative base classes Registry of class names-> mapped classes when string namesĪre used to identify classes inside of relationship()Īnd others. No _init_ will be provided and construction will fall back toĬls._init_ by way of the normal Python semantics.Ĭlass_registry ¶ – optional dictionary that will serve as the Implementation that assigns **kwargs for declaredįields and relationships to an instance. If this argument is left at its default of None,Ĭonstructor ¶ – Specify the implementation for the _init_ function on a mappedĬlass that has no _init_ of its own. Table mapping will make use of this MetaDataĬollection. Table objects generated using declarative Metadata ¶ – An optional MetaData instance. _init_ ( metadata=None, class_registry=None, constructor=, _bind=None ) ¶ ORM Mapped Class Overview - overview of class mapping This method suits the use case historically Mapper for a class without scanning the class forĭeclarative class attributes. Registry.map_imperatively() will produce a Registry.mapped() provides a class decorator that willĪpply declarative mapping to a class without the use of a declarative Registry.generate_base() returns a new declarative baseĬlass, and is the underlying implementation of the The three general kinds of mappings supported are Declarative Base,ĭeclarative Decorator, and Imperative Mapping. Of mappings, and provides configurational hooks used to map classes.


The registry serves as the basis for maintaining a collection registry ( metadata=None, class_registry=None, constructor=, _bind=None ) ¶ Generalized registry for mapping classes.Īttribute in conjunction with a Python descriptor.Ĭlass sqlalchemy.orm. Polymorphic_union(table_map, typecolname)Ĭreate a UNION statement used by a polymorphic mapper.ĭecorate a method as the ‘reconstructor’ hook. Given an object, return the primary Mapper associated with the object Other relational structure, so that ORM operations against the class may Mapper(class_)ĭirect constructor for a new Mapper object.ĭefines an association between a Python class and a database table or Generate “identity key” tuples, as are used as keys in the Given a class, return True if any of the classes it inherits from has a Mark a class-level method as representing the definition ofĪ mapped property or special declarative member name. Mark a class as providing the feature of “declarative mixin”. Have been constructed thus far across all registryĭeclarative_base()Ĭonstruct a base class for declarative class definitions. Initialize the inter-mapper relationships of all mappers that Given a class, return the primary Mapper associated Class decorator which will adapt a given class into a
