i have a form that is like:
class tesoffcliForm(forms.Form)
        image = forms.FileField(label='Image', required = False)
        art_gen = forms.CharField(label='test ', required = False ,widget = 
forms.Textarea())  

the view is:

def testrendering(request):
    form = tesoffcliForm()
    number = range(100)
    return render(request, 'polls/test.html', {'form':form, 
    'range':number,  })

the template is:

{% for a in range %} 
        {% for field in form %}
            {{ field.label }} {{ field }}
            
            {% if forloop.counter|divisibleby:"2" %}
                <br><br>
            {% endif %}
        {% endfor %}

the view for get the data is very easy:

def get_data(request):

    art = request.POST.getlist('art_gen')
    image = request.FILES.getlist('image')

the list generated are:
art = a list of 100 lines, where if i have no imput in the list i find  '  '
image = a list with only the file that i have decide to upload.

how can i have also an empty folder in the image list??? for example
image = [file obg, ' ' , file obj 2, etc....]
if i can't do this i have no corrispondance between art and image when i 
save in the database

Thanks for your help

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1f83f275-ab62-4b94-b314-81eda7ac2580n%40googlegroups.com.

Reply via email to