Top "Django-queryset" questions

Django querysets are the primary abstraction for retrieving objects from Django's ORM system

Django lazy QuerySet and pagination

I read here that Django querysets are lazy, it won't be evaluated until it is actually printed. I have made …

django lazy-loading django-queryset
Optimizing database queries in Django REST framework

I have the following models: class User(models.Model): name = models.Charfield() email = models.EmailField() class Friendship(models.Model): from_…

python django-rest-framework django-queryset django-orm django-select-related
Django query case-insensitive list match

I have a list of names that I want to match case insensitive, is there a way to do it …

django django-queryset
How do I test Django QuerySets are equal?

I am trying to test my Django views. This view passes a QuerySet to the template: def merchant_home(request, …

python django django-queryset django-testing
How to sort by annotated Count() in a related model in Django

I'm building a food logging database in Django and I've got a query related problem. I've set up my models …

django django-models aggregate-functions django-queryset
Django: does the ORM support the SQL "IN" operator?

Does the Django ORM support the SQL IN operator? Something like: SELECT * FROM user WHERE id IN (1, 5, 34, 567, 229) How do I …

django django-queryset django-orm
how to limit the queryset of an inline model in django admin

I have two models implemented like class A(models.Model): a_name = models.CharField(max_length=50) class B(models.Model): …

python django inline django-queryset django-admin-filters
Selecting specific fields using select_related in Django

I have two models Article and Blog related using a foreign key. I want to select only blog name while …

django python-2.7 django-queryset django-1.8 django-select-related
In Django, can you add a method to querysets?

In Django, if I have a model class, e.g. from django.db import models class Transaction(models.Model): ... then …

python django django-queryset
Django queryset annotate field to be a list/queryset

I'm trying to use django annotation to create queryset field which is a list of values of some related model …

python django django-queryset django-annotate