Weblog

Django Update - 2014-01-12 to 2014-01-25

Overview

Has a lot happened in the last two weeks? You bet it has!

Notices

So, unless you've been asleep, you'll know that Django 1.7 alpha 1 was released!

This is a huge release with many big ticket items, as well as some smaller, but significant, ones.

Ticket Movement

Short lived tickets: 53

Tickets Created: 33

Open tickets: 1396 (-6)

Release Highlights

Migrations

Clearly, the biggest is Migrations. So long, South, you've served us so well...

App Loading

The App-loading refactor gives us many things we've longed for: predictable code initialisation sequence and order, a place to register our signals, a way to control the name and verbose name of apps in Admin...

Managers

Anyone who's used Django for long enough has probably wondered why Manager doesn't inherit from QuerySet, since it implements all the same methods.

Well, now there's QuerySet.as_manager. Anyone who uses django-model-utils is probably familiar with PassThroughManager for this same purpose.

Check it out

Russell Keith-Magee merged Christopher Medrela's 2013 Summer Of Code Project - a refactor of Validation into the new System Check Framework.

Prefetch

This is a personal favourite -- the Prefetch object gives you far more control over how prefetch_related works, including allowing you to pre-fetch filtered sets of related records, and even attach them to your instances on new properties.

Filters

This one snuck up on me, but we now have Custom Lookups and Custom Transforms.

And more...

There's heaps more in the release notes, more than I could possibly cover here. (There's even a few features by me!)

Did you know?

There's a 3rd positional argument in URL patterns. It's an optional dict of extra keyword arguments to pass to your view.

For example:

(r'^/foo/$', myview, {'bar': True}),

This would result in myview always being called with bar=True.

For more details, as always, read the docs.

Summary

PHEW Well, that's done now. We're in for a big few months preparing for the release of 1.7!

-- Have a better one!

Posted by Curtis Maloney on January 26, 2014