On May 27, 3:10 pm, Pirate Pete wrote:
> hello again,
>
> i am trying to get a single entry from my db and then annotate the
> count and rating to it like we established above
>
> however it doesn't seem to be returning anything:
> videos =
> Video.objects.get(id=vid_id).annotate(rating_count=Coun
hello again,
i am trying to get a single entry from my db and then annotate the
count and rating to it like we established above
however it doesn't seem to be returning anything:
videos =
Video.objects.get(id=vid_id).annotate(rating_count=Count('rating'),
rating_avg=Avg('rating__rating'))
i even
On May 25, 10:30 am, Pirate Pete wrote:
> sorry for this one last question,
>
> do you have any idea how i would go about rounding these values and
> converting them from numbers to *'s ?
>
> i tried using the round() function on the annotation however it kept
> giving me a type error "a float is
sorry for this one last question,
do you have any idea how i would go about rounding these values and
converting them from numbers to *'s ?
i tried using the round() function on the annotation however it kept
giving me a type error "a float is required."
cheers
On May 25, 7:10 pm, Daniel Rosem
You sir have saved me many a headache, i can't honestly thank you
enough
All the best!
On May 25, 7:10 pm, Daniel Roseman wrote:
> On May 25, 9:52 am, Pirate Pete wrote:
>
> > Thank you very very much for your reply.
>
> > There is still a few things i need to grasp.
>
> > Firstly, why did you
On May 25, 9:52 am, Pirate Pete wrote:
> Thank you very very much for your reply.
>
> There is still a few things i need to grasp.
>
> Firstly, why did you do this :
> annotate(rating_count=Count('rating')).annotate(rating_avg=Avg('rating__rat
> ing'))
> as opposed to annotate(rating_count=Count(
Thank you very very much for your reply.
There is still a few things i need to grasp.
Firstly, why did you do this :
annotate(rating_count=Count('rating')).annotate(rating_avg=Avg('rating__rating'))
as opposed to annotate(rating_count=Count('rating'),
rating_avg=Avg('rating__rating'))
Secondly,
On May 25, 6:09 am, Pirate Pete wrote:
> I have been trying to get some kind of kind response from django for a
> few days now and it has been very unkind to me :P
>
> basically i need to create a page that has a video title (link) and an
> average rating with the amount of people that rated it in
I have been trying to get some kind of kind response from django for a
few days now and it has been very unkind to me :P
basically i need to create a page that has a video title (link) and an
average rating with the amount of people that rated it in brackets.
so it will look like ... Awesom video
9 matches
Mail list logo