Loading django/contrib/admin/filters.py +2 −2 Original line number Diff line number Diff line Loading @@ -293,8 +293,8 @@ FieldListFilter.register(lambda f: bool(f.choices), ChoicesFieldListFilter) class DateFieldListFilter(FieldListFilter): def __init__(self, field, request, params, model, model_admin, field_path): self.field_generic = '%s__' % field_path self.date_params = dict((k, v) for k, v in params.items() if k.startswith(self.field_generic)) self.date_params = {k: v for k, v in params.items() if k.startswith(self.field_generic)} now = timezone.now() # When time zone support is enabled, convert "now" to the user's time Loading django/contrib/contenttypes/management.py +6 −6 Original line number Diff line number Diff line Loading @@ -25,18 +25,18 @@ def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT app_label = app_config.label app_models = dict( (model._meta.model_name, model) for model in app_config.get_models()) app_models = { model._meta.model_name: model for model in app_config.get_models()} if not app_models: return # Get all the content types content_types = dict( (ct.model, ct) content_types = { ct.model: ct for ct in ContentType.objects.using(using).filter(app_label=app_label) ) } to_remove = [ ct for (model_name, ct) in six.iteritems(content_types) Loading django/contrib/gis/gdal/field.py +1 −1 Original line number Diff line number Diff line Loading @@ -216,4 +216,4 @@ OGRFieldTypes = { 10: OFTTime, 11: OFTDateTime, } ROGRFieldTypes = dict((cls, num) for num, cls in OGRFieldTypes.items()) ROGRFieldTypes = {cls: num for num, cls in OGRFieldTypes.items()} django/contrib/gis/gdal/geomtype.py +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class OGRGeomType(object): 7 + wkb25bit: 'GeometryCollection25D', } # Reverse type dictionary, keyed by lower-case of the name. _str_types = dict((v.lower(), k) for k, v in _types.items()) _str_types = {v.lower(): k for k, v in _types.items()} def __init__(self, type_input): "Figures out the correct OGR Type based upon the input." Loading django/contrib/gis/gdal/libgdal.py +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ def gdal_version_info(): m = version_regex.match(ver) if not m: raise OGRException('Could not parse GDAL version string "%s"' % ver) return dict((key, m.group(key)) for key in ('major', 'minor', 'subminor')) return {key: m.group(key) for key in ('major', 'minor', 'subminor')} _verinfo = gdal_version_info() GDAL_MAJOR_VERSION = int(_verinfo['major']) Loading Loading
django/contrib/admin/filters.py +2 −2 Original line number Diff line number Diff line Loading @@ -293,8 +293,8 @@ FieldListFilter.register(lambda f: bool(f.choices), ChoicesFieldListFilter) class DateFieldListFilter(FieldListFilter): def __init__(self, field, request, params, model, model_admin, field_path): self.field_generic = '%s__' % field_path self.date_params = dict((k, v) for k, v in params.items() if k.startswith(self.field_generic)) self.date_params = {k: v for k, v in params.items() if k.startswith(self.field_generic)} now = timezone.now() # When time zone support is enabled, convert "now" to the user's time Loading
django/contrib/contenttypes/management.py +6 −6 Original line number Diff line number Diff line Loading @@ -25,18 +25,18 @@ def update_contenttypes(app_config, verbosity=2, interactive=True, using=DEFAULT app_label = app_config.label app_models = dict( (model._meta.model_name, model) for model in app_config.get_models()) app_models = { model._meta.model_name: model for model in app_config.get_models()} if not app_models: return # Get all the content types content_types = dict( (ct.model, ct) content_types = { ct.model: ct for ct in ContentType.objects.using(using).filter(app_label=app_label) ) } to_remove = [ ct for (model_name, ct) in six.iteritems(content_types) Loading
django/contrib/gis/gdal/field.py +1 −1 Original line number Diff line number Diff line Loading @@ -216,4 +216,4 @@ OGRFieldTypes = { 10: OFTTime, 11: OFTDateTime, } ROGRFieldTypes = dict((cls, num) for num, cls in OGRFieldTypes.items()) ROGRFieldTypes = {cls: num for num, cls in OGRFieldTypes.items()}
django/contrib/gis/gdal/geomtype.py +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ class OGRGeomType(object): 7 + wkb25bit: 'GeometryCollection25D', } # Reverse type dictionary, keyed by lower-case of the name. _str_types = dict((v.lower(), k) for k, v in _types.items()) _str_types = {v.lower(): k for k, v in _types.items()} def __init__(self, type_input): "Figures out the correct OGR Type based upon the input." Loading
django/contrib/gis/gdal/libgdal.py +1 −1 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ def gdal_version_info(): m = version_regex.match(ver) if not m: raise OGRException('Could not parse GDAL version string "%s"' % ver) return dict((key, m.group(key)) for key in ('major', 'minor', 'subminor')) return {key: m.group(key) for key in ('major', 'minor', 'subminor')} _verinfo = gdal_version_info() GDAL_MAJOR_VERSION = int(_verinfo['major']) Loading