django-orm
Django self-referencing nested QuerySets
How can I represent this simple SQL using Django ORM? SELECT * FROM alerts a1 WHERE timestamp = ( SELECT MAX(tim开发者_开发技巧estamp) FROM alerts a2[详细]
2023-02-18 16:34 分类:问答Django multiple databases - can't connect to mysql server fallback to sqlite
I have a django appli开发者_开发问答caiton with multiple databases.The default database is on the local machine.There is also a remote mysql database which is used for some write operations, but it is[详细]
2023-02-18 14:40 分类:问答Django: find all OneToOneFields pointing to a Model
I\'m writing routines to inspect an instance and find all its relations (e.g. using instance._meta.get_all_related_objects()) but I can\'t find a way to get relations involving a OneToOneFie开发者_如何[详细]
2023-02-17 18:01 分类:问答Django: updating a field with a progressive number within an ordered queryset
Using Django 1.2.3, I need to u开发者_运维知识库pdate a model field with a ranking among an ordered set of instances, without having to retrieve the entire queryset and update each model by hand.[详细]
2023-02-15 10:46 分类:问答django manytomany and the modelform
I am really new to django, and I have some questions about how django\'s M2M works and also how it works with the modelForm or the forms.Form am currently working on an application that contains the f[详细]
2023-02-10 17:57 分类:问答Aggregate data using the ORM
Django/Python noob here! Here are my models: class Match(models.Model): date = models.DateTimeField() court = models.ForeignKey(Court)[详细]
2023-02-10 08:28 分类:问答Django stacked inline admin question
Using Django 1.2 I have a stacked inline admin with a many to many field on it. I need to limit the choices in the many to many based on the parent object that the inline exists for. For example, I ha[详细]
2023-02-09 19:33 分类:问答Django Blob Model Field
How do you store a \"blob\" of binary data using Django\'s ORM, with a PostgreSQL backend? Yes, I know Django frowns upon that sort of thing, and yes, I know they prefer you use the ImageField or File[详细]
2023-02-09 11:11 分类:问答In Django, how do you make a model refer to itself?
Assume we have class Employee. I want to have a fie开发者_运维问答ld which references a different instance of the same class.[详细]
2023-02-09 00:33 分类:问答Django: Display a model and a count of how often another model uses it
I am creating a TODO list that categorizes tasks by their status.IE: Waiting, Today, Tomorrow, Scheduled.My models look something like:[详细]
2023-02-08 17:42 分类:问答