Top "Django-orm" questions

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

Django update table using data from another table

I have 2 tables products and catagories connected by foreign key. I need to update field products.new_cost using field …

django django-orm django-database
In Django filter statement what's the difference between __exact and equal sign (=)?

In Django filter statement what's the difference if I write: .filter(name__exact='Alex') and .filter(name='Alex') Thanks

django django-models django-orm
Getting objects.all() reverse() or descending order

In Django, calling object.manytomany.all().reverse(), and its template equivalent, object.manytomany.all.reverse, don't seem to work for …

django django-templates many-to-many manytomanyfield django-orm
Django count on many-to-many

I have the models: class Article(models.Model): title = models.TextField(blank=True) keywords = models.ManyToManyField(Keyword, null=True, blank=…

django django-orm
Django Query to get count of all distinct values for particular column

I am trying to fetch count of all distinct values in particular column for example I have following table in …

django django-models django-orm django-postgresql
Model in sub-directory via app_label?

In order to place my models in sub-folders I tried to use the app_label Meta field as described here. …

django django-models django-orm
Django ORM. Joining subquery

I have a table which contains list of some web sites and a table with statistics of them. class Site(…

django join left-join django-orm django-managers
Django: Force select related?

I've created a model, and I'm rendering the default/unmodified model form for it. This alone generates 64 SQL queries because …

django django-orm
Django: ManyToMany filter matching on ALL items in a list

I have such a Book model: class Book(models.Model): authors = models.ManyToManyField(Author, ...) ... In short: I'd like to retrieve …

django django-queryset manytomanyfield django-orm
Django bulk update with string replace

I am trying to update and modify a string field Django's ORM. The equivalent SQL to do this is: UPDATE …

python django django-orm