Thanks Pedro Lima for the draft patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15009 bcc190cf-cafb-0310-a4f2-bffc1f526a37