[damned-lies] Use new django.utils.formats



commit 86399e64a2c2182faf02dca075dd758237a167f3
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue May 18 23:02:41 2010 +0200

    Use new django.utils.formats

 languages/views.py |    7 ++++---
 people/views.py    |    5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/languages/views.py b/languages/views.py
index adda0a8..7c7ffe6 100644
--- a/languages/views.py
+++ b/languages/views.py
@@ -23,7 +23,8 @@ import os
 import tarfile
 from datetime import date, datetime
 from django.shortcuts import render_to_response, get_object_or_404
-from django.utils.translation import ugettext as _, get_date_formats
+from django.utils.translation import ugettext as _
+from django.utils import formats
 from django.template import RequestContext
 from django.http import HttpResponse, HttpResponseRedirect
 from django.conf import settings
@@ -50,7 +51,7 @@ def language_all(request, locale, dtype):
         'stats_title': {'ui':  _("UI Translations"),
                         'doc': _("Documentation")}.get(dtype),
         'stats': stats,
-        'dateformat': get_date_formats()[0],
+        'dateformat': formats.get_format('DATE_FORMAT'),
     }
     return render_to_response('languages/language_all_modules.html', context,
                               context_instance=RequestContext(request))
@@ -83,7 +84,7 @@ def language_release(request, locale, release_name, dtype):
         'stats_title': {'ui':  _("UI Translations"),
                         'doc': _("Documentation")}.get(dtype),
         'stats': stats,
-        'dateformat': get_date_formats()[0],
+        'dateformat': formats.get_format('DATE_FORMAT'),
     }
     return render_to_response('languages/language_release.html', context,
                               context_instance=RequestContext(request))
diff --git a/people/views.py b/people/views.py
index c809aa9..a6f35cb 100644
--- a/people/views.py
+++ b/people/views.py
@@ -21,7 +21,8 @@
 from django.core import urlresolvers
 from django.http import HttpResponseRedirect
 from django.shortcuts import render_to_response, get_object_or_404
-from django.utils.translation import ugettext_lazy, ugettext as _, get_date_formats
+from django.utils.translation import ugettext_lazy, ugettext as _
+from django.utils import formats
 from django.template import RequestContext
 from django.db import IntegrityError
 from django.contrib.auth.decorators import login_required
@@ -44,7 +45,7 @@ def person_detail(request, person_id=None, person_username=None):
         'person': person,
         'on_own_page': request.user.is_authenticated() and person.username == request.user.username,
         'states': states,
-        'dateformat': get_date_formats()[0],
+        'dateformat': formats.get_format('DATE_FORMAT'),
     }
     return render_to_response('people/person_detail.html', context,
             context_instance=RequestContext(request))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]