django-queryset
django - multiple queries into one
I want to find the Records with a certain tag within 100 mile radius. I have two queries that work independently (see below) but I don\'t know how to put them together.[详细]
2023-04-08 20:03 分类:问答Django: can I add a list of new model instances to the database via a single method call?
If I am creating a list of new m开发者_开发百科odel objects based on some form input, e.g., new_items = [][详细]
2023-04-06 16:16 分类:问答How to obtain a QuerySet of all rows, with specific fields for each one of them?
I have a model Employees and I would like to have a QuerySet of all rows, but with some specific fields from each row, and not all fields.[详细]
2023-04-06 06:23 分类:问答extract or return only the model instance of a foreign key or one to one field from a queryset in django
Does anyone know if it\'s possible to extract only the model instances of a foreign key or one to one field from a queryset in Django?[详细]
2023-04-05 04:03 分类:问答Django query parameters not returning None
I have a few lines of code in my view that get a query param and then filter based on that parameter.[详细]
2023-04-04 21:03 分类:问答Django query to get all ads whose keyword sets are contained by a search string
I am trying to implement an advertising system in Django.My model for ads is as follows: class Ad(models.Model):[详细]
2023-04-04 10:30 分类:问答Returning a custom model instance from a manager
I have a model that looks like this and stores data as key-value pairs. class Setting(models.Model): company = models.ForeignKey([详细]
2023-04-04 06:40 分类:问答Django: __in query lookup doesn't maintain the order in queryset
I have ID\'s in a specific order >>> album_ids = [2开发者_如何转开发4, 15, 25, 19, 11, 26, 27, 28][详细]
2023-04-04 06:11 分类:问答Using get_or_create in a view
I am importing users from LDAP into MySQL and I want to get/create profiles as such: profile_obj, created_profile = UserProfile.objects.get_or_create(user=user_obj)[详细]
2023-04-03 16:02 分类:问答Filter through a related model django
How can 开发者_高级运维I generate a query_set through a related model? For example, how can I do this:[详细]
2023-04-03 02:53 分类:问答