<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments for Ulises' random assortments</title>
	<atom:link href="http://monogroncho.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://monogroncho.com</link>
	<description>Just a collection of random stuff</description>
	<pubDate>Tue, 09 Mar 2010 23:55:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>Comment on Django gotchas - part 1 by Dynamic select fields with JQuery and django &#171; Formerly Conversal</title>
		<link>http://monogroncho.com/2008/10/django-gotchas-part-1/#comment-14</link>
		<dc:creator>Dynamic select fields with JQuery and django &#171; Formerly Conversal</dc:creator>
		<pubDate>Sun, 01 Nov 2009 17:44:57 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=91#comment-14</guid>
		<description>[...] This blog post and this blog post set me off in the right direction by showing how to use JQuery&#8217;s getJSON function and how to craft custom fields for the lookup. [...]</description>
		<content:encoded><![CDATA[<p>[...] This blog post and this blog post set me off in the right direction by showing how to use JQuery&#8217;s getJSON function and how to craft custom fields for the lookup. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Django gotchas - part 1 by Rok Jaklič</title>
		<link>http://monogroncho.com/2008/10/django-gotchas-part-1/#comment-13</link>
		<dc:creator>Rok Jaklič</dc:creator>
		<pubDate>Wed, 03 Jun 2009 11:49:30 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=91#comment-13</guid>
		<description>Hi.

I have came up to the similar problem and tried to solve it with like this in forms.py:

    def __init__( self, *args, **kwargs ):
        product_categories = None
        if 'product_categories' in kwargs:
            product_categories = kwargs.pop( 'product_categories' ) 
        super( NewProductForm, self ).__init__( *args, **kwargs )
        if product_categories:
            self.fields["product_category"].widget.choices = product_categories

...where product_category is something like:
product_category = forms.ChoiceField( choices = [], required = False, label = _( 'Product category' ), initial =  'r' )

I almost gave up and was thinking of "manually" creating forms , ... and I really do not understand why this "thingy" did not work when I POSTed data, ... but luckily I have found your solution. 

Thank you.</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>I have came up to the similar problem and tried to solve it with like this in forms.py:</p>
<p>    def __init__( self, *args, **kwargs ):<br />
        product_categories = None<br />
        if &#8216;product_categories&#8217; in kwargs:<br />
            product_categories = kwargs.pop( &#8216;product_categories&#8217; )<br />
        super( NewProductForm, self ).__init__( *args, **kwargs )<br />
        if product_categories:<br />
            self.fields["product_category"].widget.choices = product_categories</p>
<p>&#8230;where product_category is something like:<br />
product_category = forms.ChoiceField( choices = [], required = False, label = _( &#8216;Product category&#8217; ), initial =  &#8216;r&#8217; )</p>
<p>I almost gave up and was thinking of &#8220;manually&#8221; creating forms , &#8230; and I really do not understand why this &#8220;thingy&#8221; did not work when I POSTed data, &#8230; but luckily I have found your solution. </p>
<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Django gotchas - part 1 by Old enough to know better &#187; Dynamic select fields with JQuery and django</title>
		<link>http://monogroncho.com/2008/10/django-gotchas-part-1/#comment-12</link>
		<dc:creator>Old enough to know better &#187; Dynamic select fields with JQuery and django</dc:creator>
		<pubDate>Tue, 19 May 2009 13:43:17 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=91#comment-12</guid>
		<description>[...] This blog post and this blog post set me off in the right direction by showing how to use JQuery&#8217;s getJSON function and how to craft custom fields for the lookup. [...]</description>
		<content:encoded><![CDATA[<p>[...] This blog post and this blog post set me off in the right direction by showing how to use JQuery&#8217;s getJSON function and how to craft custom fields for the lookup. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Very simple benchmarking by Ulises</title>
		<link>http://monogroncho.com/2008/11/very-simple-benchmarking/#comment-10</link>
		<dc:creator>Ulises</dc:creator>
		<pubDate>Sun, 07 Dec 2008 19:41:44 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=185#comment-10</guid>
		<description>@Chris I haven't tested GETting a view without the reduce part but will do so. As soon as I do it I will report the numbers here. One thing I did notice was that CouchDB was launching a new couchjs process per request and that seemed a tad excessive. Perhaps is as you comment the fact that I was testing views with the reduce, I don't know really.</description>
		<content:encoded><![CDATA[<p>@Chris I haven&#8217;t tested GETting a view without the reduce part but will do so. As soon as I do it I will report the numbers here. One thing I did notice was that CouchDB was launching a new couchjs process per request and that seemed a tad excessive. Perhaps is as you comment the fact that I was testing views with the reduce, I don&#8217;t know really.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Very simple benchmarking by Chris Anderson</title>
		<link>http://monogroncho.com/2008/11/very-simple-benchmarking/#comment-9</link>
		<dc:creator>Chris Anderson</dc:creator>
		<pubDate>Sun, 07 Dec 2008 16:59:42 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=185#comment-9</guid>
		<description>Good work benchmarking. The first set (doc requests) seems to be about what I was getting, and the reduce view times seem about what I'd expect them to be. I'd be interested to see what the timing is like for view without reduce. Reduce will be slower than Map, because it always uses 1 couchjs process. Map on the other hand should be nearly pure IO.</description>
		<content:encoded><![CDATA[<p>Good work benchmarking. The first set (doc requests) seems to be about what I was getting, and the reduce view times seem about what I&#8217;d expect them to be. I&#8217;d be interested to see what the timing is like for view without reduce. Reduce will be slower than Map, because it always uses 1 couchjs process. Map on the other hand should be nearly pure IO.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Erlang: another step forward by Ulises</title>
		<link>http://monogroncho.com/2008/11/erlang-another-step-forward/#comment-8</link>
		<dc:creator>Ulises</dc:creator>
		<pubDate>Sat, 06 Dec 2008 22:49:18 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=161#comment-8</guid>
		<description>@Paul

Spot on. I'm still new to Erlang so most BIFs are still strangers to me. I probably should've made more emphasis on the 'tangential' point of learning a new language only if it forces you to think and code differently.

Thanks for stopping by though :)

U</description>
		<content:encoded><![CDATA[<p>@Paul</p>
<p>Spot on. I&#8217;m still new to Erlang so most BIFs are still strangers to me. I probably should&#8217;ve made more emphasis on the &#8216;tangential&#8217; point of learning a new language only if it forces you to think and code differently.</p>
<p>Thanks for stopping by though <img src='http://monogroncho.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>U</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Erlang: another step forward by Paul Bonser</title>
		<link>http://monogroncho.com/2008/11/erlang-another-step-forward/#comment-7</link>
		<dc:creator>Paul Bonser</dc:creator>
		<pubDate>Sat, 06 Dec 2008 21:16:11 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=161#comment-7</guid>
		<description>You could also use string:tokens/2 from the standard library:

1&#62; string:tokens("foo bar\nbaz_bazzle", " \n_").
["foo","bar","baz","bazzle"]

http://www.erlang.org/doc/man/string.html#tokens-2</description>
		<content:encoded><![CDATA[<p>You could also use string:tokens/2 from the standard library:</p>
<p>1&gt; string:tokens(&#8221;foo bar\nbaz_bazzle&#8221;, &#8221; \n_&#8221;).<br />
["foo","bar","baz","bazzle"]</p>
<p><a href="http://www.erlang.org/doc/man/string.html#tokens-2" rel="nofollow">http://www.erlang.org/doc/man/string.html#tokens-2</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Django gotchas - part 1 by Ulises</title>
		<link>http://monogroncho.com/2008/10/django-gotchas-part-1/#comment-5</link>
		<dc:creator>Ulises</dc:creator>
		<pubDate>Tue, 04 Nov 2008 14:38:31 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=91#comment-5</guid>
		<description>@Alexandre

Things I would do to debug the problem:
1) use a browser and try /ajax_load/number_here/ and see that I actually get the json response back
2) use firebug and look at the requests (if you're not already doing that)
3) check that field ids match those you use in your javascript code
4) careful with character escaping (in your template you have a &#60; instead of &lt;) and finally
5) go to #django in freenode and ask as people there are really friendly and helpful

Hope that helps.</description>
		<content:encoded><![CDATA[<p>@Alexandre</p>
<p>Things I would do to debug the problem:<br />
1) use a browser and try /ajax_load/number_here/ and see that I actually get the json response back<br />
2) use firebug and look at the requests (if you&#8217;re not already doing that)<br />
3) check that field ids match those you use in your javascript code<br />
4) careful with character escaping (in your template you have a &lt; instead of <) and finally<br />
5) go to #django in freenode and ask as people there are really friendly and helpful</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Django gotchas - part 1 by Alexandre</title>
		<link>http://monogroncho.com/2008/10/django-gotchas-part-1/#comment-4</link>
		<dc:creator>Alexandre</dc:creator>
		<pubDate>Tue, 04 Nov 2008 14:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=91#comment-4</guid>
		<description>Hi, i'm having problems with you example, nothing happens with the second choice field on the change event of the first one...

Maybe i'm doing something wrong:

1) i placed this inside urls.py
(r'^myview/$', 'Representantes.dynamic_choice.views.myview'),
(r'^ajax_load/(\d+)/$', 'Representantes.dynamic_choice.views.get_2ndCF_values_json'),

2) my template "myform.html" looks like this:
http://dpaste.com/hold/88658/

Thanks</description>
		<content:encoded><![CDATA[<p>Hi, i&#8217;m having problems with you example, nothing happens with the second choice field on the change event of the first one&#8230;</p>
<p>Maybe i&#8217;m doing something wrong:</p>
<p>1) i placed this inside urls.py<br />
(r&#8217;^myview/$&#8217;, &#8216;Representantes.dynamic_choice.views.myview&#8217;),<br />
(r&#8217;^ajax_load/(\d+)/$&#8217;, &#8216;Representantes.dynamic_choice.views.get_2ndCF_values_json&#8217;),</p>
<p>2) my template &#8220;myform.html&#8221; looks like this:<br />
<a href="http://dpaste.com/hold/88658/" rel="nofollow">http://dpaste.com/hold/88658/</a></p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Django gotchas - part 1 by Claudiu</title>
		<link>http://monogroncho.com/2008/10/django-gotchas-part-1/#comment-3</link>
		<dc:creator>Claudiu</dc:creator>
		<pubDate>Thu, 09 Oct 2008 09:10:02 +0000</pubDate>
		<guid isPermaLink="false">http://monogroncho.com/?p=91#comment-3</guid>
		<description>Indeed, very useful information. Thanks!</description>
		<content:encoded><![CDATA[<p>Indeed, very useful information. Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
