django-orm
How to perform queries in Django following double-join relationships (or: How to get around Django's restrictions on ManyToMany "through" models?)
There must be a way to do this query through the ORM, but I\'m not seeing it. The Setup Here\'s what I\'m modelling: one Tenant can occupy multiple rooms and one User can own multiple rooms. So Room[详细]
2023-02-07 03:23 分类:问答Can Django's ORM output the SQL query it is using?
I know that you can output the SQL to see tables that are created. Is it possible for Django to out开发者_StackOverflowput the sql used for any query like:[详细]
2023-02-05 20:08 分类:问答How to use the Django ORM to query only by date in a datetimefield
I have a table with a DataTimeField.I\'d like to get a list of all the objects where the DateTimeField =开发者_如何学C a specific day (ignoring the time part).[详细]
2023-02-05 00:53 分类:问答Updating properties of a Django model on save with processing of submitted ImageFields
Basically I\'m trying to save a Django model which contains an ImageField, and updates its latitude and longitude FloatFields with values grabbed from the EXIF data contained in the image, if any.[详细]
2023-01-31 11:00 分类:问答Django: Simplifying long 'join's?
I\'ve got a few long queries (for checking capabilities) which look like this: widgets = Widget.objects.filter([详细]
2023-01-31 01:54 分类:问答Django and Aggregate: Sum of distinct values?
I am trying to do a django aggregate function, but开发者_开发百科 am unable to produce the desired result.[详细]
2023-01-28 23:20 分类:问答Django database query: How to get object by id?
Django automatically creates an id field as primary key. Now I need to get the object b开发者_开发问答y this id.[详细]
2023-01-28 10:13 分类:问答How to query for count?
I\'ve got a query, Bid.objects.filter(shipment=shipment, status=BidStatuses.ACCEPTED, user=request.user, items__count=0).exists()开发者_如何转开发[详细]
2023-01-27 04:55 分类:问答saving django ManyToMany not valid
I have a form from my model that needs to be validated and saved making use of ManyToMany Fields. Everytime I t开发者_如何学运维ry and save it, I get thrown back to the page, just saying this field i[详细]
2023-01-25 07:07 分类:问答Django ManyRelatedManager filtering based on through class
I have a simple many-to-many relationship based around a through class. class Person(models.Model): friends = models.ManyToManyField(\'self\', through=\'Friendship\')[详细]
2023-01-20 07:20 分类:问答