<?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></title>
	<atom:link href="http://simple10.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://simple10.com</link>
	<description>Keep it Simple</description>
	<lastBuildDate>Mon, 19 Oct 2009 21:10:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ordered Formsets in Google App Engine Patch</title>
		<link>http://simple10.com/2009/10/google-app-engine-patch-django-formsets/</link>
		<comments>http://simple10.com/2009/10/google-app-engine-patch-django-formsets/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 20:55:53 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[appenginepatch]]></category>
		<category><![CDATA[googleappengine]]></category>

		<guid isPermaLink="false">http://simple10.com/?p=105</guid>
		<description><![CDATA[The current version (1.1RC) of Google App Engine Patch does not allow for easy ordering of forms in formsets.  Normally, Django obeys a model&#8217;s Meta.ordering property as the default for formset data.  However, Google App Engine Patch fetches unordered data by default.

There may already be an undocumented solution from the Google App Engine Patch team, [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>The current version (1.1RC) of <a href="http://code.google.com/p/app-engine-patch/">Google App Engine Patch</a> does not allow for easy ordering of forms in formsets.  Normally, Django obeys a model&#8217;s Meta.ordering property as the default for formset data.  However, Google App Engine Patch fetches unordered data by default.<br />
<span id="more-105"></span><br />
There may already be an undocumented solution from the Google App Engine Patch team, but here&#8217;s a slick unobtrusive workaround that provides a lot of flexibility.</p>
<p>First off, we need a new Formset class and formset factory function &#8230;</p>
<pre language="python" line="1">
# formsets.py
from django.forms.models import inlineformset_factory
from django.forms.models import BaseInlineFormSet

class OrderedFormset(BaseInlineFormSet):
    def __init__(self, data=None, files=None, instance=None,
                 save_as_new=False, prefix=None):
        qs = ()
        if hasattr(self.form, 'Meta') and hasattr(self.form.Meta, 'ordering'):
            qs = instance.__getattribute__(self.model.__name__.lower()+'_set')
            for i in self.form.Meta.ordering:
                qs.order(i)
        self.instance = instance
        self.save_as_new = save_as_new
        super(BaseInlineFormSet, self).__init__(data, files, prefix=prefix, queryset=qs)

def orderedformset_factory(parent_model, model, **kwargs):
    kwargs['formset'] = OrderedFormset
    fs = inlineformset_factory(parent_model, model, **kwargs)
    return fs
</pre>
<p>Usage is as simple as specifying formset_factory=orderedformset_factory for each formset field&#8230;</p>
<pre language="python" line="1">
# forms.py
from formsets import orderedformset_factory

class GuestForm(forms.ModelForm):
    confirmed = forms.BooleanField(required=False)
    class Meta:
        model = Guest
        ordering = ('first_name',)

class EventForm(forms.ModelForm):
    guests = FormSetField(Guest, form=GuestForm, extra=10, can_order=False, formset_factory=orderedformset_factory)
    class Meta:
        model = Event
        ordering = ('number',)
EventForm = FormWithSets(EventForm)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://simple10.com/2009/10/google-app-engine-patch-django-formsets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HiveMaps Makes Google Maps Easy</title>
		<link>http://simple10.com/2009/09/hivemaps-makes-google-maps-easy/</link>
		<comments>http://simple10.com/2009/09/hivemaps-makes-google-maps-easy/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 19:08:36 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[maps]]></category>

		<guid isPermaLink="false">http://simple10.com/?p=103</guid>
		<description><![CDATA[Just released HiveMaps.  An open source JavaScript framework for Google Maps that makes it super easy to put thousands of data points on a map.  HiveMaps supports client-side marker clustering, back button, dynamic marker lists, geocoding, embedding, and smart handling of overlapping markers.
HiveMaps currently uses an improved version of MarkerClusterer available in the source code [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Just released <a href="http://socialhive.org/hivemaps">HiveMaps</a>.  An open source JavaScript framework for Google Maps that makes it super easy to put thousands of data points on a map.  HiveMaps supports client-side marker clustering, back button, dynamic marker lists, geocoding, embedding, and smart handling of overlapping markers.</p>
<p>HiveMaps currently uses an improved version of <a href="http://googlegeodevelopers.blogspot.com/2009/04/markerclusterer-solution-to-too-many.html">MarkerClusterer</a> available in the <a href="http://code.google.com/p/hivemap/source/browse/trunk/js/markerclusterer.js">source code repo</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://simple10.com/2009/09/hivemaps-makes-google-maps-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hat Creek Paragliding</title>
		<link>http://simple10.com/2009/08/hat-creek-paragliding/</link>
		<comments>http://simple10.com/2009/08/hat-creek-paragliding/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 19:52:35 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://simple10.com/?p=90</guid>
		<description><![CDATA[
Hat Creek, California.  July 24-27, 2009.  Paragliding trip with Jeff Greenbaum and crew.  HD version viewable on Vimeo.
]]></description>
			<content:encoded><![CDATA[<p></p><p><object width="400" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5868940&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5868940&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><br /></p>
<p><a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=hat+creek,+ca&amp;sll=42.939444,-104.369167&amp;sspn=0.576062,1.284027&amp;g=hat+creek&amp;ie=UTF8&amp;ll=40.805266,-121.507373&amp;spn=0.018613,0.040126&amp;t=h&amp;z=15&amp;iwloc=A">Hat Creek, California</a>.  July 24-27, 2009.  Paragliding trip with <a href="http://www.paragliding-lessons.com/">Jeff Greenbaum</a> and crew.  <a href="http://www.vimeo.com/5868940">HD version</a> viewable on Vimeo.</p>
]]></content:encoded>
			<wfw:commentRss>http://simple10.com/2009/08/hat-creek-paragliding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bay Area Backpacking</title>
		<link>http://simple10.com/2009/05/bay-area-backpacking/</link>
		<comments>http://simple10.com/2009/05/bay-area-backpacking/#comments</comments>
		<pubDate>Fri, 22 May 2009 19:17:57 +0000</pubDate>
		<dc:creator>joe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://simple10.com/?p=81</guid>
		<description><![CDATA[
Google Map with trails
Yolo County (Cache Creek) hiking &#38; camping
Cache Creek BLM

]]></description>
			<content:encoded><![CDATA[<p></p><ul>
<li><a href="http://maps.google.com/maps/ms?ie=UTF8&amp;hl=en&amp;msa=2">Google Map with trails</a></li>
<li><a href="http://www.yolohiker.org/">Yolo County</a> (Cache Creek) hiking &amp; camping</li>
<li><a href="http://www.blm.gov/ca/st/en/fo/ukiah/cachecreek.html">Cache Creek BLM</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://simple10.com/2009/05/bay-area-backpacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
