cleaned-data Questions

4

Solved

I have a Django ModelForm which exposes a multiple choice field corresponding to a many-to-many relation through a model which holds order of selection (a list of documents) as an extra attribute. ...
Cahoot asked 24/4, 2012 at 10:43

2

Solved

Django says if form.is_valid() is True. form.cleaned_data is where all validated fields are stored. But I am confused about using the cleaned_data function. form.cleaned_data['f1'] -- cleaned data...
Warnock asked 3/12, 2018 at 13:20

3

I was confused to why when I run this code it returns an error create() takes 1 positional argument but 2 were given if request.method == "POST": my_form = RawProductCreateForm(request.POST) ...
Clean asked 10/9, 2019 at 5:58

1

Solved

I have a form field called 'units' like this: units = forms.ChoiceField(choices=[(x, x) for x in range(1, 11)], help_text = 'Units: ') When I do form.cleaned_data['units'] I get a String instea...
Recurrent asked 1/12, 2017 at 19:17

7

When I have a valid Django form, I can access the data with form.cleaned_data. But how do I get at the data a user entered when the form is not valid i.e., form.is_valid is false. I'm trying to ac...
Ruin asked 9/4, 2009 at 19:16

1

Solved

I have a main form that has an inline-form. Is it possible to access the main form's cleaned_data from the inline-form's clean function? Here is why I am asking. The main form has a field to defi...
Hippodrome asked 16/4, 2012 at 23:25

1

Solved

In one of my forms, I am processing the form data and save it in a session variable. So when I run if locationForm.is_valid(): I execute request.session['streetNumber'] = locationForm.cleaned_...
Cynth asked 10/12, 2011 at 2:43
1

© 2022 - 2024 — McMap. All rights reserved.