The slice filter only works on lists and apparently form is not a list,
probably a dictionary (that's why you can use form.last_name, for exmaple).

May be you find useful the hidden_fields() and visible_fields() functions
described here:

http://docs.djangoproject.com/en/1.2/topics/forms/#looping-over-hidden-and-visible-fields

Good luck,
Santiago.

On Mon, Jul 5, 2010 at 4:07 PM, Chris Seberino <[email protected]> wrote:

> How interate over just a slice of form fields in template?
>
> I tried {% for e in form|slice:":5" %} but it appears the slice part
> is just ignored.
>
> cs
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to