Top "Django-orm" questions

Django's ORM system, comprising its queryset and model systems.

How to implement followers/following in Django

I want to implement the followers/following feature in my Django application. I've an UserProfile class for every User (django.…

python django django-orm
Pivoting data and complex annotations in Django ORM

The ORM in Django lets us easily annotate (add fields to) querysets based on related data, hwoever I can't find …

python sql django django-orm
Trying to make a PostgreSQL field with a list of foreign keys in Django

Here is what I'm trying to do: Make a model in Django that is a PostgreSQL array (database specific type), …

django postgresql django-models django-orm django-migrations
How to map PostgreSQL array field in Django ORM

I have an array field in my PostrgreSQL database of type text. Is there a way to map this into …

django postgresql django-models django-orm
How to filter django model by its objects in many-to-many field (exact match)?

I have this model in my code: class Conversation(models.Model): participants = models.ManyToManyField(User, related_name="message_participants") and …

django django-models many-to-many django-orm
Django ORM - mock values().filter() chain

I am trying to mock a chained call on the Djangos model.Manager() class. For now I want to mock …

python django django-orm python-mock django-nose
Save a list of objects in django

I am using django 1.5 and i am trying to do something like this : quotes = formset.save() user = client_form.save() …

python django django-views django-orm django-1.5
How to work around lack of support for foreign keys across databases in Django

I know Django does not support foreign keys across multiple databases (originally Django 1.3 docs) But I'm looking for a workaround. …

django django-models django-orm
Django order_by specific order

Is it possible to replicate this kind of specific sql ordering in the django ORM: order by (case when id = 5 …

django django-orm