79600477

Date: 2025-04-30 14:06:43
Score: 1
Natty:
Report link

I found a shorter solution, which I like more than the original one:

from collections import Counter

check_manies = check_same_objects(
                 Counter(qs_foo.values_list('must_match_m2m_field', flat=True).values()
                 )

so the first method is enough for all field comparisons (though time efficiency is unclear until now)...

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: baloersch