Skip to content

Database

queryset

post_update = Signal() module-attribute

Signal sent after CustomQuerySet.update() completes.

Provides sender (the model class), the update kwargs, and objs (list of objects that were updated, fetched before the update).

post_bulk_create = Signal() module-attribute

Signal sent after CustomManager.bulk_create() completes.

Provides sender (the model class), objs (created objects), and batch_size.

CustomQuerySet

Bases: QuerySet

QuerySet subclass that sends a post_update signal after .update() calls.

CustomManager

Bases: Manager

Manager that uses CustomQuerySet and sends post_bulk_create after bulk creates.

query

execute(query)

Execute a raw SQL statement (e.g. DDL or DML) with no return value.

Parameters:

Name Type Description Default
query

Raw SQL string to execute.

required