Re: Generating widget based on class type for a Custom Form

2008-10-08 Thread Leon Yeh
Hi Ronny, Thanks ... that is a great idea! It works like I wanted. Leon Yeh New Avenue Systems Inc. Ronny Haryanto wrote: > On Tue, Oct 7, 2008 at 7:31 PM, Leon Yeh | New Avenue.net > <[EMAIL PROTECTED]> wrote: > >> Hi Ronny, terima kasih... :-) >> > > Sama-sama :-) > > >> I am tr

Re: Generating widget based on class type for a Custom Form

2008-10-07 Thread Ronny Haryanto
On Tue, Oct 7, 2008 at 7:31 PM, Leon Yeh | New Avenue.net <[EMAIL PROTECTED]> wrote: > Hi Ronny, terima kasih... :-) Sama-sama :-) > I am trying to generate different output for css styling purpose. > > For example for select widget I need to generate > > > and for other controls, I need to g

Re: Generating widget based on class type for a Custom Form

2008-10-07 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-10-07, o godz. 14:36, przez Ulises: > >> and for other controls, I need to generate >> > > How about using widget.attrs? > > http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.Widget.attrs AFAIK, this adds attributes to widget output. Using th

Re: Generating widget based on class type for a Custom Form

2008-10-07 Thread Leon Yeh | New Avenue.net
Hi, I also need to switch the and tags, so attrs would not help. For example for select widget I need to generate and for other controls, I need to generate Thanks Leon Yeh Ulises wrote: >> and for other controls, I need to generate >> > > How about using widget.attrs? > > ht

Re: Generating widget based on class type for a Custom Form

2008-10-07 Thread Ulises
> and for other controls, I need to generate > How about using widget.attrs? http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.Widget.attrs Best, U --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: Generating widget based on class type for a Custom Form

2008-10-07 Thread Leon Yeh | New Avenue.net
Hi Ronny, terima kasih... :-) I am trying to generate different output for css styling purpose. For example for select widget I need to generate and for other controls, I need to generate I don't know how field.as_widget would help. Leon Yeh New Avenue Systems Inc. Office: (626)254-1757

Re: Generating widget based on class type for a Custom Form

2008-10-06 Thread Ronny Haryanto
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 fiel

Generating widget based on class type for a Custom Form

2008-10-06 Thread Leon Yeh | New Avenue.net
Hi, 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 %} {{ field.label_tag }} {{ field.errors }}