django-orm
Selecting related foreignkeys in Django
Say I have two models, Article and Category: class Article(models.Model): category = models.ForeignKey(Category, related_name=\'articles\')[详细]
2023-02-26 19:27 分类:问答Transaction beginning in Django
I read the chapter in the Django docs about the transaction management. From what I understand, the transaction is started as soon as TransactionMiddleware is invoked. Then by using @commit_on_success[详细]
2023-02-25 01:41 分类:问答Django: does the ORM support the SQL "IN" operator?
Does the Django ORM support the SQL IN 开发者_如何学JAVAoperator? Something like: SELECT * FROM user[详细]
2023-02-21 05:19 分类:问答Django filter through multiple fields in a many-to-many intermediary table
I have the following models in my django project: class Video(models.Model): media = models.ForeignKey(Media)[详细]
2023-02-21 00:37 分类:问答Smart Querying in Django, ManyToMany relationships with User
I\'m working on an app that currently has a lot of ManyToMany relationships (and will eventually have even more), and I\'m trying to think of clever ways (read: the right ways) to accurately query the[详细]
2023-02-20 22:08 分类:问答How to Register Images using Django's ORM
How do you register an image file in a Django ImageField without using a form, and not copying any files?[详细]
2023-02-20 14:55 分类:问答Django: Would object creation involving FK still work when the 2 tables involved are in different databases?
I have a Django model: class Note(models.Model) : text = models.TextField() owner = models.ForeignKey(User)[详细]
2023-02-20 11:35 分类:问答Django-ORM Left join with all columns of both tables
i have two tables A and B, i need all the columns of both tables using django ORM(left join). 开发者_StackOverflow社区[详细]
2023-02-19 21:16 分类:问答Django N+1 query solution
I visited http://guides.rubyonrails.org/active_record_querying.html after talking with a peer regarding N+1 and the serious performance implications of bad DB queries.[详细]
2023-02-19 06:56 分类:问答depth relation search
I am looking for a \"pythonic\" / \"orm-ic\" solution for this problem... Model Soldier has a ManyToManyField to itself.[详细]
2023-02-18 17:19 分类:问答