Monday, March 31, 2008

This Week in Django 16

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 a few source commits, NewForms-Admin branch updates, a whole bunch of excellent blog posts from the community, the Tip of the Week, and a couple of questions from the IRC.

Please see the Show Notes below for all the pertinent information and links

Downloads

AAC Enhanced Podcast (38.6 MB, 47:34, AAC)

MP3 Edition (32.7 MB, 47:34, MP3)

OGG Edition (26.2 MB, 47:34, 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

Intro

We discuss the new intro music, the fake Brian Rosner, and all the great supporters of the show that we met at PyCon.

Tracking Trunk (4:48)

Branching & Merging (11:13)

Community Catchup (16:23)

Tip of the Week (32:27)

get_object_or_404 can take a QuerySet.


get_object_or_404(Portfolio.objects.all().select_related(), slug=slug)

IRC Ad Nauseam (36:36)

Django IRC FAQ

Backwards Incompatible Changes Information

How do you copy a model instance object?

The easiest way is to set the primary key for the model to None. Then save the instance. This will create a new record in the database.


post = Post.objects.get(pk=1)
post.pk = None
post.save()

I’m trying to run tests on my application that is just template tags. It’s not working. What’s the problem?

The testing framework requires there to be a models.py in the application. Create this file and everything should work fine.

Thank You! (43:00)

Comments - 1 person has already said something. Join the discussion.

  • Paul said

    Good stuff as usual. I didn't know that about `get_object_or_404` and querysets!

    The tip on pyprocessing was very interesting too. Like a lot of web programmers, I don't do a lot with explicit concurrency, but I recently rewrote a simple image-processing utility to take advantage of multiple cores (virtually all our machines at work are multicore, including several quad-core Mac Pros), and ended up manually doing some of the stuff that this module does for you.