<?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/"
	>

<channel>
	<title>muhuk.com &#187; open source</title>
	<atom:link href="http://www.muhuk.com/tag/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.muhuk.com</link>
	<description>know thyself</description>
	<lastBuildDate>Wed, 07 Jul 2010 10:26:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to Install MySQL with Fabric</title>
		<link>http://www.muhuk.com/2010/05/how-to-install-mysql-with-fabric/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=how-to-install-mysql-with-fabric</link>
		<comments>http://www.muhuk.com/2010/05/how-to-install-mysql-with-fabric/#comments</comments>
		<pubDate>Sat, 22 May 2010 06:51:12 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[fabric]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=372</guid>
		<description><![CDATA[I just want to share a small fabfile snipplet that installs mysql-server package on a Debian machine if it&#8217;s not already installed. Actually it should have been quite straightforward; just issue an apt-get command, right? But during configuration it displays a curses dialog for MySQL root password. This of course blows your automated configuration plans. [...]]]></description>
			<content:encoded><![CDATA[<p>I just want to share a small <a href="http://fabfile.org/">fabfile</a> snipplet that installs <code>mysql-server</code> package on a Debian machine if it&#8217;s not already installed. Actually it should have been quite straightforward; just issue an <code>apt-get</code> command, right? But during configuration it displays a curses dialog for MySQL root password. This of course blows your automated configuration plans. We will seed this value to <code>debconf</code> database to avoid this dialog.</p>

<p>First let&#8217;s have a look at the supporting code:</p>

<p><code><pre style="color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';"><span style="color:#000000; font-weight:bold">from</span> &#95;&#95;future&#95;&#95; <span style="color:#000000; font-weight:bold">import</span> with&#95;statement
<span style="color:#000000; font-weight:bold">from</span> fabric<span style="color:#000000">.</span>api <span style="color:#000000; font-weight:bold">import</span> <span style="color:#000000">*</span>
<span style="color:#000000; font-weight:bold">from</span> fabric<span style="color:#000000">.</span>utils <span style="color:#000000; font-weight:bold">import</span> warn</p>

<p><span style="color:#000000; font-weight:bold">def</span> <span style="color:#010181">apt&#95;get</span><span style="color:#000000">(*</span>packages<span style="color:#000000">):</span>
    <span style="color:#010181">sudo</span><span style="color:#000000">(</span><span style="color:#ff0000">'apt-get -y --no-upgrade install %s'</span> <span style="color:#000000">%</span> <span style="color:#ff0000">' '</span><span style="color:#000000">.</span><span style="color:#010181">join</span><span style="color:#000000">(</span>packages<span style="color:#000000">),</span> shell<span style="color:#000000">=</span><span style="color:#000000; font-weight:bold">False</span><span style="color:#000000">)</span>
</pre></code></p>

<p>Our <code>apt_get</code> fabric command issues <code>apt_get install</code> that answers <code>yes</code> to all questions and does not upgrade if the requested package is already installed. Now let&#8217;s take a look at the main command that installs <code>mysql-server</code>:</p>

<p><code><pre style="color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';"><span style="color:#000000; font-weight:bold">def</span> <span style="color:#010181">install&#95;mysql</span><span style="color:#000000">():</span>
    with <span style="color:#010181">settings</span><span style="color:#000000">(</span><span style="color:#010181">hide</span><span style="color:#000000">(</span><span style="color:#ff0000">'warnings'</span><span style="color:#000000">,</span> <span style="color:#ff0000">'stderr'</span><span style="color:#000000">),</span> warn&#95;only<span style="color:#000000">=</span><span style="color:#000000; font-weight:bold">True</span><span style="color:#000000">):</span>
        result <span style="color:#000000">=</span> <span style="color:#010181">sudo</span><span style="color:#000000">(</span><span style="color:#ff0000">'dpkg-query --show mysql-server'</span><span style="color:#000000">)</span>
    <span style="color:#000000; font-weight:bold">if</span> result<span style="color:#000000">.</span>failed <span style="color:#000000; font-weight:bold">is False</span><span style="color:#000000">:</span>
        <span style="color:#010181">warn</span><span style="color:#000000">(</span><span style="color:#ff0000">'MySQL is already installed'</span><span style="color:#000000">)</span>
        <span style="color:#000000; font-weight:bold">return</span>
    mysql&#95;password <span style="color:#000000">=</span> <span style="color:#010181">prompt</span><span style="color:#000000">(</span><span style="color:#ff0000">'Please enter MySQL root password:'</span><span style="color:#000000">)</span>
    <span style="color:#010181">sudo</span><span style="color:#000000">(</span><span style="color:#ff0000">'echo &quot;mysql-server-5.0 mysql-server/root&#95;password password '</span> \
                              <span style="color:#ff0000">'%s&quot; | debconf-set-selections'</span> <span style="color:#000000">%</span> mysql&#95;password<span style="color:#000000">)</span>
    <span style="color:#010181">sudo</span><span style="color:#000000">(</span><span style="color:#ff0000">'echo &quot;mysql-server-5.0 mysql-server/root&#95;password&#95;again password '</span> \
                              <span style="color:#ff0000">'%s&quot; | debconf-set-selections'</span> <span style="color:#000000">%</span> mysql&#95;password<span style="color:#000000">)</span>
    <span style="color:#010181">apt&#95;get</span><span style="color:#000000">(</span><span style="color:#ff0000">'mysql-server'</span><span style="color:#000000">)</span>
</pre></code></p>

<p>First we want to make sure <code>mysql-server</code> is not already installed. For this reason we issue <code>dpkg-query --show mysql-server</code>. Note that if this command fails then <code>mysql-server</code> is not installed and we can proceed otherwise we want to return. We hide the ugly error messages by running our <code>dpkg-query</code> command within a <code>settings</code> context:</p>

<p><code><pre style="color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';">with <span style="color:#010181">settings</span><span style="color:#000000">(</span><span style="color:#010181">hide</span><span style="color:#000000">(</span><span style="color:#ff0000">'warnings'</span><span style="color:#000000">,</span> <span style="color:#ff0000">'stderr'</span><span style="color:#000000">),</span> warn&#95;only<span style="color:#000000">=</span><span style="color:#000000; font-weight:bold">True</span><span style="color:#000000">):</span>
    result <span style="color:#000000">=</span> <span style="color:#010181">sudo</span><span style="color:#000000">(</span><span style="color:#ff0000">'dpkg-query --show mysql-server'</span><span style="color:#000000">)</span>
<span style="color:#000000; font-weight:bold">if</span> result<span style="color:#000000">.</span>failed <span style="color:#000000; font-weight:bold">is False</span><span style="color:#000000">:</span>
    <span style="color:#010181">warn</span><span style="color:#000000">(</span><span style="color:#ff0000">'MySQL is already installed'</span><span style="color:#000000">)</span>
    <span style="color:#000000; font-weight:bold">return</span>
</pre></code></p>

<p>The rest of the code is pretty straightforward. We prompt to the user running fabric for the root password and seed its value twice into the <code>debconf</code> database.</p>

<p><code><pre style="color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';"><span style="color:#010181">sudo</span><span style="color:#000000">(</span><span style="color:#ff0000">'echo &quot;mysql-server-5.0 mysql-server/root&#95;password password '</span> \
                            <span style="color:#ff0000">'%s&quot; | debconf-set-selections'</span> <span style="color:#000000">%</span> mysql&#95;password<span style="color:#000000">)</span>
<span style="color:#010181">sudo</span><span style="color:#000000">(</span><span style="color:#ff0000">'echo &quot;mysql-server-5.0 mysql-server/root&#95;password&#95;again password '</span> \
                            <span style="color:#ff0000">'%s&quot; | debconf-set-selections'</span> <span style="color:#000000">%</span> mysql&#95;password<span style="color:#000000">)</span>
<span style="color:#010181">apt&#95;get</span><span style="color:#000000">(</span><span style="color:#ff0000">'mysql-server'</span><span style="color:#000000">)</span>
</pre></code></p>

<p>Finally, having finished our little dance, we install <code>mysql-server</code>. I hope this helps some automated deployment believer out there.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2010/01/quest-for-ultimate-developmentdeployment-toolset-fabric-pip-virtualenv/' rel='bookmark' title='Permanent Link: Quest For Ultimate Development/Deployment Toolset: Fabric, Pip &#038; Virtualenv'>Quest For Ultimate Development/Deployment Toolset: Fabric, Pip &#038; Virtualenv</a></li>
<li><a href='http://www.muhuk.com/2009/07/django-renderformplain/' rel='bookmark' title='Permanent Link: django-renderformplain'>django-renderformplain</a></li>
<li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps'>Developing Reusable Django Apps</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/05/how-to-install-mysql-with-fabric/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why Not To Localize Community Support</title>
		<link>http://www.muhuk.com/2010/04/why-not-to-localize-community-support/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=why-not-to-localize-community-support</link>
		<comments>http://www.muhuk.com/2010/04/why-not-to-localize-community-support/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 18:28:51 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[netiquette]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=367</guid>
		<description><![CDATA[If you are reading this, you know English. I would like to pose a question before we go any further; would you prefer community support in your native language over what international community offers?1 By community support, I mean free software support provided by the user community. Every successful project has some form of communication; [...]]]></description>
			<content:encoded><![CDATA[<p>If you are reading this, you know <a href="http://www.muhuk.com/2009/04/what-youth-needs-is-vision/">English</a>. I would like to pose a question before we go any further; would you prefer community support in your native language over what international community offers?<sup>1</sup></p>

<p>By <code>community support</code>, I mean <a href="http://www.fsf.org/">free software</a> support provided by the user community. Every successful project has some form of communication; mailing lists, forums, IRC, wikis, etc. And the preferred language is almost always English. Simply because you can reach more people. People who can use your code. Who can test it, file bugs, send patches, etc. It is the <strong>logical</strong> thing to do. But in the spirit of freedom, I think nobody should be forced to use a certain (natural or programming) language for something they have created.</p>

<h3>Real Communities</h3>

<p>I think having local communities is a great idea. I don&#8217;t know, because we don&#8217;t have any in Türkiye<sup>2</sup>. So I am just guessing they should be cultivating and fun at the same time. We do have many local <a href="http://en.wikipedia.org/wiki/Community_building">pseudo-communities</a> though. There is some activity, people come and go, some of them stay much longer than the others. But they never progress towards a community. I think this is because they make the fundamental mistake of localizing community support. They translate documentation intended for highly technical people and create new channels that no advanced user will bother to participate. In short, <strong>they attempt to sidestep the language barrier</strong>.</p>

<p>If want to be a <a href="http://www.catb.org/~esr/faqs/hacker-howto.html#skills4">programmer</a> you need to know English. It is not optional. It is not a requirement of being a good programmer. You are at most an excellent <a href="http://www.urbandictionary.com/define.php?term=script+kiddie">script kiddie</a> without proper English skills. Obviously, knowing perfect English doesn&#8217;t make you a great programmer instantly. It will increase the resources you can access dramatically, though. And most importantly it will give you the chance to <a href="http://jangosteve.com/post/380926251/no-one-knows-what-theyre-doing">know more about what you don&#8217;t know</a>. Stay in your little world to play with your mates <strong>who know just as little as you do</strong> and you will never improve.</p>

<h3>A Foolish Endeavour</h3>

<p>Some people, who spend time with these pseudo-communities, know English well enough. They are probably acting with good intentions when they provide support in their native language. But they are actually wasting their time. Having been solved one specific problem doesn&#8217;t make the other person a better programmer. On the contrary they are giving local users another reason to avoid solving the real issue. The function of a community should be supporting each member&#8217;s continuous improvement. That doesn&#8217;t necessarily mean solving their technical problems for them<sup>3</sup>.</p>

<p>What is wrong with asking questions in a native language if on a local channel or face to face with local people? Nothing. There is absolutely nothing wrong with that. It would be silly to speak another language there. But if you really want to improve, you can tap into a greater source of information. It is your choice. Pseudo-communities will only take you so far. Because <strong>they are only generating more newbies, and not supporting newbies become experienced users</strong>. Do they produce anything but empty talk?</p>

<p>Why should a local community produce anything? What should the product be? I will probably write another post about this soon. But feel free to post your ideas and critics in the comments.</p>

<hr />

<p><strong>1</strong>: Obviously, it only makes sense if your native language is not English.</p>

<p><strong>2</strong>: I would very much like to be proven wrong on this one. If you know any, please write a comment and don&#8217;t forget to include a website and date of the last meeting.</p>

<p><strong>3</strong>: Also note that there is a difference between <em>helping someone solve a problem</em> and <em>solving the problem</em>. Spoonfeeding does more harm than good.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/05/nominate-qooxdoo-for-sourceforge-community-choice-awards/' rel='bookmark' title='Permanent Link: Nominate Qooxdoo for SourceForge Community Choice Awards'>Nominate Qooxdoo for SourceForge Community Choice Awards</a></li>
<li><a href='http://www.muhuk.com/2009/06/psychic-irc-support-in-10-easy-steps/' rel='bookmark' title='Permanent Link: Psychic IRC Support In 10 Easy Steps'>Psychic IRC Support In 10 Easy Steps</a></li>
<li><a href='http://www.muhuk.com/2009/05/django-formfieldset/' rel='bookmark' title='Permanent Link: django-formfieldset'>django-formfieldset</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/04/why-not-to-localize-community-support/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Free Software &amp; Linux Days 2010</title>
		<link>http://www.muhuk.com/2010/03/free-software-linux-days-2010/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=free-software-linux-days-2010</link>
		<comments>http://www.muhuk.com/2010/03/free-software-linux-days-2010/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 07:11:39 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=359</guid>
		<description><![CDATA[Free Software &#38; Open Source Days of İstanbul Bilgi University and Linux &#38; Free Software Festival of Linux Users Association are united under the name Free Software &#38; Linux Days this year. If you have attended before, you will probably make no other plans for April 2-3. If you have never been to this event, [...]]]></description>
			<content:encoded><![CDATA[<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Aex8Kj-QYrA&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Aex8Kj-QYrA&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>

<p><em>Free Software &amp; Open Source Days</em> of İstanbul Bilgi University and <em>Linux &amp; Free Software Festival</em> of Linux Users Association are united under the name <a href="http://www.ozguryazilimgunleri.org/index_en.html"><strong>Free Software &amp; Linux Days</strong></a> this year. If you have attended before, you will probably make no other plans for April 2-3.</p>

<p>If you have never been to this event, registration is free and can be done at the front desk. If you are remotely interested in free software or hackerdom you will want to be there. &#8230;and, of course, you are welcome.</p>

<p>I will be giving a <a href="http://www.ozguryazilimgunleri.org/program.html#atamert_olcgen">Django presentation</a> on Friday. Please come and say hello if you happen to be attending.</p>

<p><strong>UPDATE:</strong> You can find the slides from presentation <a href="http://www.slideshare.net/muhuk/django-ile-arsz-tehis-ve-tedavi">here</a>. Slideshare&#8217;s importer failed to import the file I&#8217;ve uploaded properly. So please download and view the slides with Acrobat Reader.</p>

<div style="width:425px" id="__ss_3613121"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/muhuk/django-ile-arsz-tehis-ve-tedavi" title="Django ile Ağrısız Teşhis ve Tedavi">Django ile Ağrısız Teşhis ve Tedavi</a></strong><object width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=freedays2010djangoileagrisizteshisvetedavi-100401090518-phpapp02&#038;stripped_title=django-ile-arsz-tehis-ve-tedavi" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=freedays2010djangoileagrisizteshisvetedavi-100401090518-phpapp02&#038;stripped_title=django-ile-arsz-tehis-ve-tedavi" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/muhuk">muhuk</a>.</div></div>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/05/django-formfieldset/' rel='bookmark' title='Permanent Link: django-formfieldset'>django-formfieldset</a></li>
<li><a href='http://www.muhuk.com/2010/03/whats-new-in-django-formfieldset-1-1/' rel='bookmark' title='Permanent Link: What&#8217;s New in django-formfieldset 1.1'>What&#8217;s New in django-formfieldset 1.1</a></li>
<li><a href='http://www.muhuk.com/2009/04/freedays09-recap/' rel='bookmark' title='Permanent Link: Freedays&#8217;09 Recap'>Freedays&#8217;09 Recap</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/03/free-software-linux-days-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s New in django-formfieldset 1.1</title>
		<link>http://www.muhuk.com/2010/03/whats-new-in-django-formfieldset-1-1/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=whats-new-in-django-formfieldset-1-1</link>
		<comments>http://www.muhuk.com/2010/03/whats-new-in-django-formfieldset-1-1/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 20:40:04 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[django-formfieldset]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=352</guid>
		<description><![CDATA[I have just released 1.1 version of django-formfieldset. I has been almost a year since version 1.0. Here is a summary of changes for this version: New Example Project There is a new and improved example project. It is designed to be some sort of documentation at the same time. When you run the example [...]]]></description>
			<content:encoded><![CDATA[<p>I have just released 1.1 version of <a href="http://github.com/muhuk/django-formfieldset/">django-formfieldset</a>. I has been almost a year since <a href="http://www.muhuk.com/2009/05/django-formfieldset/">version 1.0</a>. Here is a summary of changes for this version:</p>

<h3>New Example Project</h3>

<p>There is a new and improved example project. It is designed to be some sort of documentation at the same time. When you run the example project and visit different pages you will see, for each examle, Python code, template code, text of rendered result and finally the result embedded.</p>

<p>If you have <a href="http://pygments.org/">Pygments</a> installed all the code will be nicely highlighted.</p>

<h3>Fieldset &amp; FieldsetMixin Improvements</h3>

<p>Fieldset definitions are validated now. An exception will be raised if all of your fields are not included exactly once.</p>

<p>Template strings that are used by <code>as_table</code>, <code>as_p</code> and <code>as_ul</code> methods are now class attributes. You can simply override them instead of writing your own <code>as_*</code> method.</p>

<p><code>FieldsetMixin</code> provides a <code>fieldset_dict</code> attribute. This dictionary has <strong>slugified</strong> fieldset names as keys and <code>Fieldset</code> instances as values. Your fieldset declarations can still be accessed from <code>fielsets</code> attribute.</p>

<h3>Rendering Improvements</h3>

<p>There are two rendering related improvements: individual fieldset rendering and <code>renderform</code> template filter.</p>

<p><code>Fieldset</code> objects have <code>as_table</code>, <code>as_p</code>, <code>as_ul</code> methods just like forms. Errors from hidden fields are handled correctly, but you still need to call <code>non_field_errors()</code> to get the top level errors. Also it is template author&#8217;s responsibility to make sure all the fieldsets are rendered.</p>

<p>If <code>as_*</code> methods are not enough for you, with <code>renderform</code> filter you can render your forms or <code>Fieldset</code>s through a custom template. It works like this:</p>

<pre><code>{{ form.fieldset_dict.mytitlerenderform:"myapp/mytitle_fieldset.html" }}
</code></pre>

<p>If you call it without an argument <code>formfieldset/form.html</code> template will be used.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/05/django-formfieldset/' rel='bookmark' title='Permanent Link: django-formfieldset'>django-formfieldset</a></li>
<li><a href='http://www.muhuk.com/2009/07/django-renderformplain/' rel='bookmark' title='Permanent Link: django-renderformplain'>django-renderformplain</a></li>
<li><a href='http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/' rel='bookmark' title='Permanent Link: Dynamic Translation Apps for Django'>Dynamic Translation Apps for Django</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/03/whats-new-in-django-formfieldset-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 5 Untrends According To Me</title>
		<link>http://www.muhuk.com/2010/02/top-5-untrends-according-to-me/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=top-5-untrends-according-to-me</link>
		<comments>http://www.muhuk.com/2010/02/top-5-untrends-according-to-me/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 15:21:39 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[competence]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[netiquette]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[social media]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=338</guid>
		<description><![CDATA[My dear friend Ochronus posted an article titled Top 5 trends and technologies in software development that got me thinking. My thoughts below. Go check Ochronus&#8217;s blog if you haven&#8217;t, he is the lead developer at Arukereso.hu. I agree with the suggestions from the original article. Yet, I would like to change the order a [...]]]></description>
			<content:encoded><![CDATA[<p>My dear friend Ochronus posted an article titled <a href="http://blog.mostof.it/posts/top-5-trends-in-software-development/"><em>Top 5 trends and technologies in software development</em></a> that got me thinking. My thoughts below. Go check Ochronus&#8217;s blog if you haven&#8217;t, he is the lead developer at <a href="http://www.arukereso.hu/">Arukereso.hu</a>.</p>

<p>I agree with the suggestions from the original article. Yet, I would like to change the order a little bit; DVCS and then agile (with lowercase a) and then the rest. None of my points below are cool trends, in fact I can guarantee most of you will find them boring. But I think they are all important. OK, I hope you are all psyched now. Here we go:</p>

<h3>1. Be Careful With The Buzz</h3>

<p>Trends are cool. What could be wrong about following cutting edge stuff? We all want to be <em>up to date</em>, no? I think it&#8217;s good to follow the trends <strong>if</strong> you have the experience and the ability to filter the BS. I know a young developer who was constantly going back and forth between <a href="http://railsenvy.com/2007/9/10/ruby-on-rails-vs-django-commercial-7">Rails/Ruby and Django/Python</a>. I haven&#8217;t heard from him for a while, but he is probably still doing that same dance. Why? Because his considerations were solely based on buzz, not on simple requirements analysis or technical comparisons or personal experience.</p>

<h3>2. Learn And Use An Old-Fashioned <del>Modern</del> Low-Level <del>Scripting</del> Language</h3>

<p>To all the <em>scripting</em> people, like me, out there: you need to have an understanding of what&#8217;s happening under the hood. At the least to appreciate our high-level environments, at the most to become genuinely good programmers. Being a Python person myself, I think the best low-level language to be proficient for me is C. Many other high-level languages have C interfaces. So investing the time to learn C should pay off one way or the other.</p>

<h3>3. Do Less Web Programming</h3>

<p>Aren&#8217;t we doing a lot of web programming these days? Actually I think doing X development exclusively is bad for your programming muscles. Web programming, enterprise work or system scripting, it doesn&#8217;t matter. But web programming happens more than anything else. Maybe some of you have only been playing with it, but there are a huge number of us doing nothing but web programming. This is so sad; both in an individual level and for the community at large.</p>

<h3>4. Learn How To Educate Yourself</h3>

<p>What is a noob? Here is a definition and disambiguation (from newbie):</p>

<blockquote>
  <p>Newbs are those who are new to some task and are very beginner at it, possibly a little overconfident about it, but they are willing to learn and fix their errors to move out of that stage. n00bs, on the other hand, know little and have no will to learn any more. They expect people to do the work for them and then expect to get praised about it, and make up a unique species of their own.</p>
</blockquote>

<p>Make an active effort not to be a noob. Learn <a href="http://catb.org/~esr/faqs/smart-questions.html">how to ask smart questions</a>, <a href="http://www.dtcc.edu/cs/rfc1855.html">how to communicate others</a> and seek help. Being polite is good but actually improving and being a valuable member of the community is much, much better.</p>

<h3>5. Open Source Properly</h3>

<p>It&#8217;s great to open source your project. But please do it properly. There are already too many unmaintained, undocumented projects out there that noone seem to care. Do you really have to add to that? <em>As is</em> argument doesn&#8217;t make much sense today. But if you really have to make an open source dead drop, please at least document the status of your project and your intentions clearly.</p>

<p>I wouldn&#8217;t be surprised if some you think they all are obvious. But if they are so obvious then why are they widely being ignored? Is it because they are under-retweeted, under-reddited and therefore not trendy.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/05/django-formfieldset/' rel='bookmark' title='Permanent Link: django-formfieldset'>django-formfieldset</a></li>
<li><a href='http://www.muhuk.com/2010/03/whats-new-in-django-formfieldset-1-1/' rel='bookmark' title='Permanent Link: What&#8217;s New in django-formfieldset 1.1'>What&#8217;s New in django-formfieldset 1.1</a></li>
<li><a href='http://www.muhuk.com/2010/04/why-not-to-localize-community-support/' rel='bookmark' title='Permanent Link: Why Not To Localize Community Support'>Why Not To Localize Community Support</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/02/top-5-untrends-according-to-me/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Developing Reusable Django Apps</title>
		<link>http://www.muhuk.com/2010/01/developing-reusable-django-apps/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=developing-reusable-django-apps</link>
		<comments>http://www.muhuk.com/2010/01/developing-reusable-django-apps/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 15:06:40 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[reusable]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=320</guid>
		<description><![CDATA[Django app structure is an implementation of seperation of concerns. It is slightly different than what you can find in other MVC frameworks. The stack is split vertically, not horizontally. And then the app is split horizontally within, i.e. models, views, templates etc are in their seperate modules/packages/directories. This vertical splitting allows you to collect [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.muhuk.com/2009/03/django-where-should-my-app-live/">Django app structure</a> is an implementation of <a href="http://en.wikipedia.org/wiki/Separation_of_concerns">seperation of concerns</a>. It is slightly different than what you can find in other MVC frameworks. The stack is split vertically, not horizontally. And then the app is split horizontally within, i.e. models, views, templates etc are in their seperate modules/packages/directories. This vertical splitting allows you to collect all ingredients of one functionality in your <a href="http://www.b-list.org/weblog/2006/sep/10/django-tips-laying-out-application/">project</a> in one place.</p>

<p><a href="http://www.muhuk.com/wp-content/uploads/2010/01/django__developing_reusable_apps_1.png"><img src="http://www.muhuk.com/wp-content/uploads/2010/01/django__developing_reusable_apps_1.png" alt="Framework Structure" title="Framework Structure" width="580" height="350" class="size-full wp-image-318" /></a></p>

<p>I think apps<sup>1</sup> are one of the strong points of Django. A selling point if you like. There is a great ecosystem of apps, you can find an app for almost anything posssible with Python. And Python is kick-ass when it comes to library wealth. But there is another major advantage of apps when they&#8217;re done right; a sane code base. Here is a slide from the <a href="http://jacobian.org/speaking/oscon-2009/oscon/">Django in the Real World</a> presentation by Jacob Kaplan-Moss:</p>

<blockquote>
  <p>The fivefold path</p>
  
  <ul>
  <li>Do one thing, and do it well.</li>
  <li>Don’t be afraid of multiple apps.</li>
  <li>Write for ﬂexibility.</li>
  <li>Build to distribute.</li>
  <li>Extend carefully.</li>
  </ul>
</blockquote>

<p>I will focus on flexibility and interoperability of apps in this post. But before we proceed I would like to emphasize the first bullet point in the slide. Because the scope of your app plays a big role in its flexibility and interoperability. Apps should be small enough to easily understand and integrate (into a project). Many times I have moved away from an otherwise good app because of its many dependencies and/or excessive features. On the other hand apps should be big enough to allow for different configurations and allow extension without modifying their code. <em>Do one thing, and do it well</em>.</p>

<p><a href="http://www.muhuk.com/wp-content/uploads/2010/01/django__developing_reusable_apps_2.png"><img src="http://www.muhuk.com/wp-content/uploads/2010/01/django__developing_reusable_apps_2.png" alt="Scope of an app" title="Scope of an app" width="580" height="200" class="size-full wp-image-319" /></a></p>

<p>Take <a href="http://code.google.com/p/django-tagging/">django-tagging</a> for example; it&#8217;s 1.3 KLOC but it does tagging and nothing else. There are no dependencies other than Django, you can add tags to any model without modifying the model source, a tag can be associated with any type of model and <code>tagging</code> hides the gory details from you&#8230; In short; finding the right size is important. This is why <code>tagging</code> is <strong>the</strong> tagging app for Django.</p>

<h2>Building For Reuse</h2>

<p>General advice is &#8220;<em>even project specific apps should be reusable</em>&#8220;. Slapping the same app onto another project is not the only advantage. In fact it may not be possible if you are not in the habit of upgrading your whole project to recent versions of Django. The main advantage as I have said before is <em>sanity</em>. I prefer Django to other web frameworks/environments because it provides a civilized way of development. Let&#8217;s accept it; web programming is not a particularly interesting, exciting or intellectually rewarding field. You write the same piece of code over and over. And worst of all the challanges you face are actually a result of either the underlying system was designed by morons or you are trying to use it for something it&#8217;s not intended to be used. So it is only natural that web programmers feel they&#8217;re rusting. Django eases the pain. If you stick to certain conventions serenity will follow as well.</p>

<p>Naturally the framework does most of the work regarding app flexibility and interoperability. Take URLs for instance <code>include('myapp.urls')</code> and you are good to go. You don&#8217;t have to bind views one by one. Is it inflexible? Who said <code>urls.py</code> can only contain a hardcoded list of URLs. You can do anything that is possible with Python. You can generate different <code>urlpatterns</code> based on a setting for instance.</p>

<p>It is relatively easy and straightforward to reuse and extend forms and views (both function based and class based). Models are a little harder to get right though. You should always think of the most difficult situation which is you can&#8217;t touch either app&#8217;s code. Registration pattern of <a href="http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-objects"><code>admin</code></a> app provides a good solution here. You can <code>register</code> a third party model to another third party app in just a few lines.</p>

<p>You don&#8217;t need to write lots of code to get the flexibility and interoperability. Well designed apps make good use of <code>settings.py</code> for example. Why should the project developer wrap a view when a single line assignment would do the job? Supplying good templatetags and template snipplets (includes) is another way to make things easy for app consumers.</p>

<p>Signals provide a great way to propagate the events generated from your app. Even though they are one way<sup>2</sup>, signals are extremely powerful. Any number of observers can connect to a signal and you can send a signal anywhere in your code. Literally. It is even possible your app suppying a signal and then another app sending it<sup>3</sup>.</p>

<p>There are many more ways to tame your app to be reusable. It all starts with your determination and discipline. Just like documentation, testing and maintaining a software generally. I will write more about reusable apps.</p>

<hr />

<p><strong>1</strong>: The word <strong>application</strong> is used both for a <strong>web application</strong> and a <strong>Django application</strong>. To avoid confusion I always use <strong>app</strong> to indicate the latter.</p>

<p><strong>2</strong>: Signals don&#8217;t have return values. But you can use a callback AFAIK.</p>

<p><strong>3</strong>: I can&#8217;t think of an example this would be useful, but still&#8230;</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2010/03/developing-reusable-django-apps-signals/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: Signals'>Developing Reusable Django Apps: Signals</a></li>
<li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps-app-settings/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: App Settings'>Developing Reusable Django Apps: App Settings</a></li>
<li><a href='http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/' rel='bookmark' title='Permanent Link: Dynamic Translation Apps for Django'>Dynamic Translation Apps for Django</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/01/developing-reusable-django-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic Translation Apps for Django</title>
		<link>http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=dynamic-translation-apps-for-django</link>
		<comments>http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 18:48:59 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=313</guid>
		<description><![CDATA[When I needed multi-language flatpages and flatblocks for telvee I searched for available Django apps that do dynamic translation. By dynamic translation, I mean translations are entered and stored in the database. As I said I needed to be able to translate both full pages and chunks of text that I can include into another [...]]]></description>
			<content:encoded><![CDATA[<p>When I needed multi-language <code>flatpages</code> and <code>flatblocks</code> for <a href="http://www.telvee.com/">telvee</a> I searched for available Django apps that do dynamic translation. By dynamic translation, I mean translations are entered and stored in the database. As I said I needed to be able to translate both full pages and chunks of text that I can include into another page. I ended up rolling my own, which is without a doubt lesser to some apps below. I will try to imrove it with the good ideas from existing projects and then open source. Meanwhile I would like to share my review of 6 dynamic translation apps with you. I hope someone out there finds it useful.</p>

<h2>Django-multilingual</h2>

<p>One of the few active projects I have reviewed is <a href="http://code.google.com/p/django-multilingual/">django-multilingual</a>. To enable a model for translations you need to create a <code>Translation</code> inner-class and move translatable fields inside. Then a seperate model for those fields is created behind the scenes. Django-multilingual has admin integration and a multi-language flatpages app. Another nice thing about this app is that it&#8217;s using <a href="http://docs.djangoproject.com/en/dev/topics/signals/#topics-signals">signals</a> internally. The API is based on getter and setter methods. For instance you call <code>get_&lt;fieldname&gt;(language_id=None)</code> on your model to get the field value for the active translation. This app has no releases and less than satisfactory API documentation and has tests only on the example project.</p>

<h2>Django-pluggable-model-i18n</h2>

<p><a href="http://code.google.com/p/django-pluggable-model-i18n/">Django-pluggable-model-i18n</a> uses registration pattern of admin app. It creates an extra model for translated fields and stores translations of non-default languages in it. This app has no releases, no tests, no API documentation and it is clearly stated to be <strong>experimental</strong>. I would also like to note the last commit date is May 25, 2009.</p>

<h2>Django-modeltranslation</h2>

<p>Another app that implements registration pattern is <a href="http://code.google.com/p/django-modeltranslation/">django-modeltranslation</a>. The advantage of registration pattern is you don&#8217;t have to modify the code of the 3rd party apps you want to translate dynamically. But the database schema still needs to be modified if you are using django-modeltranslation. Also there is one <code>translations.py</code> for the project. I think one translation definition file per app would be better (just like admin does). Django-modeltranslation has intuitive underscore-language_code API but it is somewhat inconsistent; when you read the unsuffixed field you read the currently active language, when you write you write the default language specified in <code>settings.py</code>. Also the modified model stores some redundant data. For instance if your <code>DEFAULT_LANGUAGE</code> is <code>"ES"</code> both <code>&lt;fieldname&gt;</code> and <code>&lt;fieldname&gt;_es</code> columns will store the same value. Django-modeltranslation has admin integration and a management command to update database schema. Most importantly <strong>this app is the only one which has both tests and a release</strong>. (Unfortunately tests require specific settings to run)</p>

<h2>Transdb</h2>

<p><a href="http://code.google.com/p/transdb/">Transdb</a> takes a completely different approach to dynamic translation problem. It provides two new field types; <code>TransCharField</code> and <code>TransTextField</code>. Then it serializes all your translations within a single column for each field of those. This means <strong>no <code>JOIN</code>s and no extra queries</strong>. Unfortunately transdb doesn&#8217;t implement underscore-language_code API, you need to use <code>get_in_language()</code> and <code>set_in_language()</code> methods. Transdb has default widgets that render one form field for each language. Last commit date is Nov 07, 2008 and there is a release.</p>

<h2>Django-multilingual-model</h2>

<p>This one is not actually an app but just one module with <del>33</del> 42 lines of code. You need to define the model that holds translations manually. This introduces some code redundancy, since you also define which fields get translated in the original model. <a href="http://code.google.com/p/django-multilingual-model/">Django-multilingual-model</a> doesn&#8217;t implement any translation API, so it&#8217;s rather verbose to do anything with it. There are no tests and no releases. I simply don&#8217;t recommend django-multilingual-model for anything serious.</p>

<h2>Django-transmeta</h2>

<p><a href="http://code.google.com/p/django-transmeta/">Django-transmeta</a> stores translations in extra columns it creates in the original field&#8217;s table similar to django-modeltranslation. But you enable translation assigning a metaclass for your model and then add a <code>Meta</code> attribute; this means you can&#8217;t make models in existing apps translatable without modifying their code. Django-transmeta implements underscore-language_code API, has admin integration and a management command to sync database when you add new languages or translatable fields. There are documentation and code examples but no tests or releases. Last commit date it Nov 24, 2009.</p>

<div id="attachment_314" class="wp-caption aligncenter" style="width: 590px"><a href="http://www.muhuk.com/wp-content/uploads/2010/01/dynamic_translation_comparison.png"><img src="http://www.muhuk.com/wp-content/uploads/2010/01/dynamic_translation_comparison.png" alt="Comparison of Dynamic Translation Apps" title="Comparison of Dynamic Translation Apps" width="580" height="400" class="size-full wp-image-314" /></a><p class="wp-caption-text">Comparison of Dynamic Translation Apps</p></div>

<p>Software development is making choices. Would you rather have a clean and stable schema with an extra translations model or avoid extra <code>JOIN</code>s and denormalize translations onto your original model&#8217;s table? Both have advantages and disadvantages. But some choices are not based on trade-offs. Documentation, examples, tests and releases for instance. Also in my opinion underscore-language_code API is way better than any of the alternatives.</p>

<p>Django platform is a very powerful and intuitive one. Many people have moved in last year. This popularity affected app ecosystem as well. But unfortunately a significant number of those apps are half baked fire-and-forget type. I wish 2010 to be the year of a significant increase in software quality of Django apps. I&#8217;ll try to do my part.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps'>Developing Reusable Django Apps</a></li>
<li><a href='http://www.muhuk.com/2010/03/developing-reusable-django-apps-signals/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: Signals'>Developing Reusable Django Apps: Signals</a></li>
<li><a href='http://www.muhuk.com/2010/01/developing-reusable-django-apps-app-settings/' rel='bookmark' title='Permanent Link: Developing Reusable Django Apps: App Settings'>Developing Reusable Django Apps: App Settings</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>django-renderformplain</title>
		<link>http://www.muhuk.com/2009/07/django-renderformplain/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-renderformplain</link>
		<comments>http://www.muhuk.com/2009/07/django-renderformplain/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 18:09:00 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=267</guid>
		<description><![CDATA[django-renderformplain is a Django app that allows you to render forms in plain text. I have found myself implementing quite a bit of styling into my forms and thought why do it once more when I want to render just the data. Renderformplain works both with bound forms (renders bound data) and unbound forms (renders [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/muhuk/django-renderformplain/"><code>django-renderformplain</code></a> is a Django app that allows you to render forms in plain text. I have found myself implementing quite a bit of styling into my forms and thought why do it once more when I want to render just the data. Renderformplain works both with bound forms (renders bound data) and unbound forms (renders initial data). The project is new, so there is no release yet<sup>1</sup>. But I&#8217;d like you to try it out and tell me what you think about it. And maybe find a few bugs.</p>

<h3>An Example</h3>

<p>After you copy <code>renderformplain</code> folder somewhere within your <code>PYTHONPATH</code>, add <code>"renderformplain"</code> to your <code>INSTALLED_APPS</code> setting to be able to run the example.</p>

<p>Let&#8217;s say you have a model <code>File</code>:</p>

<pre><span style="color:#555555">   1 </span><span style="color:#000000; font-weight:bold">class</span> <span style="color:#010181">File</span><span style="color:#000000">(</span>models<span style="color:#000000">.</span>Model<span style="color:#000000">):</span>
<span style="color:#555555">   2 </span>    name <span style="color:#000000">=</span> models<span style="color:#000000">.</span><span style="color:#010181">CharField</span><span style="color:#000000">(</span>max_length<span style="color:#000000">=</span><span style="color:#2928ff">100</span><span style="color:#000000">)</span>
<span style="color:#555555">   3 </span>    path <span style="color:#000000">=</span> models<span style="color:#000000">.</span><span style="color:#010181">CharField</span><span style="color:#000000">(</span>max_length<span style="color:#000000">=</span><span style="color:#2928ff">250</span><span style="color:#000000">)</span>
<span style="color:#555555">   4 </span>    size <span style="color:#000000">=</span> models<span style="color:#000000">.</span><span style="color:#010181">IntegerField</span><span style="color:#000000">()</span>
<span style="color:#555555">   5 </span>    last_modified <span style="color:#000000">=</span> models<span style="color:#000000">.</span><span style="color:#010181">DateTimeField</span><span style="color:#000000">(</span>default<span style="color:#000000">=</span>datetime<span style="color:#000000">.</span>datetime<span style="color:#000000">.</span>now<span style="color:#000000">)</span>
<span style="color:#555555">   6 </span>    created <span style="color:#000000">=</span> models<span style="color:#000000">.</span><span style="color:#010181">DateTimeField</span><span style="color:#000000">(</span>default<span style="color:#000000">=</span>datetime<span style="color:#000000">.</span>datetime<span style="color:#000000">.</span>now<span style="color:#000000">)</span>
<span style="color:#555555">   7 </span>    permissions <span style="color:#000000">=</span> models<span style="color:#000000">.</span><span style="color:#010181">IntegerField</span><span style="color:#000000">()</span></pre>

<p>And a form <code>FileForm</code>:</p>

<pre><span style="color:#555555">   1 </span><span style="color:#000000; font-weight:bold">class</span> <span style="color:#010181">FileForm</span><span style="color:#000000">(</span>forms<span style="color:#000000">.</span>ModelForm<span style="color:#000000">):</span>
<span style="color:#555555">   2 </span>    <span style="color:#000000; font-weight:bold">class</span> Meta<span style="color:#000000">:</span>
<span style="color:#555555">   3 </span>        model <span style="color:#000000">=</span> File</pre>

<p>Now assume you are using <code>django.contrib.formtools.preview.FormPreview</code> to review entered data before saving. In your <code>formtools/preview.html</code> template, instead of rendering the form as an HTML form, you can render it in plain text like this:</p>

<pre><span style="color: #007020">{%</span> <span style="color: #007020; font-weight: bold">load</span> <span style="color: #bb60d5">renderformplain_tags</span> <span style="color: #007020">%}</span>

<span style="color: #007020">{%</span> <span style="color: #007020; font-weight: bold">plainform</span> <span style="color: #bb60d5">form</span> <span style="color: #007020; font-weight: bold">as</span> <span style="color: #bb60d5">plain_form</span> <span style="color: #007020">%}</span>

<span style="color: #062873; font-weight: bold">&lt;h1&gt;</span>Preview your submission<span style="color: #062873; font-weight: bold">&lt;/h1&gt;</span>
<span style="color: #007020">{{</span> <span style="color: #bb60d5">plain_form.as_table</span> <span style="color: #007020">}}</span>

<span style="color: #062873; font-weight: bold">&lt;form</span> <span style="color: #4070a0">action=&quot;&quot;</span> <span style="color: #4070a0">method=&quot;post&quot;</span><span style="color: #062873; font-weight: bold">&gt;</span>
  <span style="color: #007020">{{</span> <span style="color: #bb60d5">form.as_hidden</span> <span style="color: #007020">}}</span>
  <span style="color: #062873; font-weight: bold">&lt;input</span> <span style="color: #4070a0">type=&quot;hidden&quot;</span> <span style="color: #4070a0">name=&quot;</span><span style="color: #007020">{{</span> <span style="color: #bb60d5">stage_field</span> <span style="color: #007020">}}</span><span style="color: #4070a0">&quot;</span> <span style="color: #4070a0">value=&quot;2&quot;</span> <span style="color: #062873; font-weight: bold">/&gt;</span>
  <span style="color: #062873; font-weight: bold">&lt;input</span> <span style="color: #4070a0">type=&quot;hidden&quot;</span> <span style="color: #4070a0">name=&quot;</span><span style="color: #007020">{{</span> <span style="color: #bb60d5">hash_field</span> <span style="color: #007020">}}</span><span style="color: #4070a0">&quot;</span> <span style="color: #4070a0">value=&quot;</span><span style="color: #007020">{{</span> <span style="color: #bb60d5">hash_value</span> <span style="color: #007020">}}</span><span style="color: #4070a0">&quot;</span> <span style="color: #062873; font-weight: bold">/&gt;</span>
  <span style="color: #062873; font-weight: bold">&lt;p&gt;&lt;input</span> <span style="color: #4070a0">type=&quot;submit&quot;</span> <span style="color: #4070a0">value=&quot;Submit&quot;</span> <span style="color: #062873; font-weight: bold">/&gt;&lt;/p&gt;</span>
<span style="color: #062873; font-weight: bold">&lt;/form&gt;</span>
</pre>

<p>This will render the <code>plain_form</code> just like a normal form, except all fields will be replaced with read-only plain text.</p>

<p>Anyway. Try <a href="http://github.com/muhuk/django-renderformplain/">renderformplain</a> and tell me what you think.</p>

<hr />

<p><strong>1</strong>: I will tag releases. Check out <a href="http://github.com/muhuk/django-renderformplain/downloads">the repository</a> for tags.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2009/05/django-formfieldset/' rel='bookmark' title='Permanent Link: django-formfieldset'>django-formfieldset</a></li>
<li><a href='http://www.muhuk.com/2010/03/whats-new-in-django-formfieldset-1-1/' rel='bookmark' title='Permanent Link: What&#8217;s New in django-formfieldset 1.1'>What&#8217;s New in django-formfieldset 1.1</a></li>
<li><a href='http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/' rel='bookmark' title='Permanent Link: Dynamic Translation Apps for Django'>Dynamic Translation Apps for Django</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2009/07/django-renderformplain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>django-formfieldset</title>
		<link>http://www.muhuk.com/2009/05/django-formfieldset/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=django-formfieldset</link>
		<comments>http://www.muhuk.com/2009/05/django-formfieldset/#comments</comments>
		<pubDate>Thu, 28 May 2009 07:20:40 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[django-formfieldset]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=234</guid>
		<description><![CDATA[django-formfieldset is a Django application that allows you define and render your forms with fieldsets. Just like in admin. To enable fieldset rendering you need to add FieldsetMixin as a parent class to your form and define a fieldsets attribute: from django import forms from formfieldset.forms import FieldsetMixin class MyForm(forms.Form, FieldsetMixin): # Fields etc... fieldsets [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/muhuk/django-formfieldset/">django-formfieldset</a> is a Django application that allows you define and render your forms with fieldsets. Just like in <code>admin</code>. To enable fieldset rendering you need to add <code>FieldsetMixin</code> as a parent class to your form and define a <code>fieldsets</code> attribute:</p>

<pre><span style="color:#000000; font-weight:bold">from</span> django <span style="color:#000000; font-weight:bold">import</span> forms
<span style="color:#000000; font-weight:bold">from</span> formfieldset<span style="color:#000000">.</span>forms <span style="color:#000000; font-weight:bold">import</span> FieldsetMixin


<span style="color:#000000; font-weight:bold">class</span> <span style="color:#010181">MyForm</span><span style="color:#000000">(</span>forms<span style="color:#000000">.</span>Form<span style="color:#000000">,</span> FieldsetMixin<span style="color:#000000">):</span>
    <span style="color:#838183; font-style:italic"># Fields etc...</span>

    fieldsets <span style="color:#000000">= ((</span>u<span style="color:#ff0000">'Fieldset Title'</span><span style="color:#000000">,</span>
                  <span style="color:#000000">{</span><span style="color:#ff0000">'fields'</span><span style="color:#000000">: (</span><span style="color:#ff0000">'foo'</span><span style="color:#000000">,</span> <span style="color:#ff0000">'bar'</span><span style="color:#000000">,</span> <span style="color:#ff0000">'baz'</span><span style="color:#000000">),</span>
                   <span style="color:#ff0000">'description'</span><span style="color:#000000">:</span> u<span style="color:#ff0000">'This is the description for fieldset.'</span><span style="color:#000000">}),</span>
                 <span style="color:#000000">(</span><span style="color:#000000; font-weight:bold">None</span><span style="color:#000000">,</span>
                  <span style="color:#000000">{</span><span style="color:#ff0000">'fields'</span><span style="color:#000000">: (</span><span style="color:#ff0000">'some_field'</span><span style="color:#000000">,),</span>
                   <span style="color:#ff0000">'description'</span><span style="color:#000000">:</span> u<span style="color:#ff0000">'This fieldset has no title.'</span><span style="color:#000000">}),</span>
                 <span style="color:#000000">(</span>u<span style="color:#ff0000">'Fieldset With No Description'</span><span style="color:#000000">,</span>
                  <span style="color:#000000">{</span><span style="color:#ff0000">'fields'</span><span style="color:#000000">: (</span><span style="color:#ff0000">'some_other_field'</span><span style="color:#000000">,)}))</span></pre>

<p>Then you can render your form with fieldset enabled methods:</p>

<pre><code>&lt;form method="POST" action=""&gt;&lt;table&gt;{{ form.as_fieldset_table }}&lt;/table&gt;&lt;/form&gt;
</code></pre>

<p>It is far from complete<sup>1</sup>, but feel free to <a href="http://github.com/muhuk/django-formfieldset/tree/master">download</a> and play with it.</p>

<hr />

<p><strong>1</strong>: Not released yet.</p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2010/03/whats-new-in-django-formfieldset-1-1/' rel='bookmark' title='Permanent Link: What&#8217;s New in django-formfieldset 1.1'>What&#8217;s New in django-formfieldset 1.1</a></li>
<li><a href='http://www.muhuk.com/2009/07/django-renderformplain/' rel='bookmark' title='Permanent Link: django-renderformplain'>django-renderformplain</a></li>
<li><a href='http://www.muhuk.com/2010/01/dynamic-translation-apps-for-django/' rel='bookmark' title='Permanent Link: Dynamic Translation Apps for Django'>Dynamic Translation Apps for Django</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2009/05/django-formfieldset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nominate Qooxdoo for SourceForge Community Choice Awards</title>
		<link>http://www.muhuk.com/2009/05/nominate-qooxdoo-for-sourceforge-community-choice-awards/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=nominate-qooxdoo-for-sourceforge-community-choice-awards</link>
		<comments>http://www.muhuk.com/2009/05/nominate-qooxdoo-for-sourceforge-community-choice-awards/#comments</comments>
		<pubDate>Sat, 16 May 2009 08:00:34 +0000</pubDate>
		<dc:creator>Atamert Ölçgen</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[qooxdoo]]></category>
		<category><![CDATA[ria]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://www.muhuk.com/?p=215</guid>
		<description><![CDATA[I&#8217;ve just voted Qooxdoo for Most Likely to Change the Way You Do Everything category. You can use the link below to vote yourself: Related posts:Why Not To Localize Community Support Using Layouts In Qooxdoo &#8211; Part 1 Using Layouts In Qooxdoo &#8211; Index]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just voted <a href="http://qooxdoo.org/">Qooxdoo</a> for <strong>Most Likely to Change the Way You Do Everything</strong> category.</p>

<p>You can use the link below to vote yourself:</p>

<p><a href="http://sourceforge.net/community/cca09/nominate/?project_name=qooxdoo&#038;project_url=http://qooxdoo.org/"><img src="http://sourceforge.net/images/cca/cca_nominate.png" border="0"/></a></p>


<p>Related posts:<ol><li><a href='http://www.muhuk.com/2010/04/why-not-to-localize-community-support/' rel='bookmark' title='Permanent Link: Why Not To Localize Community Support'>Why Not To Localize Community Support</a></li>
<li><a href='http://www.muhuk.com/2009/01/using-layouts-in-qooxdoo-part-1/' rel='bookmark' title='Permanent Link: Using Layouts In Qooxdoo &#8211; Part 1'>Using Layouts In Qooxdoo &#8211; Part 1</a></li>
<li><a href='http://www.muhuk.com/2009/04/using-layouts-in-qooxdoo-index/' rel='bookmark' title='Permanent Link: Using Layouts In Qooxdoo &#8211; Index'>Using Layouts In Qooxdoo &#8211; Index</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.muhuk.com/2009/05/nominate-qooxdoo-for-sourceforge-community-choice-awards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
