On 14 déc, 19:03, "Alfredo Alessandrini" <[email protected]> wrote:
> > Sorry but your question is not clear. Are 'min_rating' and
> > 'max_rating' fields of the game object ? If yes:
>
> Yes
>
> It's better:
>
> game_list = game.objects.filter(Q(max_rating__gt = player.rating) &
> Q(min_rating__lt = player.rating))
>
> or
>
> game_list = 
> game.objects.exclude(min_rating__gt=player.rating).exclude(max_rating__lt=player.rating)
>

As far as I'm concerned, I find the first solution more readable. wrt/
perfs, you'd have to benchmark it.


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

Reply via email to