Nobody could answer me? Maybe I haven't ask well?

On 24 fév, 21:05, leoz01 <leozleo...@gmail.com> wrote:
> Hello,
>
> i have a simple question, how can i get the id attribute (which
> correspond to html id) from a form's field ?
>
> example :
> class MyModel(...):
>    test = CharField(...)
>
> class MyForm(ModelForm):
>    class Meta:
>       model = MyModel
>
> I search for something like :
>  f=MyForm()
>  f.fields['test'].id => which will correspond to the html id
>
> When i use my form i know there is an auto_id attribute for each field
> which gives me the html correspondent id but if i set the auto_id to
> False (f = MyForm(auto_id=False)) on what can i rely ?
>
> I need that to have the id attribute in a custom widget.
>
> Can anyone help me ?
>
> Thanks

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

Reply via email to