RelationshipProperty
is a class within the sqlalchemy.orm
module of the SQLAlchemy project.
ColumnProperty,
CompositeProperty,
Load,
Mapper,
Query,
Session,
SynonymProperty,
aliased,
attributes,
backref,
class_mapper,
column_property,
composite,
interfaces,
mapper,
mapperlib,
object_mapper,
object_session,
query,
relationship,
session,
sessionmaker,
and strategies
are several other callables with code examples from the same sqlalchemy.orm
package.
SQLAlchemy Mixins (PyPI package information) is a collection of mixins useful for extending SQLAlchemy and simplifying your database-interacting code for some common use cases. SQLAlchemy Mixins is open sourced under the MIT license.
SQLAlchemy Mixins / sqlalchemy_mixins / inspection.py
# inspection.py
from sqlalchemy import inspect
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method
from sqlalchemy.orm import RelationshipProperty
from .utils import classproperty
Base = declarative_base()
class InspectionMixin(Base):
__abstract__ = True
@classproperty
def columns(cls):
return inspect(cls).columns.keys()
@classproperty
def primary_keys_full(cls):
mapper = cls.__mapper__
return [
mapper.get_property_by_column(column)
for column in mapper.primary_key
]
@classproperty
def primary_keys(cls):
## ... source file continues with no further RelationshipProperty examples...