This module provides the camelot.core.orm.entity.EntityBase declarative base class, as well as its metaclass camelot.core.orm.entity.EntityMeta. Those are the building blocks for creating the camelot.core.orm.Entity.
These classes can be reused if a custom base class is needed.
A declarative base class that adds some methods that used to be available in Elixir
Update a mapped class with data from a JSON-style nested dict/list structure.
Return the instance of this class based on the given identifier, or None if not found. This is equivalent to: session.query(MyClass).get(...)
EntityDescriptor holds information about the Entity before it is passed to Declarative. It is used to search for inverse relations defined on an Entity before the relation is passed to Declarative.
Parameters: | entity_base – The Declarative base class used to subclass the entity |
---|
Create primary_key columns. That is, call the ‘create_pk_cols’ builders then add a primary key to the table if it hasn’t already got one and needs one.
This method is “semi-recursive” in some cases: it calls the create_keys method on ManyToOne relationships and those in turn call create_pk_cols on their target. It shouldn’t be possible to have an infinite loop since a loop of primary_keys is not a valid situation.
Subclass of sqlalchmey.ext.declarative.DeclarativeMeta. This metaclass processes the Property and ClassMutator objects.