django - TypeError when saving a formset -
I have declared a format like this:
class BaseFeatureFormSet (BaseFormSet): Def save (self, committed = true): feature = feature (name = self.cleaned_data ['name'], type = self.cleaned_data ['type'], premium = self.cleaned_data ['premium'],) feature. Save () Return Feature FeaturesFormats = Formats_Fattery (EditFeatureForm, formset = BaseFeatureFormSet, Extra = 0)
So when I am saving the format, I'm getting a TypeError: List Index Must be integer, no < Str
Save ()
is referring to the first row of the function. How do I fix this error?
Update 1 I'm not getting another type of error that was managed to solve this biscuit: Error 'EditFeatureFormFormSet' from the next line in the Object Code section, / Code> is not repetitive:
for convenience in convenience: feature.save () feature = vehicle. Features.Ed (Feature)
to facilitate features:
Thoughts?
This is because formset is a list of forms that are displayed and the values of the form It is a simple concept to understand, when you normally feel that the formatsat & lt; -> [form, form, form, ..] cleaned_data In this example, there is a list of form values You will have to do it again and inside you will find the necessary data for yourself:
For self values Scanned_data: feature = feature (name = value ['name'], ..
Comments
Post a Comment