1👍
I think you are on the right track with your solution to post data through forms, sending data like : {‘state’: ‘received’}.
Also, I guess that Django Formsets might be useful for your design:
https://docs.djangoproject.com/en/1.9/topics/forms/formsets/.
Change the doc version if you don’t use Django 1.9
0👍
Another solution would be to have a dropdown/ChoiceField with id-s of all the objects for which it is possible to change order_received
to True. You can make two more dropdowns for order_processed
and order_delivered
. Then, hide whole the form, and with some JS fiddling make the buttons to update the form values and send the form.
But, being honest, it will just not reuse the built in Django functions, so I would still advice to say what @phiberjenz mentions and make a formset. If you don’t want to use JS you could make the buttons next to the orders to work as submit buttons AND send the post that would be processed by your server-side form.
- Model field level permission and Field value level permission in Django and DRF
- When i upgrade django-debug-toolbar at 1.6 is does not working
- Receiving a NoReverseMatch error while trying to add the username to the url after login
0👍
I ended up creating a RedirectView that called a method on the instance changing the state of the order. This is called with a GET request, but super simple and according to https://docs.djangoproject.com/en/1.10/ref/class-based-views/base/ (at the bottom) the example shows exactly this.
- Django – saving onetonone linked forms at same time not working
- Django Polling of Import script – need user status update. Use model? Sessions?