79229556

Date: 2024-11-27 09:09:19
Score: 1.5
Natty:
Report link

To do what you're looking for, there is no group_by as such, in your place I'd make a list with all the unique combinations of your 2 address fields, For each group, filter the corresponding commands and use update() to assign the specified instance of Bill

You can find more information in the documentation, particularly in the sections on values() and distinct() https://docs.djangoproject.com/en/5.1/ref/models/querysets/

I hope my answer helps solve your problem

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Victor Hubert