Skip to main content
[django-celery-model](https://github.com/mback2k/django-celery-model) is an
extension to [Celery](https://github.com/celery/celery) and depending on the
Celery version [django-celery](https://github.com/celery/django-celery)
which adds support for tracking Celery tasks assigned to Django model instances.

Installation
------------
Install the latest version from pypi.python.org:

pip install django-celery-model

Install the development version by cloning the source from github.com:

pip install git+https://github.com/mback2k/django-celery-model.git

Configuration
-------------
Add the package to your `INSTALLED_APPS`:

INSTALLED_APPS += (
'djcelery',
'djcelery_model',
)

Example
-------
Add the TaskMixin to your Django model:

from django.db import models
from django.utils.translation import ugettext_lazy as _
from djcelery_model.models import TaskMixin

class MyModel(TaskMixin, models.Model):
name = models.CharField(_('Name'), max_length=100)

Queue an asynchronous task from your Django model instance:

from .models import MyModel
from .tasks import mytask

mymodel = MyModel.objects.get(name='test instance')
mymodel.apply_async(mytask, ...)

Retrieve list of asynchronous tasks assigned to your Django model instance:

mymodel.tasks.all()
mymodel.tasks.pending()
mymodel.tasks.started()
mymodel.tasks.retrying()
mymodel.tasks.failed()
mymodel.tasks.successful()
mymodel.tasks.running()
mymodel.tasks.ready()

Check for a running or ready asynchronous task for your Django model instance:

mymodel.has_running_task
mymodel.has_ready_task

Handle asynchronous task results for your Django model instance:

mymodel.get_task_results()
mymodel.get_task_result(task_id)
mymodel.clear_task_results()
mymodel.clear_task_result(task_id)

Filter your Django model based upon asynchronous tasks:

MyModel.objects.with_tasks()
MyModel.objects.with_pending_tasks()
MyModel.objects.with_started_tasks()
MyModel.objects.with_retrying_tasks()
MyModel.objects.with_failed_tasks()
MyModel.objects.with_successful_tasks()
MyModel.objects.with_running_tasks()
MyModel.objects.with_ready_tasks()

MyModel.objects.without_tasks()
MyModel.objects.without_pending_tasks()
MyModel.objects.without_started_tasks()
MyModel.objects.without_retrying_tasks()
MyModel.objects.without_failed_tasks()
MyModel.objects.without_successful_tasks()
MyModel.objects.without_running_tasks()
MyModel.objects.without_ready_tasks()

License
-------
* Released under MIT License
* Copyright (c) 2014-2016 Marc Hoersken <info@marc-hoersken.de>

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-celery-model-0.1.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_celery_model-0.1.2-py2-none-any.whl (9.0 kB view details)

Uploaded Python 2

File details

Details for the file django-celery-model-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django-celery-model-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ca004544b38888d10fc74516ccc456cab53e17b70c05435fb7422f702ddb099b
MD5 1ac5b50e911e16f7ac856acb21b4716d
BLAKE2b-256 c496e71fcc74574667466d3d99ccd7ab4ed53c99ab8c170477b022b3b0ad8c8e

See more details on using hashes here.

File details

Details for the file django_celery_model-0.1.2-py2-none-any.whl.

File metadata

File hashes

Hashes for django_celery_model-0.1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 03fd7e4d13d1f03f5a41f0e1aad8fb69d98dde9b1117dd9dccaebc5ebd468c78
MD5 540e26cff007b1cecb4d5dfab4103869
BLAKE2b-256 e3ab3e4966414a045412986c7ef0678c045c6ef4119aad381716e8858732e9f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page