I want a way to update the status in a model field when my process below is complete.
views.py
#If we had a POST then get the request post values.
if request.method == 'POST':
batches = Batch.objects.for_user_pending(request.user)
for batch in batches:
ProcessRequests.delay(batch)
So I'm thinking of doing something like this in the view...
batch.complete_update()
My issue is, in my models as I'm not sure how, and just need a little help.
This is what I have done so far...
I created
STATUSES = (
('Pending', 'Pending'),
('Complete', 'Complete'),
('Failed', 'Failed'),
('Cancelled', 'Cancelled'),
)
then a model function called def complete_update(self):
, but I'm not sure how to update the field in it with the status above then save it all from within the model.
Thank you in advance.
PS, is this the right way to go about it?