I am not sure if the following statements in Django/Mysql will result
in one or three database queries.

candidates = Candidate.objects.filter(department = dept).order_by('-
salary')[:30]   # Gets all the top salary candidates
head_candidates = candidates[:20]   # Gets top 20
tail_candidates = candidates[20:30]  # Gets remaining 10

Is there a better way to do it, or is this fine :)
-- 
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