<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Django Forms, I&#8217;m Dumping You</title>
	<link>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/</link>
	<description>leahculver.com</description>
	<pubDate>Fri, 21 Nov 2008 23:56:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: sandro</title>
		<link>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-424</link>
		<dc:creator>sandro</dc:creator>
		<pubDate>Fri, 27 Apr 2007 02:13:41 +0000</pubDate>
		<guid>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-424</guid>
		<description>Yes, unobtrusive javascript / dom scripting 4tw!</description>
		<content:encoded><![CDATA[<p>Yes, unobtrusive javascript / dom scripting 4tw!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: leah.culver</title>
		<link>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-423</link>
		<dc:creator>leah.culver</dc:creator>
		<pubDate>Thu, 26 Apr 2007 18:36:43 +0000</pubDate>
		<guid>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-423</guid>
		<description>sandro and richard - those attributes are stipped of code, so you can't set script attributes that way. Another option is to set the listeners on the HTML objects using javascript after the HTML objects are created.</description>
		<content:encoded><![CDATA[<p>sandro and richard - those attributes are stipped of code, so you can&#8217;t set script attributes that way. Another option is to set the listeners on the HTML objects using javascript after the HTML objects are created.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sandro</title>
		<link>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-422</link>
		<dc:creator>sandro</dc:creator>
		<pubDate>Thu, 26 Apr 2007 03:17:08 +0000</pubDate>
		<guid>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-422</guid>
		<description>Richard, great find indeed, looks like an excellent way to add attributes to form elements.

Leah, I hate to be such a standards nerd but onclick definitely isn't raw XHTML, let's get some unobtrusive javascript in there before XHTML gets jealous!</description>
		<content:encoded><![CDATA[<p>Richard, great find indeed, looks like an excellent way to add attributes to form elements.</p>
<p>Leah, I hate to be such a standards nerd but onclick definitely isn&#8217;t raw XHTML, let&#8217;s get some unobtrusive javascript in there before XHTML gets jealous!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam Purtill</title>
		<link>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-419</link>
		<dc:creator>Sam Purtill</dc:creator>
		<pubDate>Tue, 24 Apr 2007 06:05:57 +0000</pubDate>
		<guid>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-419</guid>
		<description>Hahahaha... I think I'm going to go you're route too with ClassOwl, I need a lot more granular control over my forms.</description>
		<content:encoded><![CDATA[<p>Hahahaha&#8230; I think I&#8217;m going to go you&#8217;re route too with ClassOwl, I need a lot more granular control over my forms.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Kiss</title>
		<link>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-418</link>
		<dc:creator>Richard Kiss</dc:creator>
		<pubDate>Tue, 24 Apr 2007 05:32:59 +0000</pubDate>
		<guid>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-418</guid>
		<description>My last post has HTML that the comment poster seems to have automatically stripped out, so you'll have to try this on the command-line yourself to see what output is produced. I assure you that it's pretty cool.

Here it is with some "" characters replaced with { and }.

&#62;&#62;&#62; import django.newforms as forms
&#62;&#62;&#62; class cf(forms.Form):
...     name = forms.CharField(widget=forms.TextInput(attrs={"foo":"bar"}))
...
&#62;&#62;&#62; f = cf()
&#62;&#62;&#62; print f
{tr}{th}{label for="id_name"}Name:{/label}{/th}{td}{input foo="bar" type="text" name="name" id="id_name" /}{/td}{/tr}
&#62;&#62;&#62;

How silly-looking. But you see what I'm getting at. Set attrs={"onclick":"a whole bunch of javascript"} and go to town.</description>
		<content:encoded><![CDATA[<p>My last post has HTML that the comment poster seems to have automatically stripped out, so you&#8217;ll have to try this on the command-line yourself to see what output is produced. I assure you that it&#8217;s pretty cool.</p>
<p>Here it is with some &#8220;&#8221; characters replaced with { and }.</p>
<p>&gt;&gt;&gt; import django.newforms as forms<br />
&gt;&gt;&gt; class cf(forms.Form):<br />
&#8230;     name = forms.CharField(widget=forms.TextInput(attrs={&#8221;foo&#8221;:&#8221;bar&#8221;}))<br />
&#8230;<br />
&gt;&gt;&gt; f = cf()<br />
&gt;&gt;&gt; print f<br />
{tr}{th}{label for=&#8221;id_name&#8221;}Name:{/label}{/th}{td}{input foo=&#8221;bar&#8221; type=&#8221;text&#8221; name=&#8221;name&#8221; id=&#8221;id_name&#8221; /}{/td}{/tr}<br />
&gt;&gt;&gt;</p>
<p>How silly-looking. But you see what I&#8217;m getting at. Set attrs={&#8221;onclick&#8221;:&#8221;a whole bunch of javascript&#8221;} and go to town.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard Kiss</title>
		<link>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-417</link>
		<dc:creator>Richard Kiss</dc:creator>
		<pubDate>Tue, 24 Apr 2007 05:27:27 +0000</pubDate>
		<guid>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-417</guid>
		<description>I haven't tried this, but it seems that form fields can override the widgets associated with them... and you can add attributes when creating the widgets.

OK, I just tried it. Take a look:

&#62;&#62;&#62; import django.newforms as forms
&#62;&#62;&#62; class cf(forms.Form):
...     name = forms.CharField(widget=forms.TextInput(attrs={"foo":"bar"}))
...
&#62;&#62;&#62; f = cf()
&#62;&#62;&#62; print f
Name:
&#62;&#62;&#62;

Note the extra foo="bar" attribute. Neat, eh?</description>
		<content:encoded><![CDATA[<p>I haven&#8217;t tried this, but it seems that form fields can override the widgets associated with them&#8230; and you can add attributes when creating the widgets.</p>
<p>OK, I just tried it. Take a look:</p>
<p>&gt;&gt;&gt; import django.newforms as forms<br />
&gt;&gt;&gt; class cf(forms.Form):<br />
&#8230;     name = forms.CharField(widget=forms.TextInput(attrs={&#8221;foo&#8221;:&#8221;bar&#8221;}))<br />
&#8230;<br />
&gt;&gt;&gt; f = cf()<br />
&gt;&gt;&gt; print f<br />
Name:<br />
&gt;&gt;&gt;</p>
<p>Note the extra foo=&#8221;bar&#8221; attribute. Neat, eh?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Convictus</title>
		<link>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-416</link>
		<dc:creator>Convictus</dc:creator>
		<pubDate>Mon, 23 Apr 2007 23:36:49 +0000</pubDate>
		<guid>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-416</guid>
		<description>ouch!

It is funny that your kiss off, was over the head of more than half the world.  I had to search to find what Django Forms even where.</description>
		<content:encoded><![CDATA[<p>ouch!</p>
<p>It is funny that your kiss off, was over the head of more than half the world.  I had to search to find what Django Forms even where.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Drackett</title>
		<link>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-415</link>
		<dc:creator>Chris Drackett</dc:creator>
		<pubDate>Mon, 23 Apr 2007 22:01:30 +0000</pubDate>
		<guid>http://leahculver.com/2007/04/23/django-forms-im-dumping-you/#comment-415</guid>
		<description>Wait, you were dating Django Forms too!?! That two-timing... Now I know leaving them was a good idea.</description>
		<content:encoded><![CDATA[<p>Wait, you were dating Django Forms too!?! That two-timing&#8230; Now I know leaving them was a good idea.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
