kotti.sqla

Inheritance Diagram

Inheritance diagram of kotti.sqla

class kotti.sqla.JsonType(*args, **kwargs)[source]

http://www.sqlalchemy.org/docs/core/types.html#marshal-json-strings

impl

alias of sqlalchemy.sql.sqltypes.Text

class kotti.sqla.ACLType(*args, **kwargs)[source]
process_bind_param(value, dialect)[source]

Receive a bound parameter value to be converted.

Subclasses override this method to return the value that should be passed along to the underlying TypeEngine object, and from there to the DBAPI execute() method.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

This operation should be designed with the reverse operation in mind, which would be the process_result_value method of this class.

Parameters:
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.
  • dialect – the Dialect in use.
process_result_value(value, dialect)[source]

Receive a result-row column value to be converted.

Subclasses should implement this method to operate on data fetched from the database.

Subclasses override this method to return the value that should be passed back to the application, given a value that is already processed by the underlying TypeEngine object, originally from the DBAPI cursor method fetchone() or similar.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

Parameters:
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.
  • dialect – the Dialect in use.

This operation should be designed to be reversible by the “process_bind_param” method of this class.

class kotti.sqla.MutationDict(data)[source]

http://www.sqlalchemy.org/docs/orm/extensions/mutable.html

classmethod coerce(key, value)[source]

Given a value, coerce it into the target type.

Can be overridden by custom subclasses to coerce incoming data into a particular type.

By default, raises ValueError.

This method is called in different scenarios depending on if the parent class is of type Mutable or of type MutableComposite. In the case of the former, it is called for both attribute-set operations as well as during ORM loading operations. For the latter, it is only called during attribute-set operations; the mechanics of the composite() construct handle coercion during load operations.

Parameters:
  • key – string name of the ORM-mapped attribute being set.
  • value – the incoming value.
Returns:

the method should return the coerced value, or raise ValueError if the coercion cannot be completed.

class kotti.sqla.MutationList(data)[source]
classmethod coerce(key, value)[source]

Given a value, coerce it into the target type.

Can be overridden by custom subclasses to coerce incoming data into a particular type.

By default, raises ValueError.

This method is called in different scenarios depending on if the parent class is of type Mutable or of type MutableComposite. In the case of the former, it is called for both attribute-set operations as well as during ORM loading operations. For the latter, it is only called during attribute-set operations; the mechanics of the composite() construct handle coercion during load operations.

Parameters:
  • key – string name of the ORM-mapped attribute being set.
  • value – the incoming value.
Returns:

the method should return the coerced value, or raise ValueError if the coercion cannot be completed.

class kotti.sqla.NestedMutationDict(*args, **kwargs)[source]
class kotti.sqla.NestedMutationList(*args, **kwargs)[source]
kotti.sqla.wrapper_class

alias of kotti.sqla.MutationList