zenx wrote: > hi, > > just tried this but doesn't work: > > q = ArtistaTag.objects.all() > nums=[''] > for tag in q: > num = tag.artista_set.count() > nums.append(num) > > max_art = max(nums) > min_art = min(nums) > > i get a TypeError unsupported operand type(s) for -: 'str' and 'long' :(
Why not use the list comprehension in python: nums = [tag.artista_set.count() for tag in q] max_art = max(number) min_art = min(number) Ian. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---