filtering and searching help - regarding

9 views
Skip to first unread message

Mohan Goud

unread,
Feb 3, 2019, 1:59:35 PM2/3/19
to django...@googlegroups.com


students list is in database. I have to search based on section, department and year and sort them in ascending order. can any one help me on this through any video links or any other.   

Birol Demirtaş

unread,
Feb 3, 2019, 2:00:51 PM2/3/19
to django...@googlegroups.com
Django ? Or ?

3 Şub 2019 Paz, saat 16:59 tarihinde Mohan Goud <kathi.m...@gmail.com> şunu yazdı:


students list is in database. I have to search based on section, department and year and sort them in ascending order. can any one help me on this through any video links or any other.   

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB29Dk%3D9sLASp9Gr4q73qzh8ozw-ecYukUZZ62WkC8XKXtMDZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Mohan Goud

unread,
Feb 3, 2019, 2:02:28 PM2/3/19
to django...@googlegroups.com

Birol Demirtaş

unread,
Feb 3, 2019, 2:07:40 PM2/3/19
to django...@googlegroups.com
Wnat u want ask to database ? 

Example

X = yourmodel.objects.all()
Context = {‘x’:x}
Return render (request,your.html,context)



3 Şub 2019 Paz, saat 17:02 tarihinde Mohan Goud <kathi.m...@gmail.com> şunu yazdı:

Shashank Singh

unread,
Feb 3, 2019, 2:12:04 PM2/3/19
to django...@googlegroups.com
Student.objects.filter(section__iexact="a", department=1,year=2019).order_by("name")

Mohan Goud

unread,
Feb 3, 2019, 2:13:12 PM2/3/19
to django...@googlegroups.com
yes render response but i have to store the sorted version in some other model by creating it dynamically.


Mohan Goud

unread,
Feb 3, 2019, 2:19:13 PM2/3/19
to django...@googlegroups.com
here the problem is, i can't give sectionname, dept and year directly. It has to do it for all sections in the database. can u help me how to do this.



Shashank Singh

unread,
Feb 3, 2019, 2:27:53 PM2/3/19
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages