My requirement here is to enable user to add description and remark against multiple files uploaded earlier.I am using formset to display a set of partial field data of a model 'medical_doc'. I am new to django and am not able to implement it properly.
form.pyclass Files_uploadedForm(forms.Form) doc_name=forms.CharField(max_length=100) doc_type=forms.CharField(max_length=5) description=forms.CharField(max_length=100) remarks=forms.CharField(max_length=100)Files_uploadedFormSet=formset_factory(Files_uploadedForm)view.pyif request.method='POST' med_qrset=medical_doc.objects.values('doc_name','doc_type','description','remarks') .filter(doc_id=doc_id) formset=Files_uploadedFormSet(queryset=med_qrset)context = {'formset'=formset}return render(request,"upload_doc.html")upload_doc.html...{% for form in formset %}form.as_p{% endfor %}
Please excuse the syntax errors. My issue here is to know if this method of initialising formset is correct. Because I get a error saying that BaseFormSet.init() got an unexpected keyword argument 'queryset'. Please help.