Skip to main content

Celery integration with Tryton

Project description

Celery integration with Tryton. It defines an abstract base Task class that runs inside a Tryton transaction. If the task is called from within a Tryton transaction, the context of this one will be automatically restored when the worker will execute it.

Getting Started

Here is a simple application:

from celery import Celery
from celery_tryton import TrytonTask, celery_app
from trytond.pool import Pool

celery_app.conf.TRYTON_DATABASE = 'test'

@celery.task(base=TrytonTask)
def hello(user_id):
    User = Pool().get('res.user')
    user = User(user_id)
    return 'hello world, %s' % user.name

Configuration

All standard celery configuration options will work but in addition TRYTON_DATABASE must be set to the default Tryton database name and optionally TRYTON_CONFIG to load a specific configuration file.

The celery_app will load the configuration from the config value from the section [celery] defined in the trytond configuration when used from a Tryton module.

Example

Start a worker:

$ celery worker --app=examples.purchase_requests

Call generate_all task:

$ celery call examples.purchase_requests.generate_all

To report issues please visit the celery_tryton bugtracker.

Project details


Download files

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

Source Distribution

celery_tryton-0.4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distributions

celery_tryton-0.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

celery_tryton-0.4-py2-none-any.whl (5.6 kB view details)

Uploaded Python 2

File details

Details for the file celery_tryton-0.4.tar.gz.

File metadata

  • Download URL: celery_tryton-0.4.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.7.2 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.15

File hashes

Hashes for celery_tryton-0.4.tar.gz
Algorithm Hash digest
SHA256 854525a3ecba163e68521bb9eadb6b3e3d48a5da5422fc72cce64d1dd0a492f8
MD5 ff3000f7026fe5ecca0f8d6a639683c8
BLAKE2b-256 be166cf2d4ddf9511d556a9130337eb09a5b121fc25c05300d8dcb09bddada2a

See more details on using hashes here.

File details

Details for the file celery_tryton-0.4-py3-none-any.whl.

File metadata

  • Download URL: celery_tryton-0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.7.2 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.15

File hashes

Hashes for celery_tryton-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0d205b8e9ce870ab5ab543f291fad46841dea6851f6d2592f8d8ed3ccda40519
MD5 fbcc35fb466c892adbd6af6578cc81db
BLAKE2b-256 5dd6cc22429d6fd81e4268bc5931bb7744399cb25089d2ae535722dce96e3834

See more details on using hashes here.

File details

Details for the file celery_tryton-0.4-py2-none-any.whl.

File metadata

  • Download URL: celery_tryton-0.4-py2-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.7.2 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.15

File hashes

Hashes for celery_tryton-0.4-py2-none-any.whl
Algorithm Hash digest
SHA256 4920524557e858bd2feac5fcb0492c41f8f8254e3110f1b064cbc7d259e08164
MD5 e651399882d404b950ffdd7f4d7addd6
BLAKE2b-256 f902bb1507868d33ba4c50fd5372bf77204d76d35ef67eaaa8cfbea3b6a0afc5

See more details on using hashes here.

Supported by

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