sqlalchemyseed.attribute
#
attribute module containing helper functions for instrumented attribute.
Module Contents#
- sqlalchemyseed.attribute.attr_is_column(instrumented_attr: sqlalchemy.orm.attributes.InstrumentedAttribute)#
Check if instrumented attribute property is a ColumnProperty
- sqlalchemyseed.attribute.attr_is_relationship(instrumented_attr: sqlalchemy.orm.attributes.InstrumentedAttribute)#
Check if instrumented attribute property is a RelationshipProperty
- sqlalchemyseed.attribute.foreign_key_column(instrumented_attr: sqlalchemy.orm.attributes.InstrumentedAttribute)#
Returns the table name of the first foreignkey.
- sqlalchemyseed.attribute.instrumented_attribute(class_or_instance, key: str)#
Returns instrumented attribute from the class or instance.
- sqlalchemyseed.attribute.referenced_class(instrumented_attr: sqlalchemy.orm.attributes.InstrumentedAttribute)#
Returns class that the attribute is referenced to.
- sqlalchemyseed.attribute.set_instance_attribute(instance, key, value)#
Set attribute value of instance