Set attributes to input using newforms

1 view
Skip to first unread message

Henhiskan

unread,
Nov 1, 2007, 3:08:50 PM11/1/07
to Django users
Hi fellows,
Am using django-0.96 and I need to set an input html attribute from a
newforms
I need to use a time picker from dojo, for that I need to have
something like this:
<input name="time" id="id_time" type="text"
dojoType="dropdowntimepicker">

The only solution I can think of is to process the form.as_table()
string and put the snip of code that I need, just before to sent to
the browser.

By the way, where I can find some documentation of widgets for django
0.96?

thanks.

Henhiskan

unread,
Nov 1, 2007, 3:18:08 PM11/1/07
to Django users
There is no widget docs for v0.96 documentation, but I just read the
doc of current dojo version, and find the solution to my problem,
just:

discovered_time =
forms.TimeField(widget=forms.TextInput(attrs={'dojoType':'dropdowntimepicker'}))

Cheers.-

Malcolm Tredinnick

unread,
Nov 1, 2007, 8:22:17 PM11/1/07
to django...@googlegroups.com

Read the current documentation and just note any places where it says
"New in Django development version" -- they won't be available in 0.96.
The reason we add that note is so that the documentation at
www.djangoproject.com/documentation/ is relevant to all versions (well,
mostly the last released version + subversion). On rare occasions,
you'll need to specifically click through to the 0.96 docs, but we try
to keep the current stuff relevant to the last release so that everybody
can benefit from the updates.

Regards,
Malcolm

--
Despite the cost of living, have you noticed how popular it remains?
http://www.pointy-stick.com/blog/

Reply all
Reply to author
Forward
0 new messages