django-orchestra-test/orchestra/contrib/settings
Santiago L 70042f3b5c Regenerate commit inicio 2023/07/09
commit 0f26b5a8e0
Author: jorgepastorr <jorge.pastor.rr@gmail.com>
Date:   Sun Jul 9 07:51:51 2023 +0000
Repo:   https://gitea.pangea.org/pangea/django-orchestra.git
2023-11-17 13:25:13 +01:00
..
templates/admin/settings Regenerate commit inicio 2023/07/09 2023-11-17 13:25:13 +01:00
README.md Improved settings.parser API 2015-10-04 19:57:00 +00:00
__init__.py PEP8 compliance 2015-10-05 13:31:08 +00:00
admin.py Regenerate commit inicio 2023/07/09 2023-11-17 13:25:13 +01:00
apps.py Regenerate commit inicio 2023/07/09 2023-11-17 13:25:13 +01:00
forms.py Regenerate commit inicio 2023/07/09 2023-11-17 13:25:13 +01:00
parser.py Regenerate commit inicio 2023/07/09 2023-11-17 13:25:13 +01:00

README.md

>>> from orchestra.contrib.settings import Setting, parser
>>> Setting.settings['TASKS_BACKEND'].value
'thread'
>>> Setting.settings['TASKS_BACKEND'].default
'thread'
>>> Setting.settings['TASKS_BACKEND'].validate_value('rata')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/orchestra/django-orchestra/orchestra/contrib/settings/__init__.py", line 99, in validate_value
    raise ValidationError("'%s' not in '%s'" % (value, ', '.join(choices)))
django.core.exceptions.ValidationError: ["'rata' not in 'thread, process, celery'"]
>>> parser.apply({'TASKS_BACKEND': 'process'})
...
>>> parser.apply({'TASKS_BACKEND': parser.Remove()})
...