Friday, August 30, 2013

Re: list(form) makes my form not safe anymore

In my view i do this form, and it only works when i use list



<form action="/profielen/create/" method="post">{% csrf_token %}
{{ form.media }}

<!-- first -->
<div id="tabeltop">Kies een profielnaam</div>
<div id="tabel">
<table cellpadding="0" cellspacing="0">

{% for field in form|slice:":1" %}
<tr>
    <td>{{ field.label_tag }}</td>
    <td>{{ field }}</td>
<td>{% if field.errors %}{{ field.errors }}{% endif %}</td>
</tr>
{% endfor %}

</table>
</div>


<br>



<!-- second -->
<div id="tabeltop">Profielgegevens</div>
<div id="tabel">
<table cellpadding="0" cellspacing="0">

{% for field in form|slice:"1:8" %}
<tr>
    <td>{{ field.label_tag }}</td>
    <td>{{ field }}</td>
</tr>
{% endfor %}

</table>
</div>


<br>


<!-- third -->
<div id="tabeltop">Persoonsgegevens</div>
<div id="tabel">
<table cellpadding="0" cellspacing="0">

{% for field in form|slice:"8:18" %}
<tr>
    <td>{{ field.label_tag }}</td>
    <td>{{ field }}</td>
</tr>
{% endfor %}

</table>
</div>



<br>




<!-- third -->
<div id="tabeltop">Burgelijkestaat</div>
<div id="tabel">
<table cellpadding="0" cellspacing="0">

{% for field in form|slice:"18:19" %}
<tr>
    <td>{{ field.label_tag }}</td>
    <td>{{ field }}</td>
</tr>
{% endfor %}

</table>
</div>



<br>




<!-- third -->
<div id="tabeltop">Opleidingsniveau</div>
<div id="tabel">
<table cellpadding="0" cellspacing="0">

{% for field in form|slice:"19:20" %}
<tr>
    <td>{{ field.label_tag }}</td>
    <td>{{ field }}</td>
</tr>
{% endfor %}

</table>
</div>



<br>




<!-- third -->
<div id="tabeltop">Levensstijl</div>
<div id="tabel">
<table cellpadding="0" cellspacing="0">

{% for field in form|slice:"20:21" %}
<tr>
    <td>{{ field.label_tag }}</td>
    <td>{{ field }}</td>
</tr>
{% endfor %}

</table>
</div>



<br>




<!-- third -->
<div id="tabeltop">Uiterlijkekenmerken</div>
<div id="tabel">
<table cellpadding="0" cellspacing="0">

{% for field in form|slice:"21:22" %}
<tr>
    <td>{{ field.label_tag }}</td>
    <td>{{ field }}</td>
</tr>
{% endfor %}

</table>
</div>



<br>




<!-- third -->
<div id="tabeltop">Belangstellingvoor</div>
<div id="tabel">
<table cellpadding="0" cellspacing="0">

{% for field in form|slice:"22:23" %}
<tr>
    <td>{{ field.label_tag }}</td>
    <td>{{ field }}</td>
</tr>
{% endfor %}

</table>
</div>



<br>




<!-- third -->
<div id="tabeltop">Sexvoorkeuren</div>
<div id="tabel">
<table cellpadding="0" cellspacing="0">

{% for field in form|slice:"23:24" %}
<tr>
    <td>{{ field.label_tag }}</td>
    <td>{{ field }}</td>
</tr>
{% endfor %}

</table>
</div>




<input type="submit" name="submit" value="Update">
</form>

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment