Exceptions

exception tortoise.exceptions.BaseORMException[source]

Bases: Exception

Base ORM Exception.

exception tortoise.exceptions.ConfigurationError[source]

Bases: BaseORMException

The ConfigurationError exception is raised when the configuration of the ORM is invalid.

exception tortoise.exceptions.DBConnectionError[source]

Bases: BaseORMException, ConnectionError

The DBConnectionError is raised when problems with connecting to db occurs

exception tortoise.exceptions.DoesNotExist(model, *args)[source]

Bases: NotExistOrMultiple

The DoesNotExist exception is raised when expecting data, such as a .get() operation.

TEMPLATE = 'Object "{}" does not exist'
exception tortoise.exceptions.FieldError[source]

Bases: BaseORMException

The FieldError exception is raised when there is a problem with a model field.

exception tortoise.exceptions.IncompleteInstanceError[source]

Bases: OperationalError

The IncompleteInstanceError exception is raised when a partial model is attempted to be persisted.

exception tortoise.exceptions.IntegrityError[source]

Bases: OperationalError

The IntegrityError exception is raised when there is an integrity error.

exception tortoise.exceptions.MultipleObjectsReturned(model, *args)[source]

Bases: NotExistOrMultiple

The MultipleObjectsReturned exception is raised when doing a .get() operation, and more than one object is returned.

TEMPLATE = 'Multiple objects returned for "{}", expected exactly one'
exception tortoise.exceptions.NoValuesFetched[source]

Bases: OperationalError

The NoValuesFetched exception is raised when the related model was never fetched.

exception tortoise.exceptions.NotExistOrMultiple(model, *args)[source]

Bases: OperationalError

TEMPLATE = ''
exception tortoise.exceptions.ObjectDoesNotExistError(model, pk_name, pk_val)[source]

Bases: OperationalError, KeyError

The DoesNotExist exception is raised when an item with the passed primary key does not exist

exception tortoise.exceptions.OperationalError[source]

Bases: BaseORMException

The OperationalError exception is raised when an operational error occurs.

exception tortoise.exceptions.ParamsError[source]

Bases: BaseORMException

The ParamsError is raised when function can not be run with given parameters

exception tortoise.exceptions.TransactionManagementError[source]

Bases: BaseORMException

The TransactionManagementError is raised when any transaction error occurs.

exception tortoise.exceptions.UnSupportedError[source]

Bases: BaseORMException

The UnSupportedError is raised when operation is not supported.

exception tortoise.exceptions.ValidationError[source]

Bases: BaseORMException

The ValidationError is raised when validators of field validate failed.