<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>ontehfritz - Application Development and Stuff &#187; Django</title>
	<atom:link href="http://ontehfritz.wordpress.com/category/django/feed/" rel="self" type="application/rss+xml" />
	<link>http://ontehfritz.wordpress.com</link>
	<description>.Net, Programming, Application Development and Stuff</description>
	<lastBuildDate>Fri, 01 May 2009 23:22:03 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ontehfritz.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/cd1029a8495d73a144457effc39577b3?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>ontehfritz - Application Development and Stuff &#187; Django</title>
		<link>http://ontehfritz.wordpress.com</link>
	</image>
			<item>
		<title>Django &#8211; Bug in QueryDict and Storing them in Sessions</title>
		<link>http://ontehfritz.wordpress.com/2009/02/22/django-bug-in-querydict-and-storing-them-in-sessions/</link>
		<comments>http://ontehfritz.wordpress.com/2009/02/22/django-bug-in-querydict-and-storing-them-in-sessions/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 04:50:15 +0000</pubDate>
		<dc:creator>ontehfritz</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://ontehfritz.wordpress.com/?p=80</guid>
		<description><![CDATA[Hello All, 
Django, Django &#8230; I came across a bug in Django when I was storing request.POST in session variable. Why would I want to do this. Well, I am creating a survey component and I want to have the ability for the users to go to previous pages of the survey, and see or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ontehfritz.wordpress.com&blog=5338991&post=80&subd=ontehfritz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hello All, </p>
<p>Django, Django &#8230; I came across a bug in Django when I was storing request.POST in session variable. Why would I want to do this. Well, I am creating a survey component and I want to have the ability for the users to go to previous pages of the survey, and see or change what their answers are. So I do something like this on each page post:</p>
<p> request.session[str(category_id)] = request.POST</p>
<p>I have each category on a separate page. So when I go back or forward on each survey page I retrieve the session corresponding to the category and restore the forms:</p>
<p>form_list = create_category_forms(category_id, request.session[str(category_id)])</p>
<p>I have some forms on the pages that I have created that contain MultipleChoiceField and Choicefield types in the forms. The problem is related to the MultipleChoiceField, because these contain widgets such as: CheckboxSelectMultiple, which contain a list of values when submitted. Now when the post is submitted request.POST is essentially a QueryDict type. When this is stored in a session variable then retrieved on the next post back only the last element of the CheckSelectMultiple is kept. For example:<br />
I select 1, 2, 3, 4 from the MultipleChoiceField, save it the request.POST in the session then retrieve it later I only get the value 4, not 1, 2, 3, 4. This is due to a bug on the pickling(serialization and reversing the serialization) of QueryDict.</p>
<p>The patch can be found here:<a href="http://code.djangoproject.com/ticket/10184">http://code.djangoproject.com/ticket/10184</a> I am told when addressing this issue further with Django contributors and making it sure it works, that it will be corrected in the upcoming release 1.1 of Django. So for now get the patch because QueryDict has a bug with multiple values in session variables. </p>
<p>TTYL,<br />
Fritz</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ontehfritz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ontehfritz.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ontehfritz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ontehfritz.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ontehfritz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ontehfritz.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ontehfritz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ontehfritz.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ontehfritz.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ontehfritz.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ontehfritz.wordpress.com&blog=5338991&post=80&subd=ontehfritz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ontehfritz.wordpress.com/2009/02/22/django-bug-in-querydict-and-storing-them-in-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5187122c4f0154913c45b1517daaf4ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ontehfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>Django Forms &#8211; ChoiceField and MultipleChoiceField</title>
		<link>http://ontehfritz.wordpress.com/2009/02/15/django-forms-choicefield-and-multiplechoicefield/</link>
		<comments>http://ontehfritz.wordpress.com/2009/02/15/django-forms-choicefield-and-multiplechoicefield/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 01:31:11 +0000</pubDate>
		<dc:creator>ontehfritz</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://ontehfritz.wordpress.com/?p=61</guid>
		<description><![CDATA[Well, I have been working on my latest project for a client in Django for a couple weeks now in my spare time. I enjoy it a lot!  The documentation is great, but there isn&#8217;t enough of it yet.
My day job is mostly Microsoft based development and I must say it makes me lazy, because [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ontehfritz.wordpress.com&blog=5338991&post=61&subd=ontehfritz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well, I have been working on my latest project for a client in Django for a couple weeks now in my spare time. I enjoy it a lot!  The documentation is great, but there isn&#8217;t enough of it yet.</p>
<p>My day job is mostly Microsoft based development and I must say it makes me lazy, because the great amount of resources out there. If I encountered a problem someone has solved it or can give a tremendous amount of insight to solve the issue.</p>
<p>Looking at the Django community since version 1 of the web framework, you get a sense it is going to be great and is only a matter of time before resources grow.</p>
<p>To the point MAN!!!!</p>
<p>One thing I wasted a a couple hours on was using a CheckBox with Multiple selections, what isn&#8217;t documented clearly is when to use ChoiceField or MultiChoiceField. In retrospect seeing ChoiceField and seeing MultipleChoiceField side by side, the decision is obvious.  However, at first glance and examples I have seen, I didn&#8217;t know that MultipleChoiceField was an option. I thought I could use ChoiceField with widget=forms.CheckboxSelectMultiple, like this:</p>
<pre class="brush: python;">
class QuestionMulipleSelect(forms.Form):
    answers = forms.ChoiceField(widget=forms.CheckboxSelectMultiple, label=&quot;&quot;)
.
.
.
</pre>
<p>This will render the form fine, but when you do a post you will always get an invalid selection error &#8230; you must use MultipleChoiceField like:</p>
<pre class="brush: python;">
class QuestionMulipleSelect(forms.Form):
    answers = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, label=&quot;&quot;)
.
.
.
</pre>
<p>This will render and post just the way expected.<br />
The thing to remember is any widget that returns a scalar value uses: ChoiceField.<br />
When you using a widget with mutli selection then you must use: MultipleChoiceField. The details of instantiating them are the same, retrieving the values are a little different; MultipleChoiceField has a list as the value attribute and ChoiceField is scalar.</p>
<p>Short tip for now, if anybody wants a code example, I will be happy to update this post with a more detailed example.</p>
<p>Cheers and Beers!</p>
<p>Fritz</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ontehfritz.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ontehfritz.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ontehfritz.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ontehfritz.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ontehfritz.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ontehfritz.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ontehfritz.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ontehfritz.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ontehfritz.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ontehfritz.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ontehfritz.wordpress.com&blog=5338991&post=61&subd=ontehfritz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ontehfritz.wordpress.com/2009/02/15/django-forms-choicefield-and-multiplechoicefield/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5187122c4f0154913c45b1517daaf4ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ontehfritz</media:title>
		</media:content>
	</item>
		<item>
		<title>Django awesome web framework!</title>
		<link>http://ontehfritz.wordpress.com/2009/02/02/django-awesome-web-framework/</link>
		<comments>http://ontehfritz.wordpress.com/2009/02/02/django-awesome-web-framework/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 02:05:49 +0000</pubDate>
		<dc:creator>ontehfritz</dc:creator>
				<category><![CDATA[Django]]></category>

		<guid isPermaLink="false">http://ontehfritz.wordpress.com/?p=57</guid>
		<description><![CDATA[It has been a long time since my last post and frankly my blog hasn&#8217;t been generating a ton of hits, no comments if I suck or not .. maybe thats a good thing. 
However I am really excited, I started to use the highly awesome web framework Django 1.0.2, and let me tell you it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ontehfritz.wordpress.com&blog=5338991&post=57&subd=ontehfritz&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It has been a long time since my last post and frankly my blog hasn&#8217;t been generating a ton of hits, no comments if I suck or not .. maybe thats a good thing. </p>
<p>However I am really excited, I started to use the highly awesome web framework Django 1.0.2, and let me tell you it is awesome! There is a bit of a learning curve coming from long years of asp.net development, but once you get used to it, there are a lot of features that can be appreciated.</p>
<p>It has a database model framework that is surprisingly intuitive, it actually took me less time to develop a model exactly the way I wanted, then when using the GUI and wizard with the .Net Entity framework. Let me tell you why, sometimes code is better then a wizard, because you get exactly what you want. I feel like I am constantly  battling with the Entity Framework Model builder. The Django way, code your model classes, run syncdb! Nice to the point. On the downside the Django model framework needs improvement, for example when you make changes to the objects such as adding fields or taking away fields on tables it does not do an alter them, but wait the ado.net framework doesn&#8217;t create shit for you! </p>
<p>I am taking a liking to the MVC design pattern of Django. I like how you can further separate the distinct layers of a web application, You have the controller which is a simple URL regex parser, that directs the request to the proper view, from the view you place your business logic and work with models and send that to the simple template layer that Django provides to display what took place in the view. OK, not pure MVC, but very productive nonetheless.</p>
<p>Django is very nice and I would like to see it blossom into something even greater. With web services, more widgets, and a bigger enterprise user base, it is sure to succeed in big ways!</p>
<p>Enough positive ranting for now, I still like .Net alot, however I think I will have 2 great frameworks to use from now on. </p>
<p>I am currently working on a information gathering and sharing application for mental health research in Django.  Soon will be some How-Tos and struggles I have gone through. Also stayed tuned for more ASP.NET tutorials and insights. </p>
<p> </p>
<p>TTYL, </p>
<p>Fritz&#8230;.</p>
<p>Also check out the band: theSmalls &#8230; Great band!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ontehfritz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ontehfritz.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ontehfritz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ontehfritz.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ontehfritz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ontehfritz.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ontehfritz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ontehfritz.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ontehfritz.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ontehfritz.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ontehfritz.wordpress.com&blog=5338991&post=57&subd=ontehfritz&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ontehfritz.wordpress.com/2009/02/02/django-awesome-web-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5187122c4f0154913c45b1517daaf4ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ontehfritz</media:title>
		</media:content>
	</item>
	</channel>
</rss>