modelform
Django ModelForm validation and error messages
Sorry if this is a basic question: I am having trouble doing form validation with ModelForms in Django.[详细]
2023-02-21 17:29 分类:问答How to add a new instance of Django model with FileField by ModelForm?
I\'m a Django beginner. I think my problem is trivial but I can\'t solve it. I have a model named Document with one FileField:[详细]
2023-02-18 01:13 分类:问答Django ModelForm: How to override or check for "save_as"
I need to add som开发者_运维知识库e customizations for the case that a instance in Django Admin is \"saved_as\" a copy. Can I do that in save(), if so how do I check for the save_as kwarg?[详细]
2023-02-15 18:08 分类:问答field choices() as queryset?
I need to make a form, which have 1 select and 1 text input. Select must be taken from database. model looks like this:[详细]
2023-02-13 08:15 分类:问答Django: saving multiple modelforms simultaneously (complex case)
Well, it may actually be a simple case but I\'m having a tough time figuring it out. I have two user registration funnels (corporate & everyone else).When a corporate user creates a User instance[详细]
2023-02-11 07:08 分类:问答django ModelForm save() method issue
I have a model form: class SnippetForm(ModelForm): class Meta: model = Snippet exclude = [\'author\', \'slug\'][详细]
2023-02-05 21:49 分类:问答Problem with validating ModelForm
I use ModelForm to create my form. All works fine except 1 thing - validating the unique field. Code: class Article(models.Model):[详细]
2023-02-02 11:37 分类:问答How to override save() method of modelform class and added missing information?
I just started to learn Django and I had a question. I\'m trying to automatically add the missing information, when saving form data. I get to change/add the desired \"cleaned_data\" information by o[详细]
2023-02-01 00:43 分类:问答Localization of Django application only applies to forms.py and not to models.py
I have a problem when trying to localize my application. It is available in two languages: english and german. The problem appears when the browser has the language set english(United States) and in m[详细]
2023-01-19 06:58 分类:问答Django using a newly create object in reverse redirect
I am trying to pull the id from the newly created project object so I can redirect the user to the page containing the new project. Right now I get \"\'ProjectAddForm\' object has no attribute \'id\'\[详细]
2023-01-18 13:41 分类:问答