Hi,
I'm using the django-voting application whose method
get_votes_in_bulk(object) returns a "votes" dictionary like:
{object_id: {''score': score, 'num_votes': num_votes}
I'm passing this dictionary as extra_context to a template where I'm
also using the regroup tag on theobjects which I pass as the main
queryset.
So I would need to access the score and the num_votes as follow on a
specific item base (I can't iterate sequentially over the items due to
the regrouping). To be precise I would need to access as follow:
{{ votes.object.id.score }}
Of course this doesn't work because we can only use
votes.object_id.score but not votes.object.id.score. Instead I need to
first lookup the id and then access the dictionary using this id.
If it was python I could have done something like:
votes[object.id]['score']
Is there a way to do so in a template?
Thanks
Francesco
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---