django-queryset
django: How to order the queryset on a field in ManyToManyField (through) related models
I have these models class Region (models.Model): name = models.CharField (max_length = 255, blank = False)[详细]
2023-04-02 20:09 分类:问答Django - How to annotate QuerySet using multiple field values?
I have a model called \"Story\" that has two integer fields called \"views\" and \"votes\". When I retrieve all the Story objects I would like to a开发者_StackOverflow社区nnotate the returned QuerySet[详细]
2023-04-02 08:54 分类:问答Django filter against Multiple Item QuerySets
I have two Model\'s which are related with a ForeignKey field. Let\'s call these objects Event and EventRegistration.[详细]
2023-04-01 23:37 分类:问答django orm, custom method on top of a queryset
lets suppose that some code in my view looks like this: bar = Bar.objects.get(pk=1) foos = bar.foo_set.filter(VERY_LONG_COMPLEX_FILTERING_LOGIC)[详细]
2023-03-31 14:23 分类:问答Returning a randomly ordered set of distinct objects from a ManyToMany relationship
I\'m using Django 1.3 with Postgresql 8.4 and I\'ve got models like the following (irrelevant stuff removed):[详细]
2023-03-31 14:00 分类:问答Querying by related object value
I am setting up a simple billing system, where I have a table that lists users and 开发者_开发技巧the day they are supposed to be billed. Each user only has one row of this table associated with them.[详细]
2023-03-30 12:42 分类:问答Django - Sorting QuerySet of threaded comments
I am using django-threadedcomments, however the question also applies generally to sorting a QuerySet.[详细]
2023-03-30 06:57 分类:问答Django: Saving old QuerySet for future comparison
I\'m new with django and I\'m trying to make a unit test where I want to compare a QuerySet before and after a batch editing function call.[详细]
2023-03-28 18:20 分类:问答Django: What's the fastest way to order a QuerySet based on the count of a related field?
I\'ve got an Item model in my Django app with a ManyToMany field that\'s handled through an intermediate Favorite model. Here are simplified versions of the models in question:[详细]
2023-03-28 10:16 分类:问答Django QuerySet: Why can't I filter an annotated QuerySet?
I\'m trying to retrieve a list of the 100 most popular books in my db, and then create a list of unique categories that are in that list. Here are my simplified Book, Favorite, and Category models:[详细]
2023-03-28 06:40 分类:问答