'Django updating value in a loop

Please keep in mind, that I just started learning Django and MySQL.

I created a script that can read my transactions from my bank statements and added them to a MySQL table which contains the following fields: id,amount,creditordebit,bookingdate ,partner ,category

I'm trying to create an interactive site to loop over the newly added data and update the category field based on the transaction type/partner.

I want to loop over them one by one and categorize them using forms.ChoiceField.

So far I have created the forms.py and the forms.ChoiceField and choices list, but I am having trouble creating a view and template for this.

I have tried to use the QuerySet iterate() but I could not get the next item by id, it jumped straight to the last id.

Is this even possible with Django only or do I need to also include some JavaScript?

Thanks!

Edit: A rough idea about what it would look like: sketch



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source