Top "Django-forms" questions

Specific questions related to forms with the Django web framework

django - what goes into the form action parameter when view requires a parameter?

This is what I have: myview.py with a view that takes a parameter user: def myview(request, user): form = …

django django-templates django-forms django-views
Multiple Models in a single django ModelForm?

Is it possible to have multiple models included in a single ModelForm in django? I am trying to create a …

python django django-forms
Django modelform NOT required field

I have a form like this: class My_Form(ModelForm): class Meta: model = My_Class fields = ('first_name', 'last_name' , …

django django-forms optional django-models
Django templates: verbose version of a choice

I have a model: from django.db import models CHOICES = ( ('s', 'Glorious spam'), ('e', 'Fabulous eggs'), ) class MealOrder(models.Model): …

django django-templates django-forms
Dropdown in Django Model

I want to create a field in Django models.py which will render as a dropdown and user can select …

django django-models django-forms
Django - Overriding the Model.create() method?

The Django docs only list examples for overriding save() and delete(). However, I'd like to define some extra processing for …

django django-models django-forms
AttributeError: module Django.contrib.auth.views has no attribute

In my Django app useraccounts, I created a Sign-Up form and a model for my Sign-up. However, when I went …

python django django-models django-forms attributeerror
Django ModelForm: What is save(commit=False) used for?

Why would I ever use save(commit=False) instead of just creating a form object from the ModelForm subclass and …

django django-models django-forms
Django ModelChoiceField: filtering query set and setting default value as an object

I have a Django Form class defined likes this in Models: class AccountDetailsForm(forms.Form): ... adminuser = forms.ModelChoiceField(queryset=User.…

django django-forms
Custom form validation

I have a pretty simple form: from django import forms class InitialSignupForm(forms.Form): email = forms.EmailField() password = forms.CharField(…

django django-forms django-validation