Top "Django-queryset" questions

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

Django Order By Date, but have "None" at end?

I have a model of work orders, with a field for when the work order is required by. To get …

django django-models django-queryset
Django filter JSONField list of dicts

I run Django 1.9 with the new JSONField and have the following Test model : class Test(TimeStampedModel): actions = JSONField() Let's say …

python django django-models django-queryset django-jsonfield
Django Aggregation - Expression contains mixed types. You must set output_field

I'm trying to achive an Aggregation Query and that's my code: TicketGroup.objects.filter(event=event).aggregate( total_group=Sum(…

django aggregate-functions django-queryset django-orm
How do I retrieve a Django model class dynamically?

Without having the full module path of a Django model, is it possible to do something like: model = 'User' [in …

python django django-models django-queryset
Django Custom Queryset filters

Is there, in Django, a standard way to write complex, custom filters for QuerySets? Just as I can write MyClass.…

python django django-queryset generator-expression
Django Query extremely slow

I have a problem with a Django application. Queries on the model Scope are extremely slow and after some debugging …

django database performance django-queryset django-postgresql
comparing querysets in django TestCase

I have a very simple view as follows def simple_view(request): documents = request.user.document_set.all() return render(…

django compare testcase django-queryset
Using a string as the argument to a Django filter query

I'm trying to do a django query, but with the possibility of several different WHERE parameters. So I was thinking …

django django-queryset
Django queryset filter - Q() | VS __in

What is the difference between queryset.filter(Q(foo='bar') | Q(foo='baz')) and queryset.filter(foo__in=['bar', 'baz']) …

django filter django-queryset django-orm django-q
Django admin inline: select_related

Using Django 1.8 on Python 3.4.1 with models: class Product(models.Model): name = models.CharField(max_length=255) # some more fields here def __…

python django foreign-keys admin django-queryset