django-models
Django foreign keys - one class has the same relationship to multiple other classes
I have a model with three classes: PendingAuthorisation, Director, and Member. Director and Member instances are considered inactive if they have a corresponding PendingAuthorisation.[详细]
2023-04-07 06:02 分类:问答Django: Custom Model Manager queries in abstract classes
I am working on a django project in which I create a set of three abstract models that I will use for a variety of apps later on all of which will contain this hierarchy of three models. E.g.:[详细]
2023-04-07 04:43 分类:问答Django partial update
I have two threads, one which runs s开发者_JS百科omething like update t set ColA=foo and the other runs update t set ColB=foo. If they were doing raw SQL statements there would be no contention, but s[详细]
2023-04-07 04:18 分类:问答Manipulate the form field values before rendering in django admin
I have to actually reset the values of the fields of a model Form, every time the form is rendered. So, lets say everytime a user fills the form, I store the values to a different table and next time[详细]
2023-04-07 02:13 分类:问答Change the default name of relationship in django admin
I have a ManyToMany relationship follow as: class Subtopic(models.Model): id = models.PositiveIntegerField(primary_key=True)[详细]
2023-04-07 01:50 分类:问答Best practices for dependent fields in a django model
For database indexing purposes, the email field on a model needs to be stored in reverse.I end up needing access to both the reversed and forward version of the email field.I\'m curious as to which of[详细]
2023-04-07 00:53 分类:问答django's DateField model field and acceptable values
I\'m having a bit of trouble with django\'s DateField model field.Shouldn\'t it be able to accept fiveDaysLater as a valid date object?When I try to add fiveDaysLater into the database, I get an error[详细]
2023-04-06 22:09 分类:问答Django - how to create a file and save it to a model's FileField?
Here\'s my model.What I want to do is generate a new file and overwrite the existing one whenever a model instance is saved:[详细]
2023-04-06 21:55 分类:问答How do I serialize an ImageField in Django?
I\'m trying to serialize one of my modelswhich has an ImageField. The inbuilt serializer can\'t seem to serialize this and therefore I thought of writing a custom serializer. Could you tell me how I c[详细]
2023-04-06 21:23 分类:问答How to add attribute '_meta' to an object?
I\'m trying to add the django-voting app to my project. I do开发者_如何学运维n\'t know how to use it in my templates, so I\'m adding a new template tags for voting up or down when an user click in but[详细]
2023-04-06 20:19 分类:问答