March 2011

Django 1.3 & South

Running the latest Django Release Candidate, I noticed that all of my South data migrations were failing.

Debugging via pdb led me to a a recent change in which the database was being flushed after south ran, but before the tests ran. I found a changeset that was committed after Django 1.3 beta-1, #14661 that introduced the flush to correct an issue with MySQL. It is a documented as a backwards incompatible change, which will prevent SQL fixtures (and unfortunately South data migrations).

After talking with Andrew Godwin at the PyCon Sprints, we decided to override the flush operation during testings. It is an unfortunate hack, but allows data migrations on Django 1.3.

django-durationfield v0.3.3

I just released an implementation of DurationField for Django to PyPi.

The latest release uses datetime.timedelta for its internal representation of durations (thanks to Paul Oswald) and has support for South thanks to Wes Winham.

The documentation is now hosted on ReadTheDocs and the package data is available on Django Packages.

After a discussion with a few Django core developers, it seems like keeping the DurationField implementation as a separate, reusable application is the preferred option. By staying independent, we keep the ability to make changes independent of the Django release cycle. Additionally, we avoid adding bloat to Django-core. Since not all databases implement an interval or duration data type (PostgreSQL does), django-durationfield is in some ways a hack by using a bigint datatype to store integer instances of timedelta.