this_category = Category.objects.get(name=cat_name) gives error: get() takes exactly 2 non-keyword arguments (1 given)
I need order a Queryset by date in desc order, but i need put in the end the objects at the end, I do this:
Is there a simple way to discard/remove the last result in a queryset without affecting the db? I am trying to paginate results in Django, but don\'t know the total number of objects for a given quer
In Django 1.1 I was able to produce the SQL used by a QuerySet with this notation: QuerySet.query.as_sql()
I need to amend QuerySet data when i return it to a template. for example, model.objects.all() returns a date (with other fie开发者_开发问答lds), but i also want to return the number of days since th
How do I run an update and select statements on the same queryset rather than having to do two queries:
I 开发者_高级运维have a list of names that I want to match case insensitive, is there a way to do it without using a loop like below?
I\'m using the extra() modifier in a view. (See http://docs.djangoproject.com/en/1.1/ref/models/querysets/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none )
I have model with a Foreign Key to itself like this: class Concept(models.Model): name = models.Char开发者_如何学CField(max_length=200)
This question is connected to my other question but I changed the logic a bit. I have models like this: