mirror of
https://github.com/django/django.git
synced 2025-07-04 01:39:20 +00:00
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
|
import re
|
||||||
|
|
||||||
from django.conf.settings import DEFAULT_CHARSET
|
from django.conf import settings
|
||||||
|
|
||||||
# Capitalizes the first letter of a string.
|
# Capitalizes the first letter of a string.
|
||||||
capfirst = lambda x: x and x[0].upper() + x[1:]
|
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))
|
return r"\u%04x" % ord(match.group(1))
|
||||||
|
|
||||||
if type(s) == str:
|
if type(s) == str:
|
||||||
s = s.decode(DEFAULT_CHARSET)
|
s = s.decode(settings.DEFAULT_CHARSET)
|
||||||
elif type(s) != unicode:
|
elif type(s) != unicode:
|
||||||
raise TypeError, s
|
raise TypeError, s
|
||||||
s = s.replace('\\', '\\\\')
|
s = s.replace('\\', '\\\\')
|
||||||
|
@ -209,8 +209,8 @@ def get_language():
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
# If we don't have a real translation object, assume it's the default language.
|
# If we don't have a real translation object, assume it's the default language.
|
||||||
from django.conf.settings import LANGUAGE_CODE
|
from django.conf import settings
|
||||||
return LANGUAGE_CODE
|
return settings.LANGUAGE_CODE
|
||||||
|
|
||||||
def catalog():
|
def catalog():
|
||||||
"""
|
"""
|
||||||
@ -346,16 +346,16 @@ def get_date_formats():
|
|||||||
technical message ID to store date and time formats. If it doesn't contain
|
technical message ID to store date and time formats. If it doesn't contain
|
||||||
one, the formats provided in the settings will be used.
|
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')
|
date_format = _('DATE_FORMAT')
|
||||||
datetime_format = _('DATETIME_FORMAT')
|
datetime_format = _('DATETIME_FORMAT')
|
||||||
time_format = _('TIME_FORMAT')
|
time_format = _('TIME_FORMAT')
|
||||||
if date_format == 'DATE_FORMAT':
|
if date_format == 'DATE_FORMAT':
|
||||||
date_format = DATE_FORMAT
|
date_format = settings.DATE_FORMAT
|
||||||
if datetime_format == 'DATETIME_FORMAT':
|
if datetime_format == 'DATETIME_FORMAT':
|
||||||
datetime_format = DATETIME_FORMAT
|
datetime_format = settings.DATETIME_FORMAT
|
||||||
if time_format == 'TIME_FORMAT':
|
if time_format == 'TIME_FORMAT':
|
||||||
time_format = TIME_FORMAT
|
time_format = settings.TIME_FORMAT
|
||||||
return (date_format, datetime_format, time_format)
|
return (date_format, datetime_format, time_format)
|
||||||
|
|
||||||
def install():
|
def install():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user