Hi Ronny, terima kasih... :-)

I am trying to generate different output for css styling purpose.

For example for select widget I need to generate
<p> <label> <input>

and for other controls, I need to generate
<p class="something"> <input> <label>

I don't know how field.as_widget would help.

Leon Yeh
New Avenue Systems Inc.
Office: (626)254-1757 x880
[EMAIL PROTECTED]
Imagination Delivered. www.newavenue.net




Ronny Haryanto wrote:
> On Tue, Oct 7, 2008 at 7:09 AM, Leon Yeh | New Avenue.net
> <[EMAIL PROTECTED]> wrote:
>> I need to generate a different output based if it is a select input type
>> or it is a text field.
>>
>> This code does not work. I am trying to do something like this:
>>
>> {% for field in form %}
>> {% ifequal field.field.widget django.forms.widgets.Select  %}
>>   <p>{{ field.label_tag }} {{ field.errors }} {{ field }}</p>
>> {% else %}
>>   <p>It is not select field</p>
>> {% endifequal %}
>> {% endfor %}
>>
>>
>> I am having hard time to do the ifequal statement. It does not get the
>> correct comparison. It always return true. Any idea how to fix this ?
> 
> Leon,
> 
> Any reason why {{ field.as_widget }} wouldn't work in your case?
> 
> Ronny
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
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