Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

Installation
------------
You can install the latest version from GitHub manually:

git clone https://github.com/mback2k/django-celery-model.git
cd django-celery-model
python setup.py install

or via pip:

pip install https://github.com/mback2k/django-celery-model/zipball/master

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(models.Model, TaskMixin):
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.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)

License
-------
* Released under MIT License
* Copyright (c) 2014 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.0.2dev.zip (8.5 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.0.2dev.win32.exe (205.0 kB view details)

Uploaded Source

File details

Details for the file django-celery-model-0.0.2dev.zip.

File metadata

File hashes

Hashes for django-celery-model-0.0.2dev.zip
Algorithm Hash digest
SHA256 640e14d499a19c82dcb06008fad1f152fb128ba4fc90bc49453b01c64228fd1a
MD5 aa050c5ab7249dde78e61751ec6b8c09
BLAKE2b-256 3dafff19c5213659f769af50b33e6fbee0793196ca63317b6b5ced96e7d7ffd1

See more details on using hashes here.

File details

Details for the file django-celery-model-0.0.2dev.win32.exe.

File metadata

File hashes

Hashes for django-celery-model-0.0.2dev.win32.exe
Algorithm Hash digest
SHA256 d7d6c609903239f94b85b2ff047d476ecda302754bb59f5abe1554e9484e779f
MD5 a37087c5c96389235deeb779d441e411
BLAKE2b-256 af9deb990ade9a4cafe7ddd750330abcf2deee6be4637027001846439b6f627c

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