You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a scheduled task you give the example (first one).
# Use the schedule wrapper
from django_q.tasks import schedule
schedule('math.copysign',
2, -2,
hook='hooks.print_result',
schedule_type=Schedule.DAILY)
However Schedule.DAILY is not imported here, so this should be
# Use the schedule wrapper
from django_q.tasks import schedule
from django_q.tasks import Schedule
schedule('math.copysign',
2, -2,
hook='hooks.print_result',
schedule_type=Schedule.DAILY)
While your second example
# Or create the object directly
from django_q.models import Schedule
Schedule.objects.create(func='math.copysign',
hook='hooks.print_result',
args='2,-2',
schedule_type=Schedule.DAILY
)
Does idd only need the single import. I think it's more recommended to only use the second option
The text was updated successfully, but these errors were encountered:
For a scheduled task you give the example (first one).
However Schedule.DAILY is not imported here, so this should be
While your second example
Does idd only need the single import. I think it's more recommended to only use the second option
The text was updated successfully, but these errors were encountered: