This Week in Django 27 - 2008-06-22

This Week in Django is a weekly podcast about all things Django.
This week we talk about the Django Software Foundation, some source commits, some cool projects from the community, a Tip of the Week. and a couple IRC items. It’s a packed show.
Please see the Show Notes below for all the pertinent information and links
Downloads
AAC Enhanced Podcast (55.8 MB, 1:08:08, AAC)
MP3 Edition (46.8 MB, 1:08:08, MP3)
OGG Edition (38.5 MB, 1:08:08, Vorbis)
The Enhanced Podcast version contains screenshots and easy access links to all of the items we discuss throughout the podcast.
Feeds Available
iTunes Feeds are available. By subscribing using the iTunes feeds the podcasts will automatically be downloaded for you when we release them.
iTunes Feeds
This Week in Django – AAC Edition
This Week in Django – MP3 Edition
Regular RSS Feeds
This Week in Django – AAC Edition
This Week in Django – MP3 Edition
This Week in Django – OGG Edition
Give Us Feedback
Want to give us some feedback on the show? We’re always looking for ideas or suggestions that will help improve each episode. Please contact us at feedback __at__
thisweekindjango.com.
Show Notes
SPONSOR: This Week in Django is brought you by Justin Lilly, who according to all historic accounts, once scissor kicked Angela Landsbury. Thank you Justin.
Big News (2:18)
New foundation for Django – Lawrence-Journal World announces new Django foundation and code commits change license ownership.- Jacob Kaplan-Moss Signing Papers – History in the making.
Tracking Trunk (5:02)
-
login view no longer assumes that set_test_cookie has been called.
(7692)
- This is mildly backwards-incompatible, but in the “now it works the way it should have all along” sense.
Branching and Merging (9:50)
Community Catchup (15:57)
-
DebugFooter Redux – Last week we talked about Andreas Marr very cool Django Snippet to add debug information into the footer of each webpage. This week he did it one better based on some suggestions from our program. Now that’s what I call Podcast Driven Development™.
- Django Tutorial – Abstract Base Classes vs Model Table Inheritance – Awesome post by Kevin Fricovsky that covers the difference between Abstract Base Classes and Multi-Table Inheritance.
- django_templatecomponents – A django application by Filip Noetzel that makes it easy organize your component source (javascript, css) right in your django templates to to make your website much faster.
-
group_required
Decorator – Matt Dennebaum offers a nice addition to your Django projects that adds the ability to check for authorization of a user against the specified group.
-
– A reusable application by Alex Gaynor for doing ajax validation with django newforms. It requires jQuery.
- Git repository also available
- Ticket 2070 – Streaming file uploading by Mike Axiak.
-
Fun with queryset-refactor – Another great post by James Bennett discussing some of the new features that were part of the Queryset-Refactor merge.
- Practical Django Projects – Forthcoming book by James Bennett.
-
Werkzeug Debugger in Django – The Werkzeug debugger has a kick ass AJAX based console option to debug traceback items in the web browser.
- Changeset 7537
- Ticket 3527 – Adds Werkzeug to Django directly.
- Let’s talk about documentation – Excellent post by James Bennett on how he approaches documentation for his Django projects.
Tip of the Week (43:22)
This tip comes from Alexander Solovyov in his blog post Render To Improved.
Sometimes you want to return a RequestContext from a view. One way to do that is to specify the response code using a decorator.
@render_to('mytemplate.html')
def myview(request):
return ({'id': 1, 'name':'empty'})
# example with override
@render_to('mytemplate.html')
def myview(request):
return ({'name':'empty'}, 'override.html')
# python 2.3 example with override
def myview(request):
return ({'name':'empty'}, 'override.html')
myview = render_to(myview, 'mytemplate.html')
You can also return a tuple where the second item is a string that overrides the default template specified in render_to
.
- Permalink Decorator – “A backwards remapper hulu-hooping dancer, thingy.”—brosner
IRC Ad Nauseam (51:11)
Backwards Incompatible Changes Information
What’s the difference between Abstract Base Classes and Multi-Table Inheritance?
Abstract Base Classes are where you provide a base class, like Person
, and then a derived class like Employee
. Django will create a single database table for the Person model that contains the combined fields from both the base and derived classes.
Multi-Table Inheritance also has the base and derived class but at the database level you end up with two tables: one for the base class and one for the derived class, with a one-to-one field added in to connect the two.
Again, we highly recommend the excellent post by Kevin Fricovsky that we mentioned in Community Catchup. Plus, as always, the excellent Django documentation.
- Abstract Base Classes – Django documentation on the subject.
- Multi-Table Inheritance – Django documentation on the subject.
Is there a way to pass the filter arguments as string to the QuerySet?
QuerySet parameters are standard Python keyword arguments, and can use standard keyword argument expansion.
Post.objects.filter(datetime__year=2008)
Post.objects.filter(**{'datetime__year': 2008})
- Dynamic Functions – Excellent post by Marty Alchin that discusses keyword arguments in a very easy to understand way.
Thank You!
-
Facestat scales fast for Yahoo traffic
- Scaling Fast by Lukas Biewald
- – Follow him in his travels. Lots of very cool pictures.
- Brian Rosner
- Brian Rosner Blog
- TWiD Live