<?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>This Just-in!&#187; Articles about Very Cool from This Just-in! at JustinHolmes.com</title>
	<atom:link href="http://justinholmes.com/category/very-cool/feed/" rel="self" type="application/rss+xml" />
	<link>http://justinholmes.com</link>
	<description></description>
	<lastBuildDate>Sun, 04 Jul 2010 23:08:44 +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>A rare example of &#8220;magic&#8221; and Gnosticism in Django</title>
		<link>http://justinholmes.com/2010/07/a-rare-example-of-magic-and-gnosticism-in-django/</link>
		<comments>http://justinholmes.com/2010/07/a-rare-example-of-magic-and-gnosticism-in-django/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 22:57:51 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[About Justin]]></category>
		<category><![CDATA[Original Writing]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Very Cool]]></category>

		<guid isPermaLink="false">http://justinholmes.com/?p=817</guid>
		<description><![CDATA[Among my personal friends, I don&#8217;t think it&#8217;s any secret that Django is currently my favorite web framework.  In particular, Django has what I believe to be the very most important element that a MVC framework can have &#8211; a solid, consistent philosophy that developers can adopt, meditate on, and integrate into their thinking as [...]]]></description>
			<content:encoded><![CDATA[<p>Among my personal friends, I don&#8217;t think it&#8217;s any secret that Django is currently my favorite web framework.  In particular, Django has what I believe to be the very most important element that a MVC framework can have &#8211; a solid, consistent philosophy that developers can adopt, meditate on, and integrate into their thinking as they proceed through any project.</p>
<p>One of the tenets of Django (albeit not a &#8220;top-level&#8221; holding like DRY, OaoO, minimal code, explicit over implicit, etc.) is that Django declines to use &#8220;Magic&#8221; unless it is overwhelmingly easier than the mundane solution that it replaces.  Django also veers toward the agnostic &#8211; meaning that one can use any naming paradigm, template strategy, URL convention, etc.</p>
<p>Exactly what techniques constitute &#8220;Magic&#8221; may be in the eye of the beholder, but generally we think of magic encompassing those techniques that are not part of a programming paradigm, but that work anyway &#8220;just because.&#8221;  Gnosticism, on the other hand, is pretty obvious when it rears itself: If you MUST use jQuery or you MUST name every variable drupal.something, you know that you are not working with an agnostic framework.</p>
<p>The SlashRoot team is currently working on a great project for Carbon Ads &#8211; a project that aims to enable small publishers to collectively sell ad space to pre-vetted, exclusive, and otherwise unattainable advertisers.  Think Adsense meets your favorite organic co-op.</p>
<p>Among the interesting elements to tackle in Django, as is often challenging in MVC frameworks, in the question of how to model different types of users.</p>
<p>The lazy (inorganic) way, of course, is to simply apply a &#8220;type&#8221; attribute to the user model and then ForeignKey each individual user class.  However, this leaves tremendous room for error.  For example (and this example in fact has come up in this project) &#8211; what if the developer creating the &#8220;admin&#8221; model has a different idea of how to track names than the developer creating the &#8220;publisher&#8221; model &#8211; may one of them thinks that the full name belongs in a single field while the other separates first and last names.  This is a major problem for any page that lists all users by real name.</p>
<p>To me, the most organic solution is to separate elements into two categories: Those that two or more classes of people have vs. those that only one class of people has.  That way, the attributes in the former category can be assigned to a parent class (perhaps as an optional field) while the latter can belong exclusively in a child class, on a separate database table to enhance performance.</p>
<p>So, how does Django treat this contingency?  With magic, I&#8217;m afraid.</p>
<p>The Django <a href="http://docs.djangoproject.com/en/dev/topics/db/models/#id7">documentation on this point</a> suggests using the &#8220;lower case&#8221; name of the class in question, which has two deviations from the general Django philosophy:</p>
<p>1) It is gnostic, plain and simple.  It assumes that you have adopted upper-case or CamelCase naming conventions for your models, and that you can use lowercase as an alternative.</p>
<p>2) It seems to me to be magic.  There is no *reason* why the lower-case class name should refer to the logical question of whether or not an object is in a child class of a parent model.  It just&#8230;. works.</p>
<p>Mind you, I can deal with both these issues.  I think that the &#8220;magic&#8221; issue is of more concern to the programming purist, because it can be genuinely confusing.  Case in point, I actually had to wonder how to access the &#8220;not magic&#8221; of this solution &#8211; although &#8220;if not someobject.somelowercaseclass&#8221; does in fact return TRUE for objects outside the child class in question, it took me some time to wrap my head around this, simply because &#8220;someobject.somelowercaseclass&#8221; is not instinctively a logical value to me &#8211; the &#8220;magic&#8221; distracted my view for a moment.</p>
<p>Thus, I had this interesting (and perhaps telling, I think) exchange in #django:</p>
<blockquote>
<div id="magicdomid799"><em>&lt;jMyles&gt; Philosophical  question:  Does the ability to ask for a child class with lower-case  lettering represent &#8220;magic&#8221;?  (see: <a href="http://docs.djangoproject.com/en/dev/topics/db/models/#id7%29">http://docs.djangoproject.com/en/dev/topics/db/models/#id7)</a></em></div>
<div id="magicdomid806"><em>&lt;jMyles&gt; To rephrase my  question: Is the use of a lowercase letter to inquire about a  child-class part of an established programming technique?  Or is it a  (rare) example of magic in Django?</em></div>
<div id="magicdomid783"><em>&lt;igloo_x&gt;  jMyles&gt; what do you mean &#8220;child class&#8221;</em></div>
<div id="magicdomid768"><em>&lt;jMyles&gt; igloo_x:  Actually I mean child model</em></div>
<div id="magicdomid769"><em>&lt;jMyles&gt;  igloo_x: Like &#8220;Restaurant&#8221; becomes &#8220;restaurant&#8221; in the test in this  example: <a href="http://docs.djangoproject.com/en/dev/topics/db/models/#id7">http://docs.djangoproject.com/en/dev/topics/db/models/#id7</a></em></div>
<div id="magicdomid797"><em>&lt;jMyles&gt; igloo_x: Also,  in that example, how can I ask if the object is NOT in the child class  &#8220;restaurant&#8221;?</em></div>
<div id="magicdomid772"><em>&lt;jMyles&gt; igloo_x: I&#8217;m  looking at the third code block down from that link &#8211; &#8220;If you have a  Place  that is also a Restaurant, you can get from the Place object to  the Restaurant  object by using the lower-case version of the model  name:&#8221;</em></div>
<div id="magicdomid795"><em>&lt;igloo_x&gt; it&#8217;s magic, as  far as I know. you can override it though. I think the argument is  &#8216;related_name&#8217; or something</em></div>
<div id="magicdomid776"><em>&lt;jMyles&gt;  igloo_x: OK, that&#8217;s what I thought.  <img src='http://justinholmes.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   And then, how can I ask if an  object is NOT in that class?</em></div>
<div id="magicdomid777"><em>&lt;jMyles&gt;  igloo_x: ie, &#8220;if p.restaurant:&#8221; works fine, but how can I ask if it is  not in that child class?</em></div>
<div id="magicdomid778"><em>&lt;igloo_x&gt;  i&#8217;m not sure about that, I&#8217;ve never messed with model inheritance  before</em></div>
<div id="magicdomid779"><em>&lt;igloo_x&gt; does &#8220;if not  p.restaurant:&#8221; work though?</em></div>
<div id="magicdomid780"><em>&lt;jMyles&gt;  igloo_x: wow.  yes it does &#8211; mad overthinking on my part.</em></div>
<div id="magicdomid781"><em>&lt;igloo_x&gt; good old  python!</em></div>
</blockquote>
<div>Good old Python indeed.  And therein I think lies the deeper truth: No matter what framework we use, it is imperative that developers adopt the philosophy of the language on which that framework is built, even if this means some extra time studying, sitting quietly, talking with friends, etc.</div>
<div>If I had allowed my mind to relax for a few minutes and really thought about the *context* in which this unexpected &#8220;magic&#8221; had arisen, surely my mind knew the way out of the situation.  That is the true developer discipline that is yet ahead for me.</div>
]]></content:encoded>
			<wfw:commentRss>http://justinholmes.com/2010/07/a-rare-example-of-magic-and-gnosticism-in-django/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Obama says something that impresses me</title>
		<link>http://justinholmes.com/2010/05/obama-says-something-that-impresses-me/</link>
		<comments>http://justinholmes.com/2010/05/obama-says-something-that-impresses-me/#comments</comments>
		<pubDate>Fri, 14 May 2010 20:40:10 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Corporate Media]]></category>
		<category><![CDATA[Obama]]></category>
		<category><![CDATA[Very Cool]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://justinholmes.com/?p=791</guid>
		<description><![CDATA[I am no Obama fan &#8211; my readers know that pretty well.  However, he used to (pre-2004ish) occasionally say things that impressed me a lot.
Check out this short clip.  It contains perhaps the best line delivered by a President in my life time &#8211; it&#8217;s from March of last year, but I hadn&#8217;t seen it [...]]]></description>
			<content:encoded><![CDATA[<p>I am no Obama fan &#8211; my readers know that pretty well.  However, he used to (pre-2004ish) occasionally say things that impressed me a lot.</p>
<p>Check out this short clip.  It contains perhaps the best line delivered by a President in my life time &#8211; it&#8217;s from March of last year, but I hadn&#8217;t seen it until now.</p>
<a href="http://justinholmes.com/2010/05/obama-says-something-that-impresses-me/"><em>Click here to view the embedded video.</em></a>
<p>It seems that he got a question that didn&#8217;t have a pre-fab answer in the corporate war machine script, so he had to kinda adlib.</p>
<p>Is there a more important maxim for a President (or any decision maker)  than knowing what he or she is talking about?  It has become fashionable  to be immediate and wrong instead of deliberative and right.  Only  after adopting the latter habit can a person develop a worldview and  moral compass on which to act.  Perhaps we can yet expect these to  emerge in the Obama administration.</p>
]]></content:encoded>
			<wfw:commentRss>http://justinholmes.com/2010/05/obama-says-something-that-impresses-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eric Sterling at UConn SSDP April 2009</title>
		<link>http://justinholmes.com/2009/12/eric-sterling-at-uconn-ssdp-april-2009/</link>
		<comments>http://justinholmes.com/2009/12/eric-sterling-at-uconn-ssdp-april-2009/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 03:46:46 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Activism]]></category>
		<category><![CDATA[Drug Policy]]></category>
		<category><![CDATA[Drugs]]></category>
		<category><![CDATA[Freedom]]></category>
		<category><![CDATA[Justice]]></category>
		<category><![CDATA[Law]]></category>
		<category><![CDATA[Politics]]></category>
		<category><![CDATA[Psychedelic Mind]]></category>
		<category><![CDATA[Racism]]></category>
		<category><![CDATA[Very Cool]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://justinholmes.com/?p=774</guid>
		<description><![CDATA[UConn SSDP had a really cool (and under-reported) pre-conference to SSDP&#8217;s Northeast Regional Conference in April.
Several of &#8220;the usual suspects,&#8221; including myself, spoke.  There&#8217;s no doubt, though, that Eric Sterling stole the show.  I have seen him speak 10+ times, and he is one of the best and most engaging public speakers I [...]]]></description>
			<content:encoded><![CDATA[<p>UConn SSDP had a really cool (and under-reported) pre-conference to SSDP&#8217;s Northeast Regional Conference in April.</p>
<p>Several of &#8220;the usual suspects,&#8221; including myself, spoke.  There&#8217;s no doubt, though, that <strong>Eric Sterling</strong> stole the show.  I have seen him speak 10+ times, and he is one of the best and most engaging public speakers I have ever been exposed to.  Fortunately my camera was rolling:</p>
<a href="http://justinholmes.com/2009/12/eric-sterling-at-uconn-ssdp-april-2009/"><em>Click here to view the embedded video.</em></a>
]]></content:encoded>
			<wfw:commentRss>http://justinholmes.com/2009/12/eric-sterling-at-uconn-ssdp-april-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lord of the Rings Time Flow Map</title>
		<link>http://justinholmes.com/2009/11/lord-of-the-rings-time-flow-map/</link>
		<comments>http://justinholmes.com/2009/11/lord-of-the-rings-time-flow-map/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 06:12:21 +0000</pubDate>
		<dc:creator>Justin</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Movies]]></category>
		<category><![CDATA[Psychedelic Mind]]></category>
		<category><![CDATA[Very Cool]]></category>

		<guid isPermaLink="false">http://justinholmes.com/?p=764</guid>
		<description><![CDATA[This is one of the coolest pieces of informative art I&#8217;ve ever seen.
If you are even remotely interested in the Lord of Rings Story, you must have a look:

]]></description>
			<content:encoded><![CDATA[<p>This is one of the coolest pieces of informative art I&#8217;ve ever seen.</p>
<p>If you are even remotely interested in the Lord of Rings Story, you must have a look:</p>
<p><a href="http://xkcd.com/657/large/"><img src="http://imgs.xkcd.com/comics/movie_narrative_charts_large.png" width="400px"/></a></p>
]]></content:encoded>
			<wfw:commentRss>http://justinholmes.com/2009/11/lord-of-the-rings-time-flow-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
