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.
Tracking Trunk (5:02)
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_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.
- Fun with queryset-refactor – Another great post by James Bennett discussing some of the new features that were part of the Queryset-Refactor merge.
- Werkzeug Debugger in Django – The Werkzeug debugger has a kick ass AJAX based console option to debug traceback items in the web browser.
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.
IRC Ad Nauseam (51:11)
Django IRC FAQ
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.
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})
Thank You!