Monday, June 23, 2008

This Week in Django 27

with hosts Michael Trier and Brian Rosner

Bookmark and Share

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 <i>at</i> 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)

Branching and Merging (9:50)

Community Catchup (15:57)

  • DebugFooter Redux – Last week we talked about Andreas Marr‘s 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™.

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'})

  1. example with override
    @render_to(‘mytemplate.html’)
    def myview(request):
    return ({‘name’:‘empty’}, ‘override.html’)
  1. 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!

Comments - 8 people have already said something. Join the discussion.

  • Christian said

    As much as i enjoy listening to your show, i hate downloading it with 8 KB/sec. Why is this so extremly slow? maybe setting up a torrent would be a good idea...

  • trbs said

    Seems to be something like a localized problem.

    From my home connection it also crawled with 8KB/sec but when i used one of the servers at the colocation it flies with 1.5MB/s. Then i downloaden it with scp from the server with my max download speed. Both uplinks from the Netherlands.

    Maybe you can try that trick as well...

  • Christian said

    I just tested this out...
    today i get:
    300KB/s @ home
    600KB/s on my webserver
    1MB/s @ work
    this is significantly faster, but i suspect it is faster because the episode was released yesterday (less people downloading it today)
    i will try your "trick" next week ;-)

  • kevin said

    wow guys, lots of great resource references this week. very good discussion throughout as well. seems like there's just more and more great stuff being generated by the community. thanks again!

  • Empty said

    Christian: regarding the slowness. These files are being served by S3, but they are routed through a provider that tracks downloads. Perhaps I will just leave the provider out of the mix next week and see how it goes. Get back with me please. I want to make this work for you.

  • mksoft said

    Happy birthday Brian.

    Great cast this week, thanks guys.

  • Stefan said

    Sound funny, hearing you spelling "Werkzeug". It means tool, you can listen to the pronunciation on http://dict.leo.org/ende?search=werkzeug ;)

  • Chris said

    "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."

    Since Person is the abstract and Employee is derived, Django will create the *Employee* table, no?