Top "Django-orm" questions

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

Django filter many-to-many with contains

I am trying to filter a bunch of objects through a many-to-many relation. Because the trigger_roles field may contain …

python django django-models many-to-many django-orm
Django self-referential foreign key

I'm kind of new to webapps and database stuff in general so this might be a dumb question. I want …

python django django-orm
How to rename items in values() in Django?

I want to do pretty much the same like in this ticket at djangoproject.com, but with some additonal formatting. …

django django-orm
LEFT JOIN Django ORM

I have the following models: class Volunteer(models.Model): first_name = models.CharField(max_length=50L) last_name = models.CharField(…

python sql django django-models django-orm
Django ORM - objects.filter() vs. objects.all().filter() - which one is preferred?

Very often I see constructs like MyModel.objects.all().filter(...) which will return a QuerySet of the default Mananger. At …

python django django-queryset django-orm django-managers
Django select only rows with duplicate field values

suppose we have a model in django defined as follows: class Literal: name = models.CharField(...) ... Name field is not unique, …

sql django django-orm
Django: implementing JOIN using Django ORM?

I have a Q&A type of site built in Django with the following models: class Question(models.Model): …

django django-models join django-queryset django-orm
Django - get objects from a many to many field

I have a m2m field called "admins" inside a model and I need to obtain from a view all …

django django-models many-to-many django-orm
Direct assignment to the forward side of a many-to-many set is prohibited. Use emails_for_help.set() instead

I am new to Django and didn't find any reference regarding this issue. I am getting this error when i …

python django django-orm m2m
Why is iterating through a large Django QuerySet consuming massive amounts of memory?

The table in question contains roughly ten million rows. for event in Event.objects.all(): print event This causes memory …

sql django postgresql django-orm