Django Celery Beats Package Add Custom Model Fields

598 Views Asked by At

I am working with the pypi django_celery_beats package in a project (https://pypi.org/project/django-celery-beat/) and I am in a situation where it would be beneficial to add fields to the PeriodicTask model, but I am struggling to think of how to extend the model where it will still work as expected since the package will not know to use my newly created CustomPeriodicTask(PeriodicTask) model.

So my question is, do I need to store the package locally and edit the source or can I override the fields in the model without having to go through all of that trouble?

2

There are 2 best solutions below

1
2ps On BEST ANSWER

If the behavior of the core functionality will change based on your field changes, then you'll have to fork the repo and make your own updates.

0
lbris On

Otherwise you could create a model layer alongside the PeriodicTask with a OneToOne Relation between them.