1👍
✅
You don’t have a field named user
in your form. Try changing the relevant line to:
bd = BloodData (respondent=cd['respondent'],
in your “storeBloodData” view.
1👍
The problem seems to be in your view storeBloodData,at this point.
bd = BloodData (respondent=cd['user'],
The form has no field named ‘user’.You may replace it with a relevant field present declared in the form.
Also, it is better to use DICT.get(key)
when you are not sure if the dict contains that particular key or not. This way you’ll simply be returned None when the key is absent and you’ll be able to dodge KeyError.
- [Django]-How wrap a FormWizard in a View?
- [Django]-Storing multiple values into a single field in mysql database that preserve order in Django
Source:stackexchange.com