On Mon, 2007-12-17 at 22:10 -0800, MrJogo wrote: > If I pass a form into my template as a variable, is there a way to > tell what input type a field is in the template? My template creates > pretty boxes for the form fields, but I don't want them around hidden > inputs. I was hoping for something like {% ifequal field.type "hidden" > %} but I can't seem to find an equivalent of field.type.
Each form field that the template sees is a django.newforms.forms.BoundField instance. That class has a "is_hidden" property that does what you want. So test field.is_hidden at the template level. Regards, Malcolm -- Why can't you be a non-conformist like everyone else? http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---