bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch
Learn/Django

Django

QuerySets

QuerySets focused on Django QuerySet and related concepts.

Lesson 1

Django QuerySet

Django QuerySet

2 min
Read lesson →
Lesson 2visual

Django QuerySet - Get Data

Get Data There are different methods to get data from a model into a QuerySet. The values() Method The values() method allows you to return each object as a Python dictionary, with the names and valu…

2 min
Read lesson →
Lesson 3visual

Django QuerySet - Filter

QuerySet Filter The filter() method is used to filter your search, and allows you to return only the rows that matches the search term. As we learned in the previous chapter, we can filter on field n…

3 min
Read lesson →
Lesson 4

Django QuerySet - Order By

Order By To sort QuerySets, Django uses the order_by() method: Example Order the result alphabetically by firstname: mydata = Member.objects.all().order_by('firstname').values() In SQL, the above sta…

2 min
Read lesson →