1π
ok,
i just wanna complete the topic
so if anyone has the same problem, he/she can use this page to solve it
main keys to this solution are:
1- never forget the encryption type
2- use separate forms for different functionality
so in the template i should use:
<form method="POST" action="." encrypt="multipart/form-data">
and use two separate forms for add and delete files
like this:
this one for adding files:
<form method="POST" action="." encrypt="multipart/form-data" id="add_file">
and this one for deleting files:
<form method="POST" action="." encrypt="multipart/form-data" id="delete_file">
1π
I ran into the same error message when I forgot to append the parenthesis () after is_valid
. Formset.is_valid
returned True
, but there was no cleaned data simply because the is_valid()
function was not called to return the cleaned data.
- [Answered ]-Strip default CSS from Django CMS
- [Answered ]-Django 1.8 using one view in another
- [Answered ]-Django + mod_wsgi + apache2: ImportError: No module named <project>
- [Answered ]-Django Really Simple Aggregation (or Group By)
0π
I think you need to change the following line;
... snip ...
for form in formset.forms:
form_data = form.cleaned_data
... snip ...
You appear to be missing the .forms
part from the formset.
- [Answered ]-Django move table to other app using db_table and don't delete original table
- [Answered ]-Apply Decorator in Class Based View Django according to object value
- [Answered ]-Django: get top tags?
0π
ok
i found out after using some break points, that itβs actually requestβs fault, request.FILES is empty
0π
tnx for all of your answers, iβv solved the problem,
i had one form with two functionality: add_file and del_file
after i separated them, every thing was ok
but there is a problem in the looking of the page
after i add some files, like 3 file and then request.POST sent and i return to the page again
i actually see three row of file input, instead of one
it really reduce the beauty
any advice?
- [Answered ]-Django Celery installation Error
- [Answered ]-Django Rest Framework custom user model PUT Request
- [Answered ]-Django edit static content on live site