Top "Django-queryset" questions

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

Limiting Memory Use in a *Large* Django QuerySet

I have a task which needs to be run on 'most' objects in my database once every some period of …

python django memory-management django-queryset
A left outer reverse select_related in Django?

Imagine the following model: class Parent(Model): ... class Child(Model) father = ForeignKey(Parent) ... Some parents have children, others do not (…

django left-join django-queryset django-select-related
Annotating SUM aggregation function leading to 'None' value in Django

Doing my first real Django project, and need guidance. Background: My project is a reddit clone. Users submit links+text. …

python django django-models django-queryset django-aggregation
Django update queryset with annotation

I want to update all rows in queryset by using annotated value. I have a simple models: class Relation(models.…

django django-models sql-update django-queryset
How to dynamically provide lookup field name in Django query?

I want to look for a certain string in several fields of a Model in Django. Ideally, it would go …

django django-queryset
How to add extra context & queryset field in Django generic views?

I'm building Django application, with submitting links and voting functionality. I want to show all links, voted by a user …

django django-views django-queryset django-generic-views django-context
Annotate a queryset with the average date difference? (django)

I searched all over place for an answer to this but couldn't find anything. Perhaps this is just a stupid …

django date django-queryset annotate
Django custom for complex Func (sql function)

In the process of finding a solution for Django ORM order by exact, I created a custom django Func: from …

python django django-queryset django-annotate
Using .aggregate() on a value introduced using .extra(select={...}) in a Django Query?

I'm trying to get the count of the number of times a player played each week like this: player.game_…

python mysql django django-queryset django-aggregation
How to filter queryset in changelist_view in django admin?

Let's say I have a site where Users can add Entries through admin panel. Each User has his own Category …

django django-admin django-queryset changelist