On Oct 19, 2006, at 3:21 PM, 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' :(



You initialize nums as an array with an empty string as the first  
member. You just need to initialize it like this:

nums = []

Don



--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to