Hi, i am trying to compare two count-annotations with a simple "greater- than" filter like this: ResultSequence.objects.annotate(num_result=Count('resultset'),num_part=Count('seminar__participant')).filter(num_result__gt=num_part) i also tried doing it like this: ResultSequence.objects.annotate(num_result=Count('resultset')).annotate(num_part=Count('seminar__participant')).filter(num_result__gt=num_part) both ways return "NameError: name 'num_part' is not defined"
it seems to be working nicely when i manually set the last parameter: ResultSequence.objects.annotate(num_result=Count('resultset'),num_part=Count('seminar__participant')).filter(num_result__gt=15) i dont know if i misunderstand the whole concept of "annotate" or if this is just impossible to do.. thanks in advance patrick -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.