django-forms
How to remove inputs/fields created by a form in Django
I have a simple form for uploading a profile picture and then a thumbnail image showing what has been uploaded. The HTML code is:[详细]
2023-03-29 07:04 分类:问答Setting initial value of modelForm instance
Why can\'t I set instance = None in my unbound model form? def sample(request): prf_form = Profil开发者_如何学运维eForm(instance=None)[详细]
2023-03-29 06:56 分类:问答Django modelform remove "required" attribute based on other field choice
I have ModelForm with several fields. Some of fields are required, some not. Also I have Select field with different choices, and I want to make some of fields \"required\" or not based on this Select[详细]
2023-03-29 04:53 分类:问答Is save_m2m() required in the Django forms save() method when commit=False?
The docs seem pretty firm that this is indeed the case.... https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-save-method[详细]
2023-03-28 18:06 分类:问答Django ModelForm fields - must have more than one?
I have a model which has upwards of 25 fields. I want to create a form to edit only ONE of those fields. Thus I did this:[详细]
2023-03-28 14:34 分类:问答Django exception: Caught AttributeError while rendering: 'Order' object has no attribute 'get'
Apologies for the noob question. Also, seems like similar questions have been asked here already, however the answers are about initiating a form with request.POST, which isn\'t relevant to what I\'ve[详细]
2023-03-28 13:58 分类:问答How do I Display Intermediary Fields for M2M Models in admin interface?
I have following model.py file in which Charges model have M2M field farms with an intermediate model Membership.[详细]
2023-03-28 12:54 分类:问答django - model form with 'helper select'
I\'m looking for best solution for this issue: I\'have a Model like this: class annotation(models.Model):[详细]
2023-03-28 10:41 分类:问答Combining querysets on a choice field in django
I have the following form: class FeaturedVideoForm(ModelForm): featured_video = forms.ModelChoiceField(Video.objects.none()[详细]
2023-03-28 03:39 分类:问答Django prepopulated_fields like method
Please forgive my naiveté with Django. I want to create my own method which works much like prepopulated_fields for my custom admin page.Basically, when you put the url of an image in one field, I\'[详细]
2023-03-28 03:36 分类:问答