I am building a reporting portal using django. In this portal I need to give users the ability to schedule reports to run on a reoccurring basis. I have been researching django-celery and understand that you can use the periodic_task decorator to schedule a reoccurring task but in all the examples I have seen the cron schedule information is hard coded into the decorator.
@periodic_task(run_every=crontab(hours=7, minute=30, day_of_week="mon"))
Is there a way using django-celery to schedule a reoccurring task dynamically based on input from a user?
For example, a user uses a form to select the report they want run, provide all the parameters required by the report and the schedule when they want the report run on. Once I have processed the form is there a method or function I can call to add a run_report task to a schedule? If so is there a way to retrieve all the current schedules stored in the database so they can be displayed?