Basic Use
This section has moved to Declarative Mapping.
Defining Attributes
This section is covered by Mapping Table Columns
Accessing the MetaData
This section has moved to Accessing Table and Metadata.
Class Constructor
As a convenience feature, the declarative_base()
sets a default constructor on classes which takes keyword arguments, and assigns them to the named attributes:
e = Engineer(primary_language='python')
Mapper Configuration
This section is moved to Mapper Configuration Options with Declarative.
Defining SQL Expressions
See SQL Expressions as Mapped Attributes for examples on declaratively mapping attributes to SQL expressions.
当前内容版权归 SQLAlchemy 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 SQLAlchemy .