InspectionMixin
The InspectionMixin
class provides attributes and properties inspection functionality for SQLAlchemy models.
Info
This mixin is intended to extend the functionality of the
SmartQueryMixin
and SerializationMixin
.
It is not intended to be used on its own.
Table of Contents
Instance Methods
repr
Print the model in a readable format including the primary key.
Format:
Example:
Class Methods
get_class_of_relation
Gets the class of a relationship by its name.
Parameters:
relation_name
: The name of the relationship.Returns:
type
: The class of the relationship.Example:
Properties
id_str
Returns primary key as string.
If there is a composite primary key, returns a hyphenated string, as follows:
'1-2-3'
.If there is no primary key, returns
'None'
.
columns
Sequence of string key names for all columns in this collection.
primary_keys_full
Gets primary key properties for a SQLAlchemy cls.
Taken from marshmallow_sqlalchemy.
primary_keys
Returns a
list
of primary key names.
relations
Returns a
list
of relationship names.
settable_relations
Returns a
list
of settable relationship names.
hybrid_properties
Returns a
list
of hybrid property names.
hybrid_methods_full
Returns a
dict
of hybrid methods.
hybrid_methods
Returns a
list
of hybrid method names.
filterable_attributes
Returns a
list
of filterable attributes.These are all columns, relations and hybrid properties.
sortable_attributes
Returns a
list
of sortable attributes.These are all columns and hybrid properties.
settable_attributes
Returns a
list
of settable attributes.These are all columns, settable relations and hybrid properties.