On 14 déc, 00:46, "Alfredo Alessandrini" <alfreal...@gmail.com> wrote:
> Hi,
>
> It's possible call a query with max or min value?:
>
> like this:
>
> game_list = game.objects.filter(Q(max_rating > player.rating) &
> Q(min_rating < player.rating))

Sorry but your question is not clear. Are 'min_rating' and
'max_rating' fields of the game object ? If yes:

game_list = game.objects.filter(
    Q(max_rating__gt = player.rating)
    &
    Q(min_rating__lt = player.rating)
   )

Else, cf Malcolm's answer.



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