Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Suppose we have a model of 100 courses and we want to select only

1. How select only first 10 courses.
2. How to select only in the range of 30 to 40 course.
3. How we can skip first course.
4. How we can select only first course.
5. How we can select only last course or skip the last course.

Please tell me, how we can filter django models.

What I have tried:

I have tried this
courses1 = Courses.objects.all()


but could not filter it. Please help me.
Posted
Updated 21-Apr-20 22:08pm

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900