On Thu, Dec 8, 2011 at 12:45 PM, wgis <alpha.sh...@gmail.com> wrote:

> Ian Clelland, it worked! Thanks a lot for your perseverance
>
> Tom's secret sauce it's not working, unfortunately =(
> Just (Carrots, Flavour, 3.0)
> I guess since some 'contexts' don't have an associated thing-vote, the
> filter will cut them off.
> It would be more neat with the ORM, but I must be looking for a golden
> a pot.
>
> Don't want to seem ungrateful but I realized that I should have not
> just an individual vote by context but also an average vote by
> context. Can you still pull it of? I'm sorry, I know it's not django
> anymore but I have to ask.
>

I would give this a shot:

select thing, name, avg(vote) from mydatabase_votecontext left
join mydatabase_vote on (mydatabase_vote.context_id =
mydatabase_votecontext.id and thing='Carrots') group by thing, name;

Ian

Thanks for your help.
>
> --
> 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.
>
>


-- 
Regards,
Ian Clelland
<clell...@gmail.com>

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

Reply via email to