Django Update - 2013-12-15 to 2013-12-28

Posted by Curtis Maloney on December 29, 2013


Time for my second Django Update!


Elena Williams has proposed to start a new podcast, for all of you who get their news audibly :)

I wasn't aware, until Elena contacted me, that the Lincoln Loop "Django Roundup" has ended. Disappointing for all, I'm sure, and for me, especially, as in their last post they'd talked of inviting me on! :)

So, if you'd like to contribute some ideas for what you'd like to hear, or just to cheer Elena on, take a look here.

Ticket Movement

Short lived tickets: 36

Tickets Created: 34

Open tickets: 1391 (+16)


App Loading reloaded

Aymeric Augustin has very publicly worked on the App Loading refactor, giving a detailed plan at the start, regular updates, and a slew of code improvements.

This work has focused on changing how we think about INSTALLED_APPS. The most noticeable changes are:

  1. Allow apps without a models module or package
  2. Provide a verbose name, for example for the admin

My personal favourite goal "Provide a reliable initialization signal" was, unfortunately, not achieved in the time frame, but looks to be within sight. All of the resulting tasks are now in tickets with the keyword "app-loading", ready for the wider community to tackle.

Improving aggregate support

Josh Smeaton has taken on the challenge of #14030 - to allow using more complex expressions in aggregates.

This one's been on the cards for 3 years now, and a number of people have looked into it. With Anssi Kääriäinen (akaariai) lending advice, perhaps we can hope to see this land soon!

Did you know?

You can use F expressions in your model fields, not just in filter() statements.

So, if you want to increment an integer field on your model, but want to avoid the obvious race condition, you can use:

>>> from django.db.models import F
>>> product = Product.objects.get(name='Venezuelan Beaver Cheese')
>>> product.number_sold = F('number_sold') + 1

For more detail, see Updating attributes based on existing fields.


So, that's a second post under my belt!

-- Have a better one.

Back to Top