django-queryset
Creating modelform fields for each object in a queryset
This question is similar to this: field choices() as queryset? For example if I have a really simple model:[详细]
2023-04-13 07:58 分类:问答Django query for many-to-one relation with no instances of the foreign-key relationship
I have a many-to-one relationship between submissions and assignments (a student may have multiple submissions for a single assignment).I would like to create a query that shows the assignments with n[详细]
2023-04-13 06:31 分类:问答Django: get ValueQuerySet with values from generic relation
I have two models linked by a generic relation: from django.contrib.contenttypes import generic from django.db import models[详细]
2023-04-13 03:43 分类:问答Django: one-to-many queries
I got a lot of one-to-many relationships in my database structure. For example, you have a user, the user has many degrees, he has many emails, he has many contracts, etc.[详细]
2023-04-12 03:22 分类:问答Django search query for models with tags
I have models as below and I would like to select IndexedLibrary objects depending on its book name and the tag names of that book.[详细]
2023-04-11 18:00 分类:问答Get questions and overall results from two model classes
class InspectionQuestion(models.Model): item = models.ForeignKey(InspectionItem) question = models.CharField(max_length=200)[详细]
2023-04-10 22:58 分类:问答Django queryset excluding many to many objects
Let\'s assume we have a model: class a(models.Model): users = models.ManyToManyField(User) # django.contrib.auth.models.User[详细]
2023-04-10 12:46 分类:问答Loop through two querysets while highlighting differences in django
I have a model class defined as below: class Vehicle(models.Model): stock_number = models.CharField(max_length=6)[详细]
2023-04-10 06:05 分类:问答How do I retrieve Haystack SearchQuery parameters
I am looking for a way to serialize a Haystack search query (not the query results) so that I can reconstruct it later.Is there a way to do this without having to intercept the parameters from off of[详细]
2023-04-10 04:01 分类:问答Django: get unique object list from QuerySet
I have the following (simplified) models in my Django app: class Color(models.Model): name = models.CharField(max_length=10)[详细]
2023-04-08 22:33 分类:问答