Simplified dict initialization in two places.
This commit is contained in:
parent
7a48f9abf2
commit
917100eed7
|
@ -982,8 +982,10 @@ class OrderBy(BaseExpression):
|
||||||
def as_sql(self, compiler, connection):
|
def as_sql(self, compiler, connection):
|
||||||
connection.ops.check_expression_support(self)
|
connection.ops.check_expression_support(self)
|
||||||
expression_sql, params = compiler.compile(self.expression)
|
expression_sql, params = compiler.compile(self.expression)
|
||||||
placeholders = {'expression': expression_sql}
|
placeholders = {
|
||||||
placeholders['ordering'] = 'DESC' if self.descending else 'ASC'
|
'expression': expression_sql,
|
||||||
|
'ordering': 'DESC' if self.descending else 'ASC',
|
||||||
|
}
|
||||||
return (self.template % placeholders).rstrip(), params
|
return (self.template % placeholders).rstrip(), params
|
||||||
|
|
||||||
def get_group_by_cols(self):
|
def get_group_by_cols(self):
|
||||||
|
|
|
@ -49,18 +49,15 @@ def debug(request):
|
||||||
|
|
||||||
def i18n(request):
|
def i18n(request):
|
||||||
from django.utils import translation
|
from django.utils import translation
|
||||||
|
return {
|
||||||
context_extras = {}
|
'LANGUAGES': settings.LANGUAGES,
|
||||||
context_extras['LANGUAGES'] = settings.LANGUAGES
|
'LANGUAGE_CODE': translation.get_language(),
|
||||||
context_extras['LANGUAGE_CODE'] = translation.get_language()
|
'LANGUAGE_BIDI': translation.get_language_bidi(),
|
||||||
context_extras['LANGUAGE_BIDI'] = translation.get_language_bidi()
|
}
|
||||||
|
|
||||||
return context_extras
|
|
||||||
|
|
||||||
|
|
||||||
def tz(request):
|
def tz(request):
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
return {'TIME_ZONE': timezone.get_current_timezone_name()}
|
return {'TIME_ZONE': timezone.get_current_timezone_name()}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue