This document describes the current stable version of django_celery_monitor (1.1). For development docs, go here.

django_celery_monitor.managers

The model managers.

class django_celery_monitor.managers.ExtendedQuerySet(model=None, query=None, using=None, hints=None)[source]

A custom model queryset that implements a few helpful methods.

select_for_update_or_create(defaults=None, **kwargs)[source]

Extend update_or_create with select_for_update.

Look up an object with the given kwargs, updating one with defaults if it exists, otherwise create a new one. Return a tuple (object, created), where created is a boolean specifying whether an object was created.

This is a backport from Django 1.11 (https://code.djangoproject.com/ticket/26804) to support select_for_update when getting the object.

class django_celery_monitor.managers.TaskStateQuerySet(model=None, query=None, using=None, hints=None)[source]

A custom model queryset for the TaskState model with some helpers.

active()[source]

Return all active task states.

expire_by_states(states, expires)[source]

Expire task with one of the given states.

expired(states, expires)[source]

Return all expired task states.

purge()[source]

Purge all expired task states.

class django_celery_monitor.managers.WorkerStateQuerySet(model=None, query=None, using=None, hints=None)[source]

A custom model queryset for the WorkerState model with some helpers.