Hello Django users,

I have  a quick question about new Forms in Django 0.96. I am finding
that the line between my front-end and the middleware is starting to
blur due to the new forms library. I have managed to add  css to form
field widgets dynamically through the use of template filters which,
in my optinion ,does not violate the model-view-controller
architecture. However, things become a bit more difficult when I want
a form.CharField object to be rendered dynamically as a <input type
="password"> element. It seems that the only provided place to
accomplish this is in the Field's declaration itself:

 password = forms.CharField(label ='Password',
                               required = True,
                               max_length =20,
                               widget =widgets.PasswordInput())

Does anyone have an alternative method for dynamically specifying the
widget of a Form.Field? I do realize this could be done in a similar
fashion to the CSS, but I believe specifying a Django object as a
parameter to a template filter would then violate my front-end.

Kind regards,


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