<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>mikepk</title>
	<atom:link href="http://mikepk.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mikepk.com</link>
	<description>Web Tech, Programming, Boston Startups, Entrepreneurship and Random Musings</description>
	<lastBuildDate>Sun, 08 Aug 2010 15:40:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Python Django noob: custom forms, errors, and fieldsets</title>
		<link>http://mikepk.com/2010/08/python_django_forms_errors_fieldsets/</link>
		<comments>http://mikepk.com/2010/08/python_django_forms_errors_fieldsets/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 14:35:21 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=808</guid>
		<description><![CDATA[I recently decided to take a break from my own, somewhat-custom, python, web framework to play around with Django. I&#8217;ve been doing some contracting work, and the most popular web framework for Python seems to be Django. I decided that it would be worth my time to actually build something real using it (other than [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently decided to take a break from my own, somewhat-custom, python, web framework to play around with <a href="http://www.djangoproject.com/">Django</a>. I&#8217;ve been doing some contracting work, and the most popular web framework for Python seems to be Django. I decided that it would be worth my time to actually build something real using it (other than just a tutorial) to get some deeper familiarity with it (and maybe to lift ideas for PyBald).</p>
<p>There are a lot of things to like about Django, I&#8217;m saving those up for another post. This post is about how I just burned several hours trying to do a few things that seemed like they should be simple but turned out to be oddly frustrating at times. Im sure that part of this is just not being Django-expert-enough to have seen the obvious answers but the task at hand seemed simple enough: creating a user registration form for my application. (Yes I know there&#8217;s a user registration django app, but this seemed like a trivial task that should be easy with a good framework)</p>
<h3>Custom Forms and Error Display</h3>
<p><img src="http://mikepk.com/wp-content/uploads/2010/08/django_form.png" alt="django_form.png" title="django_form.png" border="0" width="236" height="226"  style="border: 1px solid #CCC; float:right; margin-left: 1em; margin-bottom: 0.5em" />I started down the rabbit hole when I decided I didn&#8217;t really like the default way Django renders forms. There are a couple of options (<code>as_table</code>, <code>as_p</code>, <code>as_ul</code>), but whether displaying as a table, a list, or as &lt;p&gt; tags, the form layout didn&#8217;t match what I was used to. I know tables are often used for layout, but I really try and keep them for tabular data whenever possible. I also generally like to reserve &lt;p&gt; tags for actual text/content paragraphs and prefer &lt;div&gt; tags for logical divisions in a document. Might be nit-picky, but that seems more semantic to me.</p>
<p> <img src="http://mikepk.com/wp-content/uploads/2010/08/Django_form_errors.png" alt="Django_form_errors.png" title="Django_form_errors.png" border="0" width="234" height="282" style="border: 1px solid #CCC; float:right; margin-left: 1em; margin-bottom: 0.5em" /> I could have lived with one of the default renderings but I found that I also wasn&#8217;t crazy about the way Django handles validation error display by default. Normally Django spits out a <code>&lt;ul&gt;</code> list of field errors with a css class of &#8220;errorlist&#8221; right above the offending field (or at the top of the form for general errors). Since the errors are only tied to the field by proximity, there&#8217;s no way to call out the offending field directly. With some styling, I could have made the error list clearer, but I still wasn&#8217;t crazy about this pattern.</p>
<p>When designing forms, I like to provide a small amount of usability by highlighting the error field in some way with an error style. At first I could find no way to do this with the default form rendering. Later I figured out that you can modify the widget tied to the field, but that seemed like putting too much display logic in the controller. It also seemed to require a lot of code repetition, putting this piece of code anywhere a form was instantiated and validated. I thought about creating a custom subclass of the form but that seemed heavy handed and I definitely didn&#8217;t want to alter Django internals. It also required playing with the <em>two</em> different kinds of field objects that come out of a form (more on that later).</p>
<div>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">for</span> field <span style="color: #ff7700;font-weight:bold;">in</span> form:
     <span style="color: #ff7700;font-weight:bold;">if</span> field.<span style="color: black;">errors</span>:
        f.<span style="color: black;">fields</span><span style="color: black;">&#91;</span>field.<span style="color: black;">name</span><span style="color: black;">&#93;</span>.<span style="color: black;">widget</span>.<span style="color: black;">attrs</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'class'</span><span style="color: black;">&#93;</span> = <span style="color: #483d8b;">&quot;field_error&quot;</span></pre></div></div>

<div style="margin-top:0; margin-bottom: 1em; text-align:center; font-size:.75em">Adding error css to the widgets tied to fields. Not very DRY and not very clean in the controller / view (or template) separation</div>
</div>
<p>I wanted to keep this logic in the template which meant I needed to define my own form rendering. Easy enough, I just <a href="http://docs.djangoproject.com/en/dev/topics/forms/#customizing-the-form-template">wrote my own generic form using the Django template language</a>. I generally put input fields inside <code>&lt;div&gt;</code> tags. I also add a <code>field_error</code> css class to the divs that contain inputs with errors. That lets me define both special styles to highlight that section of the form and the offending fields directly ( with css like: <code>.field_error input {} </code>), as well as use the error class as a key for special effects (like jQuery fades, etc&#8230;). </p>
<p>My initial custom form looked like this:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">{# Include the hidden fields in the form #}
{% if form.non_field_errors %}
&lt;div class=&quot;form_errors&quot;&gt;
  {% for err in form.non_field_errors %}
  &lt;div class=&quot;form_error_message&quot;&gt;{{ err }}&lt;/div&gt;
  {% endfor %}
&lt;/div&gt;	
{% endif %}
{% for hidden in form.hidden_fields %}
   {{ hidden }}
{% endfor %}
{% for field in form.visible_fields %}
  &lt;div {% if field.errors %}class=&quot;field_error&quot;{% endif %}&gt;
    {{ field.label_tag }}
    {{ field }}
    {% for err in field.errors %}
    &lt;span class=&quot;error_message&quot;&gt;{{ err }}&lt;/span&gt;
    {% endfor %}
  &lt;/div&gt;
{% endfor %}</pre></div></div>

<p>Now from the Django documentation, they <a href="http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#howto-custom-template-tags-inclusion-tags">suggest creating a custom inclusion tag to render forms like this</a>, but I held off on that for now (although it looks fairly easy). Since I&#8217;m generally producing one form per page (at the moment) I&#8217;m just using the Django include tag and including this form template into my page template where I need a form. So instead of <code>{{ form.as_ul }}</code> I&#8217;m using this: <code>{% include base_form.html %}</code>  and assuming I&#8217;m using a context variable of <code>form</code> in the outer template (or using &#8216;<code>with</code>&#8216; to override form in the include as described in the docs).</p>
<p>Getting my own error displays working, with field highlighting I was happy with, was fairly easy. Right now validation errors appear as a series of spans next to the input field, but I&#8217;ll probably change this later.</p>
<div style="text-align:center"><img src="http://mikepk.com/wp-content/uploads/2010/08/Screen-shot-2010-08-06-at-5.44.51-PM.png" alt="Screen shot 2010-08-06 at 5.44.51 PM.png" title="Screen shot 2010-08-06 at 5.44.51 PM.png" border="0" width="373" height="240" /></p>
<div style="margin-top:0; margin-bottom: 1em; text-align:center; font-size:.75em">Error css applied in the display logic. A simple yellow bg color styles allow me to highlight the error and the field.</div>
</div>
<h3>Custom Form Validation</h3>
<p>Next I started working with validation.  Since this is for a custom user registration form, the first thing I need to do is validate that the username being registered is unique. Django has the concept of validation functions that can be passed to form fields. For my own web framework I&#8217;ve been using <a href="http://docs.formalchemy.org/">FormAlchemy</a>, which has a fairly robust validation system and Django&#8217;s system is similar in some respects.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> validate_username_unique<span style="color: black;">&#40;</span>value<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">''</span><span style="color: #483d8b;">'Custom validator for user uniqueness.'</span><span style="color: #483d8b;">''</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> User.<span style="color: black;">objects</span>.<span style="color: #008000;">filter</span><span style="color: black;">&#40;</span>username=value<span style="color: black;">&#41;</span>.<span style="color: black;">exists</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">raise</span> ValidationError<span style="color: black;">&#40;</span>u<span style="color: #483d8b;">'Sorry, someone already has that [...]'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> UserRegisterForm<span style="color: black;">&#40;</span>forms.<span style="color: black;">Form</span><span style="color: black;">&#41;</span>:
    <span style="color: #808080; font-style: italic;"># [... stuff ...]</span>
    username = forms.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>validators=<span style="color: black;">&#91;</span>validate_username_unique<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;"># [... stuff ...]</span></pre></div></div>

<p>Nice and clean, this is how I expect form validation to work.</p>
<p>Next I needed to confirm that the password and password confirm fields match. Validators only take one value input, so how do I validate that the fields match? Turns out Django&#8217;s validators aren&#8217;t up to the task so you have to <a href="http://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other">plumb a little deeper into how it validates forms</a> (as a note, Django&#8217;s docs are very good, but often times the difficulty is figuring out where in the docs something may or may not live).</p>
<p>To validate based on two fields you have to override the <code>clean</code> method on your subclassed form. When you want to flag validation errors on a particular field, you set the <code>_errors['FIELDNAME']</code> on the form to flag the invalid fields. (remember that the <code>clean</code> method must return the cleaned_data member. That bit me in the rear for a while.)</p>
<div>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> UserRegisterForm<span style="color: black;">&#40;</span>forms.<span style="color: black;">Form</span><span style="color: black;">&#41;</span>:
    <span style="color: #808080; font-style: italic;"># [...stuff...]</span>
    password = forms.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>widget=forms.<span style="color: black;">PasswordInput</span><span style="color: black;">&#41;</span>
    password_confirm = forms.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>widget=forms.<span style="color: black;">PasswordInput</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> clean<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">''</span><span style="color: #483d8b;">'Required custom validation for the form.'</span><span style="color: #483d8b;">''</span>
        <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>forms.<span style="color: black;">Form</span>,<span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">clean</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">'password'</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">self</span>.<span style="color: black;">cleaned_data</span> <span style="color: #ff7700;font-weight:bold;">and</span> <span style="color: #483d8b;">'password_confirm'</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">self</span>.<span style="color: black;">cleaned_data</span>:
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">self</span>.<span style="color: black;">cleaned_data</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'password'</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!</span>= <span style="color: #008000;">self</span>.<span style="color: black;">cleaned_data</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'password_confirm'</span><span style="color: black;">&#93;</span>:
                <span style="color: #008000;">self</span>._errors<span style="color: black;">&#91;</span><span style="color: #483d8b;">'password'</span><span style="color: black;">&#93;</span> = <span style="color: black;">&#91;</span>u<span style="color: #483d8b;">'Passwords must match.'</span><span style="color: black;">&#93;</span>
                <span style="color: #008000;">self</span>._errors<span style="color: black;">&#91;</span><span style="color: #483d8b;">'password_confirm'</span><span style="color: black;">&#93;</span> = <span style="color: black;">&#91;</span>u<span style="color: #483d8b;">'Passwords must match.'</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">cleaned_data</span></pre></div></div>

<div style="margin-top:0; margin-bottom: 1em; text-align:center; font-size:.75em">validation of two dependent fields: the magic &#8216;clean&#8217; method and the _error attribute</div>
</div>
<p>So now I have a form that checks that two fields are equal or else it flags a validation error. I had to add validation logic using two different mechanisms which seems a little messy but not too bad.</p>
<div style="text-align:center">
<img src="http://mikepk.com/wp-content/uploads/2010/08/password_valid.png" alt="password_valid.png" title="password_valid.png" border="0" width="292" height="174"  /></p>
<div style="margin-top:0; margin-bottom: 1em; text-align:center; font-size:.75em">Passwords must match!</div>
</div>
<h3>Fieldsets</h3>
<p>Lastly I decided I wanted to split my form inputs into fieldsets. Generally this is considered good practice, especially for usability and accesibility. The first option would be to just write out the form by hand, including the fieldsets, but that seemed like it could be brittle and not very django-like. Django also has <a href="http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.fieldsets">some nice fieldset functionality for it&#8217;s admin app</a>, so I assumed this would be trivially easy. Google searches seemed to turn up <a href="http://stackoverflow.com/questions/518966/django-and-fieldsets-on-modelform">overly complex solutions</a> for something that seems like it should be &#8216;built in&#8217;. There&#8217;s also a library &#8216;django form-utils&#8217; that has fieldsets but I was trying to stick with generic Django forms.</p>
<div style="float:right; width: 17em; margin-left: 2em;  margin-bottom: 1em; background: #FFe; padding: 1em; border: 1px solid #FFA">This also highlights another issue I have, the way <a href="http://docs.djangoproject.com/en/dev/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names">django defines &#8216;views&#8217; and MVC</a>. Much of the logic that in my definition of MVC would live in a controller, is delegated to something called a view in django. This view has a slight muddle of display logic and model manipulation. The template isn&#8217;t considered the view, but rather it&#8217;s own entitity, a presentation layer. It seems a little weird to me but I&#8217;m getting used to it. </div>
<p>This is where my frustration level really started to rise. I became very annoyed at the philosophical position that Django has taken that Django templates <em>can&#8217;t run arbitrary python code</em>. There are arguments for why this is/isn&#8217;t a good idea in a template system, but having come from using <a href="http://www.makotemplates.org/">Mako</a> for my templating system, this limitation started to drive me a little crazy.</p>
<p>My first impulse was to create a one-off custom form and use display logic in the template to change how things were laid out.</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">&lt;fieldset&gt;&lt;legend&gt;Name&lt;/legend&gt;
{% for fieldname in ('prefix','first_name','last_name') %}
{# render the fields for this fieldset #}
{% endfor %}
&lt;/fieldset&gt;</pre></div></div>

<p>Bzzzt.</p>
<pre land="none">
TemplateSyntaxError at /register/user
Could not parse the remainder: '('prefix','first_name','last_name')' from
'('prefix','first_name','last_name')'
</pre>
<p> Django doesn&#8217;t allow you to create tuples or lists inside <code>for</code> blocks. The for tag only seems to work on iterators passed into the context. This seemed a little annoying to me since this logic seems ideally suited as <em>display logic</em> but it was forcing me to move the logic into the controller logic. I monkeyed with all sorts of ways to try and modify the display logic to no avail.</p>
<p>Then I decided to create an iterator that I could pass into the context so I could call out the individual field names.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">    fieldset = <span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'label'</span>:<span style="color: #483d8b;">'Name'</span>,<span style="color: #483d8b;">'fields'</span>:<span style="color: black;">&#40;</span><span style="color: #483d8b;">'prefix'</span>,<span style="color: #483d8b;">'first_name'</span>,<span style="color: #483d8b;">'last_name'</span><span style="color: black;">&#41;</span><span style="color: black;">&#125;</span>,<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span><span style="color: #483d8b;">'registration/user_register.html'</span>,
                             <span style="color: black;">&#123;</span><span style="color: #483d8b;">'form'</span>: f,<span style="color: #483d8b;">'fieldset'</span>:fieldset<span style="color: black;">&#125;</span>, 
                             context_instance=RequestContext<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Then in the template I tried using the names on the fields dictionary.</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">{% for set in fieldset %}
&lt;fieldset&gt;&lt;legend&gt;{{ set.legend }}&lt;/legend&gt;
{% for fieldname in set.fields %}
{{ form.fields[fieldname] }}
{% endfor %}
{% endfor %}
&lt;/fieldset&gt;</pre></div></div>

<p>Nope: <em><strong>TemplateSyntaxError</strong></em>. Again, the Django template language doesn&#8217;t like you accessing dictionary values by name in a variable block. Attributes seem OK, key values no. I&#8217;m not sure I like this &#8220;echoes of python&#8221; approach in the template language because it means learning another logic system rather than applying the full expressiveness of Python. </p>
<p>So, no dictionaries, I&#8217;ll pass the fields themselves in the fieldset as iterable objects.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">fieldset = <span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'legend'</span>:<span style="color: #483d8b;">'Name'</span>,
             <span style="color: #483d8b;">'fields'</span>:<span style="color: black;">&#40;</span>f.<span style="color: black;">fields</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'prefix'</span><span style="color: black;">&#93;</span>,
                       f.<span style="color: black;">fields</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'first_name'</span><span style="color: black;">&#93;</span>,
                       f.<span style="color: black;">fields</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'last_name'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#125;</span>,<span style="color: black;">&#41;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">{% for set in fieldset %}
&lt;fieldset&gt;&lt;legend&gt;{{ set.legend }}&lt;/legend&gt;
{% for field in set.fields %}
&lt;div&gt;
{{ field }}
&lt;/div&gt;
{% endfor %}
{% endfor %}
&lt;/fieldset&gt;</pre></div></div>

<p>Alright, no TemplateSyntaxErrors, but wait, what the&#8230;</p>
<p><img src="http://mikepk.com/wp-content/uploads/2010/08/Screen-shot-2010-08-07-at-11.21.23-AM.png" alt="Screen shot 2010-08-07 at 11.21.23 AM.png" title="Screen shot 2010-08-07 at 11.21.23 AM.png" border="0" width="508" height="147" /></p>
<p>It took a little experimentation and some object introspection but the issue here is that the form actually contains two representations of fields, bound and unbound. The code: <code>for field in form.fields</code> returns different objects than: <code>for field in form</code>. </p>
<p>Poking around the Django core I found that the iterator for a form instantiates <code>BoundField</code> objects from it&#8217;s internal fields and returns <em>those</em>. That&#8217;s what gets rendered as HTML. The <a href="http://docs.djangoproject.com/en/dev/topics/forms/#looping-over-the-form-s-fields">docs do talk a bit about this distinction</a>, but it&#8217;s mostly in passing and mentioning you have some additional methods on BoundFields.</p>
<p>Ok, so knowing I need to pass in an iterator, and that the iterator must return <code>BoundFields</code> to properly render in the template, I came up with this FieldSet class.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">forms</span>.<span style="color: black;">forms</span> <span style="color: #ff7700;font-weight:bold;">import</span> BoundField
<span style="color: #ff7700;font-weight:bold;">class</span> FieldSet<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>,form,fields,legend=<span style="color: #483d8b;">''</span>,cls=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">form</span> = form
        <span style="color: #008000;">self</span>.<span style="color: black;">legend</span> = legend
        <span style="color: #008000;">self</span>.<span style="color: black;">fields</span> = fields
        <span style="color: #008000;">self</span>.<span style="color: black;">cls</span> = cls
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__iter__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">for</span> name <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">self</span>.<span style="color: black;">fields</span>:
            field = <span style="color: #008000;">self</span>.<span style="color: black;">form</span>.<span style="color: black;">fields</span><span style="color: black;">&#91;</span>name<span style="color: black;">&#93;</span>
            <span style="color: #ff7700;font-weight:bold;">yield</span> BoundField<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">form</span>, field, name<span style="color: black;">&#41;</span></pre></div></div>

<p>So now in my &#8216;view&#8217; code I instantiate FieldSets and pass them into a new form tempalte that knows what to do with them.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">    fieldsets = <span style="color: black;">&#40;</span>FieldSet<span style="color: black;">&#40;</span>f, <span style="color: black;">&#40;</span><span style="color: #483d8b;">'prefix'</span>,<span style="color: #483d8b;">'first_name'</span>,<span style="color: #483d8b;">'last_name'</span><span style="color: black;">&#41;</span>,
                        legend=<span style="color: #483d8b;">'Name'</span>,
                        cls=<span style="color: #483d8b;">&quot;form_name_info&quot;</span><span style="color: black;">&#41;</span>,
                FieldSet<span style="color: black;">&#40;</span>f, <span style="color: black;">&#40;</span><span style="color: #483d8b;">'username'</span>,<span style="color: #483d8b;">'email'</span><span style="color: black;">&#41;</span>, 
                        legend=<span style="color: #483d8b;">&quot;User Info&quot;</span><span style="color: black;">&#41;</span>,
                FieldSet<span style="color: black;">&#40;</span>f, <span style="color: black;">&#40;</span><span style="color: #483d8b;">'password'</span>,<span style="color: #483d8b;">'password_confirm'</span><span style="color: black;">&#41;</span>, 
                        legend=<span style="color: #483d8b;">&quot;Password&quot;</span><span style="color: black;">&#41;</span> <span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> render_to_response<span style="color: black;">&#40;</span><span style="color: #483d8b;">'registration/user_register.html'</span>,
                          <span style="color: black;">&#123;</span><span style="color: #483d8b;">'form'</span>: f,<span style="color: #483d8b;">'fieldsets'</span>:fieldsets<span style="color: black;">&#125;</span>,
                          context_instance=RequestContext<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Then I wrote an alternate form template with fieldsets to include when I want to use these fieldsets:</p>

<div class="wp_syntax"><div class="code"><pre class="none" style="font-family:monospace;">{# Include the hidden fields in the form #}
{% if form.non_field_errors %}
&lt;div class=&quot;form_errors&quot;&gt;
  {% for err in form.non_field_errors %}
  &lt;div class=&quot;form_error_message&quot;&gt;{{ err }}&lt;/div&gt;
  {% endfor %}
&lt;/div&gt;
{% endif %}
{% for hidden in form.hidden_fields %}
   {{ hidden }}
{% endfor %}
{% for set in fieldsets %}
&lt;fieldset {% if set.cls %}class=&quot;{{ set.cls }}&quot;&gt;{% endif %}
  &lt;legend&gt;{{ set.legend }}&lt;/legend&gt;
  {% for field in set %}
    &lt;div{% if field.errors %} class=&quot;error&quot;{% endif %}&gt;
      {{ field.label_tag }}
      {{ field }}
      {% for err in field.errors %}
      &lt;span class=&quot;error_message&quot;&gt;{{ err }}&lt;/span&gt;
      {% endfor %}
    &lt;/div&gt;
  {% endfor %}
{% endfor %}
&lt;/fieldset&gt;</pre></div></div>

<p>And finally: voila, a form with fieldsets generated on the fly, with custom rendering, custom validators, and styled error fields.</p>
<div style="text-align:center">
<img src="http://mikepk.com/wp-content/uploads/2010/08/fieldsets_oof.png" alt="fieldsets_oof.png" title="fieldsets_oof.png" border="0" width="493" height="579" /></p>
<div style="margin-top:0; margin-bottom: 1em; text-align:center; font-size:.75em">Behold! a, well, rather unremarkable form.</div>
</div>
<p>Is this the best way to do it? I don&#8217;t know, but by the end I was just glad I got at least <em>something</em> to work. This was a first pass so I&#8217;m sure I&#8217;ll modify this over time (for example, it would probably make sense to create some kind of a FieldSet collection object that could render out a default fieldset for fields not tied to a FieldSet object).  I found this day of frustrations definitely dampened my Django enthusiasm a bit. I&#8217;m sure as I understand and accept more of Django&#8217;s design (like no python code in templates) it will get easier to work with. My initial impressions of Django still stands, it makes getting up and running <strong>very</strong> fast and easy, but it can get thorny when you deviate from &#8216;the path&#8217; at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/08/python_django_forms_errors_fieldsets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/08/django_form.png" medium="image">
			<media:title type="html">django_form.png</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/08/django_form.png" height="175" width="182" />
		</media:content>
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/08/Django_form_errors.png" medium="image">
			<media:title type="html">Django_form_errors.png</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/08/Django_form_errors.png" height="175" width="145" />
		</media:content>
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/08/Screen-shot-2010-08-06-at-5.44.51-PM.png" medium="image">
			<media:title type="html">Screen shot 2010-08-06 at 5.44.51 PM.png</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/08/Screen-shot-2010-08-06-at-5.44.51-PM.png" height="175" width="271" />
		</media:content>
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/08/password_valid.png" medium="image">
			<media:title type="html">password_valid.png</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/08/password_valid.png" height="174" width="292" />
		</media:content>
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/08/Screen-shot-2010-08-07-at-11.21.23-AM.png" medium="image">
			<media:title type="html">Screen shot 2010-08-07 at 11.21.23 AM.png</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/08/Screen-shot-2010-08-07-at-11.21.23-AM.png" height="147" width="508" />
		</media:content>
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/08/fieldsets_oof.png" medium="image">
			<media:title type="html">fieldsets_oof.png</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/08/fieldsets_oof.png" height="175" width="149" />
		</media:content>
	</item>
		<item>
		<title>Android development, can the breakneck pace continue?</title>
		<link>http://mikepk.com/2010/08/android-development-can-the-breakneck-pace-continue/</link>
		<comments>http://mikepk.com/2010/08/android-development-can-the-breakneck-pace-continue/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 14:53:21 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[handset]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=798</guid>
		<description><![CDATA[I&#8217;ve written before about Google&#8217;s strategy regarding Android but there seems to be a side effect to this strategy I hadn&#8217;t anticipated: the blistering speed with which they are innovating their core platform. The number of Android releases in such a short period of time, and the quality improvements in each release, has been nothing [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve written before about Google&#8217;s strategy regarding Android but there seems to be a side effect to this strategy I hadn&#8217;t anticipated: the blistering speed with which they are innovating their core platform. The number of Android releases in such a short period of time, and the quality improvements in each release, has been nothing short of amazing. I had assumed iPhone experience parity would take much more time to achieve.</p>
<p><img src="http://mikepk.com/wp-content/uploads/2010/08/droid.png" alt="droid.png" title="droid.png" border="0" width="406" height="262" style="float:left; margin: 0 1em 1em 0" /> Google&#8217;s free (both as in speech and as in beer) approach has allowed them the latitude to focus completely on the core of their platform, to the exclusion of almost everything else. Since they have an odd upper-hand (handset makers really have no other choice) Google has almost completely ignored their needs and requirements. This has left handset makers (and customers) somewhat in the lurch, trying to keep up with the pace. </p>
<p>Android handset customers seem resigned to the fact that when they buy the latest and greatest phone, two months later something newer, shinier, and faster will be available. An interesting part of this approach is that since support is left almost completely to the phone makers, failures in the handset experience (platform fragmentation, slow speed of Android updates, etc&#8230;) seem to be blamed primarily on the hardware makers and carriers and not Google. Not being directly coupled to the market gives Google tremendous freedom to continue on their development trajectory. </p>
<p>I think this intentional rocket-ship paced speed of development is not sustainable. I predict that the handset makers (and customers) will begin to complain, and that the dreaded Android fragmentation problems will finally start to appear. The main problem won&#8217;t be between different capabilities among handsets (although that will be a problem), but by the fact that there will be a dozen different Android versions with different capabilities all in the market simultaneously. </p>
<p>I think Google&#8217;s strategy is to bring the Android experience close to the iPhone&#8217;s (it some ways it&#8217;s already there or superior) and then have the pace of development plateau. Not because Google won&#8217;t be capable of innovating at the same rate, but because market realities will inevitably begin to intrude into the process.</p>
<p>I think several things will conspire to slow down the rate of new versions. I predict Google will have to shift some resources to testing and compliance, creating some form of Google &#8216;certified Android compatible&#8217; testing lab not unlike what Microsoft had to do with Windows. Handset makers will begin to resist the current pace of innovation by introducing new phones with versions of Android other than the latest. Carriers will continue to drag their feet updating their phones to the absolute latest Android. Unless the way handset makers and carriers do business fundamentally changes I think they will be unwilling to bear the cost of supporting and testing so many different versions of the platform. They will demand some &#8216;breathing room&#8217; to allow their investment in the current version to pay off before moving to the next.</p>
<p>Another possibility is that Google will continue to innovate along the same curve and intentionally <em>not care</em> about the business realities of their hardware and network partners. Since Google primarily wants the ad revenue from Android on mobiles, maybe they will take a hands off approach and let the handset makers figure out how to make their business models conform to the new realities of Android. The only problem with that is the overall mobile phone experience could be compromised. If there&#8217;s one thing the iPhone still has going for it is it&#8217;s integrated experience. </p>
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/08/android-development-can-the-breakneck-pace-continue/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/08/droid.png" medium="image">
			<media:title type="html">droid.png</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/08/droid.png" height="175" width="271" />
		</media:content>
	</item>
		<item>
		<title>Here&#8217;s a secret: you are terrible at evaluating startup ideas</title>
		<link>http://mikepk.com/2010/07/heres-a-secret-you-are-terrible-at-evaluating-startup-ideas/</link>
		<comments>http://mikepk.com/2010/07/heres-a-secret-you-are-terrible-at-evaluating-startup-ideas/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 15:26:08 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[startup]]></category>
		<category><![CDATA[angel investing]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[startups]]></category>
		<category><![CDATA[venture capital]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=791</guid>
		<description><![CDATA[Here's a secret: YOU are terrible at evaluating startup ideas. Yes, you. Now don't get defensive, there's a reason why I know you are terrible at it, you are a human being. So pardon me when, as an entrepreneur, I dismiss your description of my startup as a "dipshit company"]]></description>
			<content:encoded><![CDATA[<p></p><p>Yes, <strong>you</strong>. Now don&#8217;t get defensive, there&#8217;s a reason why I know you are terrible at it, you are a human being. So pardon me when, as an entrepreneur, I dismiss your description of my startup as a <a href="http://venturebeat.com/2010/07/29/angelconf-ron-conway-michael-arrington/">&#8220;dipshit company&#8221;</a>, especially when it&#8217;s a judgement based on a five second cursory examination. Everyone likes to think they know a good idea / good startup when they see one. Everyone is wrong. </p>
<p><em>Here&#8217;s another secret:</em> the people who seemingly make their living by evaluating startup ideas, they&#8217;re terrible at it too. You know how I know? They&#8217;re human beings too.</p>
<p>&#8220;Wait a second&#8221;, I hear you counter, &#8220;what about all the money made by venture capitalists?&#8221; Well there&#8217;s a phenomenon that deserves a little attention, but the key is, they don&#8217;t actually make their money by evaluating startup <em>ideas</em>. VC&#8217;s have learned to make money from startups with a <em>system</em>. A system not that unlike a <em>gambling system</em>. VC&#8217;s use a large bankroll (like professional gamblers) and evaluate factors that tip odds of success (and especially really big success) slightly in their favor. The idea is <strong>not</strong> one of them. I think in their heart of hearts, most VC&#8217;s know they&#8217;re no good at evaluating startup ideas. In fact, I would argue the most dangerous and inept VC&#8217;s are the one&#8217;s that think they <em>can</em> evaluate what a good idea is (and I think this is why Angel investors traditionally lose money). </p>
<p><em>Here&#8217;s my last secret:</em> those crazy sons&#8217;o'bitches that are pouring their heart and soul into starting something? They&#8217;re no good at judging startup ideas either. </p>
<p><a href="http://baltimoreprintstudios.com/2010/05/strategic-plan-posters-are-back/"><br />
<img src="http://mikepk.com/wp-content/uploads/2010/07/strategic_plan1.jpg" alt="strategic_plan.jpg" title="strategic_plan.jpg" border="0" width="250" height="354" style="float:left; margin:0 1em 1em 0" /></a>Hey we&#8217;re human too. What we do have is passion. We&#8217;ve also learned that by <strong>doing things</strong>, <a href="http://www.sllconf.com/">by learning through experimentation</a>, we can figure out why our idea sucks (because 99% of the time it does) and how to make it better. This is the core of the <a href="http://www.startuplessonslearned.com/">lean startup movement</a>, and historically how the majority of companies have risen to greatness (with something *other* than their initial idea).</p>
<p>This mini rant was inspired by Fred Wilson; &#8220;<a href="http://www.avc.com/a_vc/2010/07/lead-investors-dipshit-companies-and-funding-every-entrepreneur.html">Lead Investors, Dipshit Companies, and Funding Every Entrepreneur</a>&#8220;. When we were building <a href="http://bit.ly/aUqiIb">Grazr</a>, all those years ago, it was intensely frustrating all of the drive-by-idea-critiques that never bothered to dig into what we were really offering. We made a ton of mistakes, but the initial idea wasn&#8217;t one of them.  </p>
<p>Here&#8217;s the part I really like that resonates with me:</p>
<blockquote style="clear:both"><p>
Mike Arrington expressed the contrary opinion, apparently held by many VCs (not me), that this mini explosion in angel investing is creating a bunch of &#8220;dipshit companies.&#8221; I don&#8217;t know what a dipshit company is. I haven&#8217;t seen one. If you listen to the chatter on the Techcrunch comment threads, you will see that people think Twitter and Foursquare are dipshit companies. Fine. Many great companies have been built on a wall of derision and I personally think those two are going to join that list of laughed at great companies (and maybe already have). My point is you just don&#8217;t know what is a crazy idea and what is a brilliant idea. And you don&#8217;t know what is a great team and what is a weak team. Of course, we have our opinions on that. We make those judgment calls every day. But we are often wrong. VCs are wrong more often than they are right. It is good for VCs if 10x or 100x companies get angel funding. That is more opportunity for us.
</p></blockquote>
<p>Always love Fred&#8217;s perspective.</p>
<hr style="border:none; clear:both" />
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/07/heres-a-secret-you-are-terrible-at-evaluating-startup-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content type="image/jpeg" url="http://mikepk.com/wp-content/uploads/2010/07/strategic_plan1.jpg" medium="image">
			<media:title type="html">strategic_plan.jpg</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/07/strategic_plan1.jpg" height="175" width="123" />
		</media:content>
	</item>
		<item>
		<title>Steve Blank on startup business plan competitions</title>
		<link>http://mikepk.com/2010/07/steve-blank-on-startup-business-plan-competitions/</link>
		<comments>http://mikepk.com/2010/07/steve-blank-on-startup-business-plan-competitions/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 13:32:00 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[startup]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[business plan]]></category>
		<category><![CDATA[competitions]]></category>
		<category><![CDATA[lean startup]]></category>
		<category><![CDATA[pitch]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[startups]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=785</guid>
		<description><![CDATA[I stumbled across a post by Steve Blank of the Lean Startup movement and "Four Steps to the Epiphany" fame talking about business plan competitions: "No One Wins In Business Plan Competitions". Steve's argument is that business plan competitions are mapping the success methodology of big companies onto startups: operation and execution on known opportunities.]]></description>
			<content:encoded><![CDATA[<p></p><p>I stumbled across <a href="http://steveblank.com/2010/05/17/no-one-wins-in-business-plan-competitions/">a post by Steve Blank</a> of the <a href="http://www.sllconf.com/">Lean Startup movement</a> and <a href="http://www.amazon.com/Four-Steps-Epiphany-Steven-Blank/dp/0976470705/ref=sr_1_1?ie=UTF8&#038;s=books&#038;qid=1280409274&#038;sr=8-1">&#8220;Four Steps to the Epiphany&#8221;</a> fame talking about business plan competitions. Considering I&#8217;ve had <a href="http://mikepk.com/2010/07/something-about-startup-competitions-just-doesnt-feel-right/">my own misgivings</a> about them, I thought it was interesting to read another take on what may be wrong with these kinds of competitions. Steve&#8217;s argument is that business plan competitions are mapping the success methodology of big companies onto startups: operation and execution on known opportunities.</p>
<blockquote><p>Almost every university, region and car wash now has a business plan&nbsp;competition; the rules, who can&nbsp;participate, how large the prizes and who are the judges vary by school.</p>
<p>Business plan competitions perpetuate <a href="http://www.hbs.edu/entrepreneurship/bplan/judgeandprizes.html" target="_blank">everything that is wrong</a> about trying to make plans that were designed to be used in large companies fit startups. (One of my favorites: “<a href="http://www.hbs.edu/entrepreneurship/bplan/downloads/JudgingScore-EvaluationSheet--UPDATED-WEB.pdf" target="_blank">Judging will include such factors</a> as: Market opportunity, reward to risk, strategy, implementation plan, financing plan, etc.”) All of which may be true in large companies. But little of it is relevant to the&nbsp;chaos and uncertainty in the life of a startup.</p>
<div>&#8211; <a href="http://steveblank.com/2010/05/17/no-one-wins-in-business-plan-competitions/">No One Wins In Business Plan Competitions « Steve Blank</a></div>
</blockquote>
<p>He proposes an alternative kind of competition: The Business <em>Model</em> Competition. This kind of competition would focus on startups actually building their product or testing their business ideas in some way to learn what their real business model should be. To me, that seems to map much more closely to the actual process of building a startup. </p>
<blockquote><p>For the first time we’d have a competition that closely resembled the reality that founders face, rather than a creative writing exercise.</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/07/steve-blank-on-startup-business-plan-competitions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>The Grazr widget will stop functioning</title>
		<link>http://mikepk.com/2010/07/the-grazr-widget-will-stop-functioning/</link>
		<comments>http://mikepk.com/2010/07/the-grazr-widget-will-stop-functioning/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 20:25:18 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[grazr]]></category>
		<category><![CDATA[opml]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[shutdown]]></category>
		<category><![CDATA[startup]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=783</guid>
		<description><![CDATA[ Sadly, Grazr.com is currently in the process of shutting down. Grazr the company has no official blog anymore so I've decided to write about the news. The truth is Grazr and the Grazr Widget have not been a focus of the company for a long time and it appears that the company can no longer justify the expense of keeping it running.]]></description>
			<content:encoded><![CDATA[<p></p><p><strong>Note: <a href="http://mikepk.com/2009/06/its-tough-to-make-predictions-especially-about-the-future/">I have not been a part of day-to-day operations at Grazr.corp for over a year now</a> and am not speaking for the company in any way</strong>.</p>
<p><img src="http://mikepk.com/wp-content/uploads/2010/07/rss_opml.png" alt="rss_opml.png" title="rss_opml.png" border="0" width="162" height="168" style="float:left;margin:0 1em 1em 0" />Even though I&#8217;m no longer with the company, I&#8217;ve been asked by several people now what&#8217;s happening with Grazr. Sadly, <a href="http://grazr.com">Grazr.com</a> is currently in the process of shutting down.  Grazr the company has no official blog anymore so I&#8217;ve decided to write about the news. The truth is Grazr and the Grazr Widget have not been a focus of the company for a long time and it appears that the company can no longer justify the expense of keeping it running. Even with the low costs of servers and hosting these days, it still costs something to keep the service up, fast, and reliable. </p>
<div style="float:right;padding:0;margin: 1em 0 1em 2em;text-align:center"><img src="http://mikepk.com/wp-content/uploads/2010/07/Widget_notice.png" alt="Widget_notice.png" title="Widget_notice.png" border="0" width="272" height="187" />
<div style="font-size:.75em; width:272px">All Grazr widgets across the web are now displaying a message that the service will cease to function on July 31st.</div>
</div>
<p>Now, as the original author of the Grazr widget, to say this makes me sad is an understatement. I&#8217;ve toyed with the idea of writing a new service + widget, one that performs many of the same functions of the original Grazr widget, but I decided for various reasons it wasn&#8217;t right for me to do it. Now that the company has officially decided to shut down Grazr and the widget, it&#8217;s gotten me thinking about putting something together again, primarily as a side hobby. </p>
<p>I&#8217;m writing this post partially to gauge interest in such a project. Even as a side hobby, I&#8217;d need to explore how this new RSS/OPML service could be made sustainable, some kind of a pay component. I&#8217;m not sure exactly what that would be, but at a minimum it would need to cover the cost of the servers. Realistically I can&#8217;t afford to run this new project out of pocket so I would need some kind of support to make it happen. I&#8217;m interested in ideas as well as what premium services people would be interested in. </p>
<p>I know a common response will likely be &#8220;advertising&#8221;, but advertising is a trickier business model than most people realize. Even if I were to pursue an advertising model, starting this new service from scratch I can&#8217;t afford to pay the initial ramp up period before that kind of business model could potentially become sustainable. </p>
<p>More than likely, this will mark the end of the &#8220;super&#8221; RSS/OPML widget. I don&#8217;t think anyone has really tapped into the deep potential in the combination of OPML and RSS. The nature of this kind of service requires a large free base, and I&#8217;m not convinced people feel they get enough value from it that they&#8217;d be willing to support / pay. It&#8217;s sad, but it may just be time for me to keep moving forward with my <a href="http://mikepk.com/current-projects/">other projects</a> and wish Grazr.com and the widget a fond farewell.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/07/the-grazr-widget-will-stop-functioning/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
	
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/07/rss_opml.png" medium="image">
			<media:title type="html">rss_opml.png</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/07/rss_opml.png" height="168" width="162" />
		</media:content>
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/07/Widget_notice.png" medium="image">
			<media:title type="html">Widget_notice.png</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/07/Widget_notice.png" height="175" width="254" />
		</media:content>
	</item>
		<item>
		<title>Boston Downtown</title>
		<link>http://mikepk.com/2010/07/boston-downtown/</link>
		<comments>http://mikepk.com/2010/07/boston-downtown/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 17:52:56 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[boston]]></category>
		<category><![CDATA[city]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[iphone4]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=775</guid>
		<description><![CDATA[Took this picture the other day while we were driving around downtown. I love the light, the mixture of old and new architecture as well as the perspective. I'm not generally a good photographer but I thought this one turned out pretty cool. (Oh and it's a pic with my new iPhone 4)]]></description>
			<content:encoded><![CDATA[<p></p><p>I took this picture the other day while we were driving around downtown. I love the light, the mixture of old and new architecture as well as the perspective. I&#8217;m not generally a good photographer but I thought this one turned out pretty cool. (Oh, and it&#8217;s a pic with my new iPhone 4)</p>
<p>
<a href="http://www.flickr.com/photos/7530902@N03/4828449265/" title="Downtown Boston by mike007pk, on Flickr"><img src="http://farm5.static.flickr.com/4114/4828449265_eaf9fe5f19_z.jpg" width="478" height="640" alt="Downtown Boston" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/07/boston-downtown/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content type="image/jpeg" url="http://farm5.static.flickr.com/4114/4828449265_eaf9fe5f19_z.jpg" medium="image">
			<media:title type="html">Downtown Boston</media:title>
			<media:thumbnail url="http://farm5.static.flickr.com/4114/4828449265_eaf9fe5f19_z.jpg" height="175" width="130" />
		</media:content>
	</item>
		<item>
		<title>Something about startup competitions just doesn&#8217;t feel right</title>
		<link>http://mikepk.com/2010/07/something-about-startup-competitions-just-doesnt-feel-right/</link>
		<comments>http://mikepk.com/2010/07/something-about-startup-competitions-just-doesnt-feel-right/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 19:38:41 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[startup]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[business plan]]></category>
		<category><![CDATA[competitions]]></category>
		<category><![CDATA[pitch]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[startups]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=767</guid>
		<description><![CDATA[the process for competing in business plan or startup competitions is only tangentially related to what really needs to be done to launch a real, viable startup. I have a feeling that excelling in the environment of these kinds of competitions is, at best, inefficient use of time and effort and at worst, teaching potential entrepreneurs the wrong things to focus on for launching a company.]]></description>
			<content:encoded><![CDATA[<p></p><p>It&#8217;s tough to put my finger on exactly what it is. I think it comes down to one simple question: What is the objective of a startup (or business plan) competition? Is the objective to generate interest in entrepreneurship, to get more people talking about startups and interested in the process? Or is the goal to provide validation for startups and indicate, in some way, that some startups can be judged to be more likely to succeed than others. </p>
<p>It seems like the process for competing in business plan or startup competitions is only tangentially related to what really needs to be done to launch a real, viable startup. If your goal is to launch a company, which I assume is the goal of most of the participants, then I have a feeling that excelling in the environment of these kinds of competitions is, at best, inefficient use of time and effort and at worst, teaching potential entrepreneurs the <em>wrong things to focus on for launching a company</em>.</p>
<p>Of course, this is assuming that there isn&#8217;t a strong correlation between winning or placing in a startup competition and general success as a startup company. I wonder if the success rate of companies participating in startup competitions is any different from startups &#8220;in the wild&#8221; and if this data is available somewhere.</p>
<p>This unsettling feeling with regards to startup competitions was recently stirred up again after attending the <a href="http://bostinnovation.com/2010/06/24/momentum-summit-2010-features-great-content-for-startup-founders/">Momentum Summit</a> put on by <a href="http://www.boston.com/business/technology/kirsner/">Scott  Kirsner</a>. One of the guest speakers was the <a href="http://www.akamai.com/html/about/management_tl.html">Chief Scientist</a> at <a href="http://www.akamai.com/">Akamai</a>. He spoke about the startup history of that company and talked briefly about the MIT 100K competition (then called the 50K) <s>at Sloan</s>, a club program at MIT. I&#8217;d often heard Akamai trumpeted as one of the success stories of that particular competition. At one point he said something to the effect of &#8220;The common mythology is that we won the 100K competition, the truth is, we didn&#8217;t even place in the final round.&#8221;</p>
<p>Akamai is interesting from a couple of perspectives. The first, if we&#8217;re assuming that startup competitions are for generating interest and entrepreneurial activity, it was clear from the story that Akamai would never have happened if it wasn&#8217;t for the impulse from the 100K competition. On the other hand, one of the most successful companies to emerge from the 100K was eliminated, and didn&#8217;t even place in the competition. Granted that&#8217;s only a single sample, but does it maybe indicate that winning such a competition has no real correlation to success as a company? In that light, what does it mean to <em>win</em> a startup competition? If winning is relatively meaningless from the perspective of startup success, what&#8217;s the impetus to participate for people for whom that&#8217;s the <em>real</em> goal?</p>
<p>Startup competitions are popular because they overlay structure, clear rules for winning and losing over an inherently messy and unpredictable process. I think that&#8217;s why most schools and governments like startup competitions, they make the unpredictable predictable and establish a clear way to crown winners and losers. Startup success is, unfortunately, a very messy and unpredictable affair.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/07/something-about-startup-competitions-just-doesnt-feel-right/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
	</item>
		<item>
		<title>Startup Accelerator: Anything Goes Lab two week pilot</title>
		<link>http://mikepk.com/2010/07/startup-accelerator-anything-goes-lab-two-week-pilot/</link>
		<comments>http://mikepk.com/2010/07/startup-accelerator-anything-goes-lab-two-week-pilot/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 05:12:22 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[startup]]></category>
		<category><![CDATA[accelerator]]></category>
		<category><![CDATA[bill warner]]></category>
		<category><![CDATA[boston]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[cambridge]]></category>
		<category><![CDATA[cic]]></category>
		<category><![CDATA[startups]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=765</guid>
		<description><![CDATA[I&#8217;ve been trying to &#8220;hack the startup process&#8221; with a new kind of startup lab for a few months now. As part of the process of trying to launch TenZeroLab, I&#8217;ve been talking to a lot of people, pitching and describing the concepts behind it. Recently I started getting one particular piece of feedback: &#8220;Talk [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve been trying to &#8220;hack the startup process&#8221; with a <a href="http://tenzerolab.com">new kind of startup lab</a> for a few months now. As part of the process of trying to launch TenZeroLab, I&#8217;ve been talking to a lot of people, pitching and describing the concepts behind it. Recently I started getting one particular piece of feedback: &#8220;Talk to Bill Warner, he&#8217;s got something going on you&#8217;ll be interested in&#8221;.</p>
<p>Finally, I managed to talk briefly with Bill at <a href="http://masstlc.homestead.com/clusters/techtuesday.html">Tech Tuesday</a> this past month and he suggested I join his <a href="http://anythinggoeslab.com/">&#8220;Anything Goes Lab&#8221;</a> <a href="http://anythinggoeslab.com/"><img src="http://mikepk.com/wp-content/uploads/2010/07/agl_logo.png" alt="Anything Goes Lab" title="Yarrr Space Pirates!" border="0" width="378" height="69" style="float:left; margin: 1em 1em 1em 0" /></a> accelerator project happening at the <a href="http://www.cictr.com/">CIC</a>. Come Monday, I&#8217;m going to be participating in the two week pilot program.</p>
<p>What is it? It&#8217;s a co-working space but with a special focus on startups and teams. Bill and his partner Nick Tommarello have some interesting ideas about startups and startup formation. Many of the principles behind AGL seem to stem from Bill&#8217;s recent talks about <em>intention</em> and creating startups &#8220;from the heart&#8221;. </p>
<p>I&#8217;m not only excited to meet and work with some really interesting individuals, but also to see if I can contribute some of the ideas I&#8217;ve been working on with my own startup lab. I&#8217;ll be very interested to participate in the program, to see first hand the things that work in this environment and the things that don&#8217;t. </p>
<p>TenZeroLab and Anything Goes Lab appear to have some core principles in common, not the least of which being that we need to start helping each other. Facilitating the creation of trust-based working relationships is, I believe, <a href="http://tenzerolab.com/blog/is-the-startup-community-relying-too-much-on-fate-connecting-the-outliers/">a path to creating many more startups in the Boston area</a>.</p>
<p>There&#8217;s a lot exciting stuff happening around the Boston startup scene and I&#8217;m glad to be a part of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/07/startup-accelerator-anything-goes-lab-two-week-pilot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content type="image/png" url="http://mikepk.com/wp-content/uploads/2010/07/agl_logo.png" medium="image">
			<media:title type="html">Yarrr Space Pirates!</media:title>
			<media:thumbnail url="http://mikepk.com/wp-content/uploads/2010/07/agl_logo.png" height="69" width="378" />
		</media:content>
	</item>
		<item>
		<title>Tilt to Live &#8211; favorite iPhone game so far</title>
		<link>http://mikepk.com/2010/06/tilt-to-live-favorite-iphone-game-so-far/</link>
		<comments>http://mikepk.com/2010/06/tilt-to-live-favorite-iphone-game-so-far/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 16:59:43 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[casual game]]></category>
		<category><![CDATA[entertainmen]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iphone app]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=732</guid>
		<description><![CDATA[Overall it's a very high-quality game. The graphics are simple but satisfying. The music is fun. There are little tongue-in-cheek "Awards" you unlock for various game events. When you get enough awards, you unlock new weapons. Even though it's accelerometer-based, the control isn't twitchy or annoying. The game has enough twists and strategy to keep me trying that just... one... more... time...  ]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve dowloaded a coupe of iPhone games, but none have really grabbed me like <a href="http://www.onemanleft.com/tilttolive/index.php">&#8220;Tilt to Live&#8221;</a> from <a href="http://www.onemanleft.com/">One Man Left Studios</a>. </p>
<p><img style="float:left; margin: 0 1em 1em 0" src="http://www.onemanleft.com/css/../images/tilttolive/spike_shield.png" alt="Tilt to Live" /> The gameplay is really simple, you tilt the iphone to steer your little &#8220;arrow&#8221; ship to trigger weapons to destroy &#8220;the evil red dots&#8221;. You have one life, touch any red dot and it&#8217;s game over. </p>
<p>Overall it&#8217;s a very high-quality game. The graphics are simple but satisfying. The music is fun. There are little tongue-in-cheek &#8220;Awards&#8221; you unlock for various game events. When you get enough awards, you unlock new weapons. Even though it&#8217;s accelerometer-based, the control isn&#8217;t twitchy or annoying. The game has enough twists and strategy to keep me trying that just&#8230; one&#8230; more&#8230; time&#8230;  </p>
<p><a href="http://itunes.apple.com/us/app/tilt-to-live/id335454448?mt=8">It&#8217;s available for $0.99 in the iTunes store</a>.</p>
<p>Video from the One Man Left website:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/vr03CIfjK4I&#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/vr03CIfjK4I&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/06/tilt-to-live-favorite-iphone-game-so-far/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content type="image/png" url="http://www.onemanleft.com/css/../images/tilttolive/spike_shield.png" medium="image">
			<media:title type="html">Tilt to Live</media:title>
			<media:thumbnail url="http://www.onemanleft.com/css/../images/tilttolive/spike_shield.png" />
		</media:content>
	</item>
		<item>
		<title>Lackluster Startups Magazine</title>
		<link>http://mikepk.com/2010/06/lackluster-startups-magazine/</link>
		<comments>http://mikepk.com/2010/06/lackluster-startups-magazine/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 14:51:45 +0000</pubDate>
		<dc:creator>mikepk</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[startup]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[startups]]></category>

		<guid isPermaLink="false">http://mikepk.com/?p=730</guid>
		<description><![CDATA[The magazine was pretty thin and didn't really have much meat to it. If you're just curious about startups (haven't yet put any plans into action or done any research at all) this magazine might be somewhat interesting to you. The articles were OK, but not very informative or particularly inspiring. Part of the magazine was devoted to tips for getting started but these tips should be fairly well known to anyone who's been even remotely interested in startups. ]]></description>
			<content:encoded><![CDATA[<p></p><p>When I was in the airport this week I had a minute before my flight boarded and decided to get a couple of magazines. On the stands I saw <a href="http://www.entrepreneur.com/magazine/startups/index.html"><em>Startups Magazine</em></a> published by <a href="http://www.entrepreneur.com/"><em>Entrepreneur</em></a>. <img style="float:left; margin: 1em 1em 1em 0" src="http://www.entrepreneur.com/i/Images/mg/esu-summer-2010.jpg" alt="Startups magazine" /> Being a topic near and dear to my heart I decided to pick it up (didn&#8217;t have time to really flip through it). </p>
<p>The magazine was pretty thin and didn&#8217;t really have much meat to it. If you&#8217;re just curious about startups (haven&#8217;t yet put any plans into action or done any research at all) this magazine might be somewhat interesting to you. The articles were OK, but not very informative or particularly inspiring. Part of the magazine was devoted to tips for getting started but these tips should be fairly well known to anyone who&#8217;s been even remotely interested in startups. </p>
<p>I get the feeling that this magazine is an attempt to cash in on the sudden surge in the casual interest in startups. If you happen to see this on the stand and have more than a passing interest in startups, I&#8217;d recommend passing on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://mikepk.com/2010/06/lackluster-startups-magazine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content type="image/jpeg" url="http://www.entrepreneur.com/i/Images/mg/esu-summer-2010.jpg" medium="image">
			<media:title type="html">Startups magazine</media:title>
			<media:thumbnail url="http://www.entrepreneur.com/i/Images/mg/esu-summer-2010.jpg" />
		</media:content>
	</item>
	</channel>
</rss>
