magic-removal: changed explicit settings import to qualified settings import
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1988 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e12eaa7e41
commit
c2b68f5c26
|
@ -1,6 +1,6 @@
|
|||
import re
|
||||
|
||||
from django.conf.settings import DEFAULT_CHARSET
|
||||
from django.conf import settings
|
||||
|
||||
# Capitalizes the first letter of a string.
|
||||
capfirst = lambda x: x and x[0].upper() + x[1:]
|
||||
|
@ -100,7 +100,7 @@ def javascript_quote(s):
|
|||
return r"\u%04x" % ord(match.group(1))
|
||||
|
||||
if type(s) == str:
|
||||
s = s.decode(DEFAULT_CHARSET)
|
||||
s = s.decode(settings.DEFAULT_CHARSET)
|
||||
elif type(s) != unicode:
|
||||
raise TypeError, s
|
||||
s = s.replace('\\', '\\\\')
|
||||
|
|
|
@ -209,8 +209,8 @@ def get_language():
|
|||
except AttributeError:
|
||||
pass
|
||||
# If we don't have a real translation object, assume it's the default language.
|
||||
from django.conf.settings import LANGUAGE_CODE
|
||||
return LANGUAGE_CODE
|
||||
from django.conf import settings
|
||||
return settings.LANGUAGE_CODE
|
||||
|
||||
def catalog():
|
||||
"""
|
||||
|
@ -346,16 +346,16 @@ def get_date_formats():
|
|||
technical message ID to store date and time formats. If it doesn't contain
|
||||
one, the formats provided in the settings will be used.
|
||||
"""
|
||||
from django.conf.settings import DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT
|
||||
from django.conf import settings
|
||||
date_format = _('DATE_FORMAT')
|
||||
datetime_format = _('DATETIME_FORMAT')
|
||||
time_format = _('TIME_FORMAT')
|
||||
if date_format == 'DATE_FORMAT':
|
||||
date_format = DATE_FORMAT
|
||||
date_format = settings.DATE_FORMAT
|
||||
if datetime_format == 'DATETIME_FORMAT':
|
||||
datetime_format = DATETIME_FORMAT
|
||||
datetime_format = settings.DATETIME_FORMAT
|
||||
if time_format == 'TIME_FORMAT':
|
||||
time_format = TIME_FORMAT
|
||||
time_format = settings.TIME_FORMAT
|
||||
return (date_format, datetime_format, time_format)
|
||||
|
||||
def install():
|
||||
|
@ -466,4 +466,4 @@ def string_concat(*strings):
|
|||
"""
|
||||
return ''.join([str(el) for el in strings])
|
||||
|
||||
string_concat = lazy(string_concat, str)
|
||||
string_concat = lazy(string_concat, str)
|
||||
|
|
Loading…
Reference in New Issue