<?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>Nefarious Designs &#187; Books</title>
	<atom:link href="http://nefariousdesigns.co.uk/tags/books/feed/" rel="self" type="application/rss+xml" />
	<link>http://nefariousdesigns.co.uk</link>
	<description>Nefarious Designs is the web development agency and blog of Tim Huegdon, a web developer with over 5 years experience in the industry.</description>
	<lastBuildDate>Fri, 06 Jan 2012 21:37:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Practical Django Projects and Django 1.0</title>
		<link>http://nefariousdesigns.co.uk/archive/2008/09/practical-django-projects-and-django-10/</link>
		<comments>http://nefariousdesigns.co.uk/archive/2008/09/practical-django-projects-and-django-10/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 09:41:46 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://nefariousdesigns.co.uk/archive/2008/09/practical-django-projects-and-django-10/</guid>
		<description><![CDATA[I recently purchased a copy of &#8220;Practical Django Projects&#8220;, by James Bennett, with the intention of diving straight in and learning Django. I&#8217;d prepared for this daring feat of code-ninjutsu [yes, that's the correct spelling] with a crash course in Python via &#8220;Dive Into Python&#8220;, by Mark Pilgrim. This appears to have been the correct [...]]]></description>
			<content:encoded><![CDATA[<p>I recently purchased a copy of &#8220;<a href="http://www.amazon.co.uk/gp/product/1590599969?ie=UTF8&#038;tag=gamersite-21&#038;linkCode=as2&#038;camp=1634&#038;creative=6738&#038;creativeASIN=1590599969">Practical Django Projects</a>&#8220;, by James Bennett, with the intention of diving straight in and learning Django. I&#8217;d prepared for this daring feat of code-ninjutsu [yes, that's the correct spelling] with a crash course in Python via &#8220;<a href="http://www.amazon.co.uk/gp/product/1590593561?ie=UTF8&#038;tag=gamersite-21&#038;linkCode=as2&#038;camp=1634&#038;creative=6738&#038;creativeASIN=1590593561">Dive Into Python</a>&#8220;, by Mark Pilgrim.</p>
<p>This appears to have been the correct choice, as I&#8217;ve already acquired a confident grasp of the concepts and techniques of Django in less than a few days of playing with it (granted; with the odd reference look-up on <a href="http://www.djangobook.com/">http://www.djangobook.com/</a> and <a href="http://docs.djangoproject.com/en/dev/">http://docs.djangoproject.com/en/dev/</a>).</p>
<p>However, last night it all went a bit wrong when I upgraded my local version of Django from 0.96 to 1.0&hellip;</p>
<p><span id="more-179"></span></p>
<p>Most of my issues were due to the fact that some of the code in the examples, included in <a href="http://www.amazon.co.uk/gp/product/1590599969?ie=UTF8&#038;tag=gamersite-21&#038;linkCode=as2&#038;camp=1634&#038;creative=6738&#038;creativeASIN=1590599969">Practical Django Projects</a>, was now out of date. However, I had expected this (thanks to warnings from <a href="http://cyril.doussin.name/">Cyril Doussin</a> and <a href="http://dynamicflash.com/">Steve Webster</a>) and went about fixing the problems using the informative <a href="http://docs.djangoproject.com/en/dev/releases/1.0-porting-guide/">Porting Guide on the Django documentation site</a>.</p>
<p>Following my extensive fixes, I was still experiencing issues when decoupling the Admin class from its relevant model. In most cases, this was a relatively easy process, but in one particular situation, where I had used <code>edit_inline</code> and needed to update the method to use the new InlineModelAdmin objects, I had a slightly confusing issue: I needed to add the InlineModelAdmin object to one of the django.contrib applications â€” FlatPage â€” to get the SearchKeyword application to work.</p>
<p>After a short period googling, I found an interesting, well-written blog post by <a href="http://jasonism.org/">Jason Broyles</a>, &#8220;<a href="http://jasonism.org/weblog/2008/aug/04/adding-inlinemodeladmin-djangocontrib-application/">Add InlineModelAdmin to a django.contrib app</a>&#8220;. Unsurprisingly, it seemed others had had exactly the same issue.</p>
<p>Jason&#8217;s final model.py and admin.py files were as follows:</p>
<pre><code># models.py

from django.db import models
from django.contrib.flatpages.models import FlatPage

class SearchKeyword(models.Model):
    keyword = models.CharField(max_length=50)
    page = models.ForeignKey(FlatPage)

    def __unicode__(self):
        return self.keyword</code></pre>
<pre><code># admin.py

from django.contrib import admin
from cms.search.models import SearchKeyword
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext_lazy as _

class SearchKeywordInline(admin.StackedInline):
    model = SearchKeyword
    extra = 3
    max_num = 6

class FlatPageAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {'fields': ('url', 'title', 'content', 'sites')}),
        (_('Advanced options'), {'classes': ('collapse',), 'fields': ('enable_comments', 'registration_required', 'template_name')}),
    )
    list_display = ('url', 'title')
    list_filter = ('sites', 'enable_comments', 'registration_required')
    search_fields = ('url', 'title')
    inlines = [SearchKeywordInline,]

admin.site.unregister(FlatPage)
admin.site.register(FlatPage, FlatPageAdmin)</code></pre>
<p>Jason followed these examples with the following explanation:</p>
<blockquote cite="http://jasonism.org/weblog/2008/aug/04/adding-inlinemodeladmin-djangocontrib-application/"><p>The above admin.py file will make it so the SearchKeyword model is accessible in the FlatPages admin interface. It does this by first creating the SearchKeywordInline class and adding it to a new FlatPage ModelAdmin function. I also didn&#8217;t want to loose out on any of the extra options from the default django.contrib.flatpages ModelAdmin so I copied lines 6 and 14-20 from it and added the code to my file. Line 23 then unregisters the default FlatPage ModelAdmin and line 24 registers this new one with my inlines included.</p></blockquote>
<p>This solution fixed my problems, however I was concerned that copying and pasting code from <code>django.contrib.flatpages ModelAdmin</code> to <code>admin.py</code> was a massively inelegant solution. With that in mind, I came up with the following solution using inheritance:</p>
<pre><code># admin.py

from django.contrib import admin
from cms.search.models import SearchKeyword
from django.contrib.flatpages.models import FlatPage
from django.contrib.flatpages.admin import FlatPageAdmin
from django.utils.translation import ugettext_lazy as _

class SearchKeyword_Inline(admin.TabularInline):
	model = SearchKeyword
	extra = 3
	max_num = 6

class FlatPageAdmin(FlatPageAdmin):
 	inlines = [SearchKeyword_Inline]

admin.site.unregister(FlatPage)
admin.site.register(FlatPage, FlatPageAdmin)</code></pre>
<p>This worked perfectly.</p>
<p>As a final note, I&#8217;d just like to thank Jason for posting his solution; without that much needed information, I probably would have spent a lot more time trying to fix the issue than was really required. It just goes to show that developers that blog are a huge benefit to confused developers everywhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://nefariousdesigns.co.uk/archive/2008/09/practical-django-projects-and-django-10/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Learning JavaScript</title>
		<link>http://nefariousdesigns.co.uk/archive/2007/01/learning-javascript/</link>
		<comments>http://nefariousdesigns.co.uk/archive/2007/01/learning-javascript/#comments</comments>
		<pubDate>Mon, 29 Jan 2007 09:06:01 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://nefariousdesigns.co.uk/archive/2007/01/learning-javascript/</guid>
		<description><![CDATA[There&#8217;s no doubt about it; I have more than a passing fancy for JavaScript. We loves it, doesn&#8217;t we, precious? In fact, I&#8217;d go as far as to say that it&#8217;s my personal favourite programming language. Sure, JavaScript has it&#8217;s flaws and shortcomings; but then, so does my wife and I still love her! (Although, [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s no doubt about it; I have more than a passing fancy for JavaScript. We <em>loves</em> it, doesn&#8217;t we, precious? In fact, I&#8217;d go as far as to say that it&#8217;s my personal favourite programming language.</p>
<p>Sure, JavaScript has it&#8217;s flaws and shortcomings; but then, so does my wife and I still love her! (Although, obviously she&#8217;d disagreed. She&#8217;d probably have something to say about being compared to a programming language too &#8211; just as well she doesn&#8217;t read my blog then, eh?)</p>
<p>Anyhoo, recently I&#8217;ve had the pleasure of working rather extensively with my afore-mentioned <em>language du jour</em>. For this reason, I needed to dig out the reference material and, since I haven&#8217;t blogged anything remotely useful for a while, I thought I&#8217;d share my choice cuts with the blogosphere.</p>
<p><span id="more-160"></span></p>
<h2>Books</h2>
<p><a href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=0596101996%26tag=gamersite-21%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0596101996%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82" title="View product details at Amazon"><img src="http://ec2.images-amazon.com/images/P/0596101996.01._SCMZZZZZZZ_V52808811_.jpg" alt="JavaScript the Definitive Guide" class="framed pos1" /></a></p>
<p>Firstly, no JavaScript programmer&#8217;s library is complete without the excellent &#8220;<a href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=0596101996%26tag=gamersite-21%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0596101996%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82" title="View product details at Amazon"><strong>JavaScript: The Definitive Guide</strong></a>&#8220;, by <a href="http://www.davidflanagan.com/">David Flanagan</a>, and published by <a href="http://www.oreilly.com/">O&#8217;Reilly</a>. If you&#8217;re programming JavaScript in any way, you should get this book &#8211; it contains excellent explanations for all the characteristics of the language as well as providing a great reference section.</p>
<p><a href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=0975240269%26tag=gamersite-21%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0975240269%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82" title="View product details at Amazon"><img src="http://ec2.images-amazon.com/images/P/0975240269.01._SCMZZZZZZZ_V37018947_.jpg" alt="The JavaScript Anthology: 101 Essential Tips, Tricks and Hacks" class="framed pos2" /></a></p>
<p>My next favourite book when developing with JavaScript is &#8220;<a href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=0975240269%26tag=gamersite-21%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0975240269%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82"><strong>The JavaScript Anthology: 101 Essential Tips, Tricks and Hacks</strong></a>&#8220;, by <a href="http://www.brothercake.com/">James &#8220;Brothercake&#8221; Edwards</a> and <a href="http://www.themaninblue.com/">Cameron &#8220;The Man In Blue&#8221; Adams</a>, and published by the excellent <a href="http://www.sitepoint.com/">SitePoint</a>. This book provides a wealth of useful tips on various problems faced everyday when programming with JavaScript. It&#8217;s an invaluable reference source and it&#8217;s been a permanent feature on my desk since I bought it!</p>
<p><a href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=1590596803%26tag=gamersite-21%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/1590596803%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82" title="View product details at Amazon"><img src="http://ec3.images-amazon.com/images/P/1590596803.01._SCMZZZZZZZ_V1139533492_.jpg" alt="Beginning Javascript with DOM Scripting and Ajax: From Novice to Professional (Beginning: From Novice to Professional)" class="framed pos1" /></a></p>
<p>Next up is <a href="http://icant.co.uk/">Christian Heilmann</a>&#8216;s &#8220;<a href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=1590596803%26tag=gamersite-21%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/1590596803%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82"><strong>Beginning JavaScript with DOM Scripting and Ajax</strong></a>&#8220;, published by <a href="http://www.apress.com/">Apress</a>. This book is a great read no matter <em>what</em> your skill level, and will teach you the basics as well as some advanced techniques. I really like this book and, although I may be slightly biased since he sits about 3 desks away from me, Chris is a fount of information regarding my favourite language.</p>
<p><a href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=1590595335%26tag=gamersite-21%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/1590595335%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82" title="View product details at Amazon"><img src="http://ec2.images-amazon.com/images/P/1590595335.01._SCMZZZZZZZ_V1126731553_.jpg" alt="DOM Scripting: Web Design with JavaScript and the Document Object Model" class="framed pos2" /></a></p>
<p>Lastly, no list of JavaScript recommended reading would be complete without a book by <a href="http://adactio.com">Jeremy Keith</a>; and since he&#8217;s latest hasn&#8217;t been released yet, you should definitely take a look at &#8220;<a href="http://www.amazon.co.uk/gp/redirect.html%3FASIN=1590595335%26tag=gamersite-21%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/1590595335%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82" title="View product details at Amazon"><strong>DOM Scripting: Web Design with JavaScript and the Document Object Model</strong></a>&#8220;, published by <a href="http://www.friendsofed.com/">Friends of ED</a>. Although this book only really covers DOM Scripting (which is just a small segment of what JavaScript is capable of), it covers it well and, since most developers will only really require this sort of implementation, it&#8217;s certainly one for the bookshelf!</p>
<h2>Video</h2>
<p>With the dawning of the YouTube era, it&#8217;s nice to see that online video is finally becoming a staple part of our brain-food. Further to this, Yahoo! have incorporated an entire theatre of informative videos within the YUI section of the <a href="http://developer.yahoo.com">Yahoo! Developer Network</a>. Imaginatively entitled <a href="http://developer.yahoo.com/yui/theater/">YUI Theatre</a>, it&#8217;s a good place to watch some informative lectures.</p>
<p>As far as JavaScript is concerned, you should probably watch the following:</p>
<h3><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1710507">Douglas Crockford &#8212; &#8220;The JavaScript Programming Language&#8221;</a></h3>
<p><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1710507"><img src="http://us.i1.yimg.com/us.yimg.com/i/ydn/yuiweb/img/theater/crockford-tjpl2.jpg" alt="Douglas Crockford" class="framed pos2" /></a></p>
<p>Yahoo! JavaScript Architect Douglas Crockford provides a comprehensive introduction to the JavaScript Programming Language in this four-part video:</p>
<ol>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1710507">Part 1: 31 minutes</a></li>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1710553">Part 2: 31 minutes</a></li>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1710607">Part 3: 29 minutes</a></li>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1710658">Part 4: 20 minutes</a></li>
</ol>
<h3><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1027823">Douglas Crockford &#8212; &#8220;Advanced JavaScript&#8221;</a></h3>
<p><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1027823"><img src="http://us.i1.yimg.com/us.yimg.com/i/ydn/yuiweb/img/theater/crockford_advjs.jpg" alt="Douglas Crockford" class="framed pos2" /></a></p>
<p>Yahoo! JavaScript Architect Douglas Crockford lectures on the nuances of the JavaScript programming language in this three-part video:</p>
<ol>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1027823">Part 1: 31 minutes</a></li>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1027832">Part 2: 25 minutes</a></li>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.1027854">Part 3: 11 minutes</a></li>
</ol>
<h3><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.992708">Douglas Crockford &#8212; &#8220;An Inconvenient API: The Theory of the DOM&#8221;</a></h3>
<p><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.992708"><img src="http://us.i1.yimg.com/us.yimg.com/i/ydn/yuiweb/img/theater/crockford_tod.jpg" alt="Douglas Crockford" class="framed pos2" /></a></p>
<p>Yahoo! JavaScript Architect Douglas Crockford discusses the nexus between JavaScript and the browser, exploring the history of the BOM and DOM APIs and their impact on frontend engineering today. This presentation is archived in three parts:</p>
<ol>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.992708">Part 1: 31 minutes</a></li>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.996002">Part 2: 21 minutes</a></li>
<li><a href="http://video.yahoo.com/video/play?vid=cccd4aa02a3993ab06e56af731346f78.996008">Part 3: 26 minutes</a></li>
</ol>
<h3><a href="http://www2.sys-con.com/webinararchive.cfm?pid=miraglia&#038;registered=on">Eric Miraglia &#8212; &#8220;Applying Ajax: Speeding the Journey from Idea to Information&#8221;</a></h3>
<p><a href="http://www2.sys-con.com/webinararchive.cfm?pid=miraglia&#038;registered=on"><img src="http://us.i1.yimg.com/us.yimg.com/i/ydn/yuiweb/img/theater/miraglia.jpg" alt="Eric Miraglia" class="framed pos2" /></a></p>
<p>Eric Miraglia, YUI engineer and technical evangelist, addresses the RealWorld Ajax conference in San Jose in April 2006. Miraglia&#8217;s talk focuses on applying Ajax techniques to power real-world interaction problems and looks at autocomplete as a pattern that illustrate&#8217;s the power of XMLHttpRequest.</p>
<h2>Web</h2>
<p>Finally, as web developers, one would hope we&#8217;d embrace the internet as a teaching tool. To this end, you might like to take a look at some of the following sites:</p>
<ul>
<li><a href="http://www.crockford.com/javascript/">Douglas Crockford&#8217;s JavaScript site</a> &#8211; Contains a great set of tutorials, musings, and development recommendations.</li>
<li><a href="http://developer.mozilla.org/">Mozilla Developer Centre</a> &#8211; A fantastic reference resource on all subjects; from JavaScript itself, through to the DOM.</li>
<li><a href="http://www.w3schools.com/js/default.asp">W3Schools JavaScript Tutorial</a> &#8211; A great tutorial for beginners, the W3Schools site also has a nice reference secton.</li>
<li><a href="http://www.sitepoint.com/article/javascript-101-1">Sitepoint&#8217;s JavaScript 101</a> &#8211; A good tutorial. Searching through Sitepoint&#8217;s archive could also be recommended!</li>
<li><a href="http://www.alistapart.com/topics/code">A List Apart&#8217;s Code Topic</a> &#8211; A List Apart often publish tutorials involving JavaScript. The resource is too large to recommend a single piece. You&#8217;re better off searching the archive yourself.</li>
<li><a href="http://nefariousdesigns.co.uk/archive/2006/05/object-oriented-javascript/">Object Oriented Javascript</a> &#8211; A bit of harmless self-promotion here. My tutorial still seems to be popular, and continues to be the largest entry point to my site!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://nefariousdesigns.co.uk/archive/2007/01/learning-javascript/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

