-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve #305 abstract models #314
base: main
Are you sure you want to change the base?
Commits on Oct 29, 2024
-
[celery#305] Added abstract models.
`models` module replaced by a `models` package containing an `abstract` module (for abstract models) and a `generic` module (for the default models, previously in the `models` module) --- Resolves celery#305 Fixes celery#314
Configuration menu - View commit details
-
Copy full SHA for 22c7c76 - Browse repository at this point
Copy the full SHA 22c7c76View commit details -
[celery#305]
ChordCounter
moved fromabstract
module togeneric
…… module. Added some minor changes. --- Resolves celery#305 Fixes celery#314
Configuration menu - View commit details
-
Copy full SHA for c49ad2e - Browse repository at this point
Copy the full SHA c49ad2eView commit details -
* Fixed import bug
Configuration menu - View commit details
-
Copy full SHA for 25496f8 - Browse repository at this point
Copy the full SHA 25496f8View commit details -
Update django_celery_results/models/__init__.py
Co-authored-by: Allex <a.veldman@chain-stock.com>
Configuration menu - View commit details
-
Copy full SHA for 97661fd - Browse repository at this point
Copy the full SHA 97661fdView commit details -
[celery#305]: Improving abstract models implementation.
Added a `helpers` module into `models` containing the functions `taskresult_model()` and `groupresult_model()`. * `taskresult_model()`: will try to find the custom model using a dotted path defined under the constant `CELERY_RESULTS_TASKRESULT_MODEL` in the settings of the user's project * `groupresult_model()` will try to do the same using under the constant `CELERY_RESULTS_GROUPRESULT_MODEL`. By default if these attributes are not found `django-celery-results` will use the default models (`models.TaskResult` and `models.GroupResult`). Updated database backend in order to use custom models for `TaskResult and `GroupResult` it they're present. Instead to import explicitely the `TaskResult` and the `GroupResult` (default models from `django-celery-results`) we make use of the model helpers to load the right classes, the custom ones if they're present otherwise we use the default ones. Getting data from `task_kwargs` to extend the `task_properties` and be able to store them into the database (using the custom models). First of all we need a way to get data from `task_kwargs` (or somewhere else) just before a `task_result` record is created, evaluate that data and find the right values that will be used to fill the new fields defined in the custom model. So for this purpose we added a settings module to `django-celery-results` which will hold default settings, the first setting that will contain is a function in charge to get a callback from the settings of the user project. This callback will be feeded by the task `task_kwargs`, which will be intercepted in `DatabaseBackend._get_extended_properties` just before the `task_kwargs` are encoded by `encode_content()` method and send it to the `store_result` method from the object manager of `TaskModel` (Custom/Default one). To end, we must to extend the arguments of the `store_result` method from the `TaskResult` Manager adding `extra_fields` argument that will make us able to send extra data to the custom model, when it's defined. --- Resolves celery#305 Fixes celery#314
Configuration menu - View commit details
-
Copy full SHA for a5554d7 - Browse repository at this point
Copy the full SHA a5554d7View commit details -
[celery#305]:
extend_task_props_callback
relocated.`extend_task_props_callback` moved from `_get_extended_properties` to `_store_result`. Suggested by @AllesVeldman. `extend_task_props_callback` will get the `request` object as first parameter and a copy of `task_props` (avoiding potential manipulation of the original `task_props`) as second paramenter. --- Resolves celery#305 Fixes celery#314
Configuration menu - View commit details
-
Copy full SHA for dbeb9a1 - Browse repository at this point
Copy the full SHA dbeb9a1View commit details -
[celery#305]: Added a default callable to
get_callback_function
`get_callback_function()` gets a default callback as an arg returning explicitely an empty dict. `get_callback_function()` raises an `ImproperlyConfigured` exception when the callback is not callable. --- Resolves celery#305 Fixes celery#314
Configuration menu - View commit details
-
Copy full SHA for 7565b36 - Browse repository at this point
Copy the full SHA 7565b36View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dfa0fc - Browse repository at this point
Copy the full SHA 1dfa0fcView commit details -
[celery#305] Added a sanity check to
task_props_extension
Added `get_task_props_extension` to `settings` module which will raise an `ImproperlyConfigured` when the task_props_extension doesn't complies with the Mapping protocol. `DatabaseBackend` will make use of `get_task_props_extension` to update a potential custom model with the custom properties --- Resolves celery#305 Fixes celery#314
Configuration menu - View commit details
-
Copy full SHA for 14928be - Browse repository at this point
Copy the full SHA 14928beView commit details -
Configuration menu - View commit details
-
Copy full SHA for b70c44f - Browse repository at this point
Copy the full SHA b70c44fView commit details -
[celery#305] Added documentation about this feature.
A new page added to the documentation where we explain how to use this feature. -- issue: celery#305 pull-request: celery#314
Configuration menu - View commit details
-
Copy full SHA for cedccdf - Browse repository at this point
Copy the full SHA cedccdfView commit details -
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Configuration menu - View commit details
-
Copy full SHA for 0fc0b48 - Browse repository at this point
Copy the full SHA 0fc0b48View commit details -
Fixed a "wrong" description for the
ImproperlyConfigured
exception ……in `django_celery_results.settings` Fixed a "wrong" description for the `ImproperlyConfigured` exception raised when `task_props_extension` doesn't complies with the Mapping protocol. At this point `task_props_extension` is just a dict that inherits from Mapping, not an explicit instance. Thanks @AllexVeldman Co-authored-by: Allex <a.veldman@chain-stock.com>
Configuration menu - View commit details
-
Copy full SHA for 242edab - Browse repository at this point
Copy the full SHA 242edabView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ddefa8 - Browse repository at this point
Copy the full SHA 7ddefa8View commit details -
Update docs/extending_task_results.rst
Co-authored-by: Allex <a.veldman@chain-stock.com>
Configuration menu - View commit details
-
Copy full SHA for a5681a6 - Browse repository at this point
Copy the full SHA a5681a6View commit details -
Update docs/extending_task_results.rst
Co-authored-by: Allex <a.veldman@chain-stock.com>
Configuration menu - View commit details
-
Copy full SHA for 48f278a - Browse repository at this point
Copy the full SHA 48f278aView commit details -
Update docs/extending_task_results.rst
Co-authored-by: Allex <a.veldman@chain-stock.com>
Configuration menu - View commit details
-
Copy full SHA for fb5ea91 - Browse repository at this point
Copy the full SHA fb5ea91View commit details -
feat(models): add
AbstractChordCounter
and updateChordCounter
- Added new abstract model `AbstractChordCounter` in `abstract.py` for Chord synchronization, including fields for `group_id`, `sub_tasks`, and `count`. - Updated `ChordCounter` model in `generic.py` to inherit from `AbstractChordCounter`. - Moved `group_result` method from `ChordCounter` to `AbstractChordCounter`. - Added helper function `chordcounter_model` in `helpers.py` to return the active `ChordCounter` model. - Updated import statements in `database.py` to use `chordcounter_model` helper function. - Added `ChordCounterModel` attribute to `DatabaseBackend` class, and updated `create` and `get` methods to use `ChordCounterModel` instead of `ChordCounter`. Relates to: celery#305
Configuration menu - View commit details
-
Copy full SHA for 10a5c3a - Browse repository at this point
Copy the full SHA 10a5c3aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d6b0d19 - Browse repository at this point
Copy the full SHA d6b0d19View commit details -
Configuration menu - View commit details
-
Copy full SHA for 946ff07 - Browse repository at this point
Copy the full SHA 946ff07View commit details -
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Configuration menu - View commit details
-
Copy full SHA for 39081b3 - Browse repository at this point
Copy the full SHA 39081b3View commit details
Commits on Oct 31, 2024
-
Configuration menu - View commit details
-
Copy full SHA for cbdb7a4 - Browse repository at this point
Copy the full SHA cbdb7a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29cc821 - Browse repository at this point
Copy the full SHA 29cc821View commit details
Commits on Nov 1, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c508179 - Browse repository at this point
Copy the full SHA c508179View commit details
Commits on Nov 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 101a24f - Browse repository at this point
Copy the full SHA 101a24fView commit details -
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Configuration menu - View commit details
-
Copy full SHA for af843ba - Browse repository at this point
Copy the full SHA af843baView commit details
Commits on Nov 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 90310b8 - Browse repository at this point
Copy the full SHA 90310b8View commit details
Commits on Nov 8, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e2a2bc0 - Browse repository at this point
Copy the full SHA e2a2bc0View commit details -
fix: Update configuration for isort and black to enforce line length …
…and multi-line output This commit addresses an issue where the pre-commit hook merges import formatted with isort's multiline output mode 3 back into a single line, resulting in a flake8 E508 violation in CI due to lines exceeding 79 characters
Configuration menu - View commit details
-
Copy full SHA for af5a226 - Browse repository at this point
Copy the full SHA af5a226View commit details