Normalized spelling of "lowercase" and "lowercased".

This commit is contained in:
Jon Dufresne 2018-09-25 07:30:18 -07:00 committed by Tim Graham
parent abeed587b1
commit 8c3e0eb1c1
15 changed files with 34 additions and 34 deletions

View File

@ -44,7 +44,7 @@ class AppConfig:
# None if the application doesn't have a models module. # None if the application doesn't have a models module.
self.models_module = None self.models_module = None
# Mapping of lower case model names to model classes. Initially set to # Mapping of lowercase model names to model classes. Initially set to
# None to prevent accidental access before import_models() runs. # None to prevent accidental access before import_models() runs.
self.models = None self.models = None

View File

@ -356,8 +356,8 @@ class AdminUUIDInputWidget(forms.TextInput):
super().__init__(attrs={'class': 'vUUIDField', **(attrs or {})}) super().__init__(attrs={'class': 'vUUIDField', **(attrs or {})})
# Mapping of lower case language codes [returned by Django's get_language()] # Mapping of lowercase language codes [returned by Django's get_language()] to
# to language codes supported by select2. # language codes supported by select2.
# See django/contrib/admin/static/admin/js/vendor/select2/i18n/* # See django/contrib/admin/static/admin/js/vendor/select2/i18n/*
SELECT2_TRANSLATIONS = {x.lower(): x for x in [ SELECT2_TRANSLATIONS = {x.lower(): x for x in [
'ar', 'az', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'es', 'et', 'ar', 'az', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'es', 'et',

View File

@ -59,7 +59,7 @@ class GeoFeedMixin:
raise ValueError('Cannot use simple GeoRSS box in W3C Geo feeds.') raise ValueError('Cannot use simple GeoRSS box in W3C Geo feeds.')
handler.addQuickElement('georss:box', self.georss_coords(box_coords)) handler.addQuickElement('georss:box', self.georss_coords(box_coords))
else: else:
# Getting the lower-case geometry type. # Getting the lowercase geometry type.
gtype = str(geom.geom_type).lower() gtype = str(geom.geom_type).lower()
if gtype == 'point': if gtype == 'point':
self.add_georss_point(handler, geom.coords, w3c_geo=w3c_geo) self.add_georss_point(handler, geom.coords, w3c_geo=w3c_geo)

View File

@ -26,7 +26,7 @@ class OGRGeomType:
6 + wkb25bit: 'MultiPolygon25D', 6 + wkb25bit: 'MultiPolygon25D',
7 + wkb25bit: 'GeometryCollection25D', 7 + wkb25bit: 'GeometryCollection25D',
} }
# Reverse type dictionary, keyed by lower-case of the name. # Reverse type dictionary, keyed by lowercase of the name.
_str_types = {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): def __init__(self, type_input):

View File

@ -149,10 +149,10 @@ class ForeignObjectRel(FieldCacheMixin):
def get_accessor_name(self, model=None): def get_accessor_name(self, model=None):
# This method encapsulates the logic that decides what name to give an # This method encapsulates the logic that decides what name to give an
# accessor descriptor that retrieves related many-to-one or # accessor descriptor that retrieves related many-to-one or
# many-to-many objects. It uses the lower-cased object_name + "_set", # many-to-many objects. It uses the lowercased object_name + "_set",
# but this can be overridden with the "related_name" option. # but this can be overridden with the "related_name" option. Due to
# Due to backwards compatibility ModelForms need to be able to provide # backwards compatibility ModelForms need to be able to provide an
# an alternate model. See BaseInlineFormSet.get_default_prefix(). # alternate model. See BaseInlineFormSet.get_default_prefix().
opts = model._meta if model else self.related_model._meta opts = model._meta if model else self.related_model._meta
model = model or self.related_model model = model or self.related_model
if self.multiple: if self.multiple:

View File

@ -538,7 +538,7 @@ def split_domain_port(host):
""" """
Return a (domain, port) tuple from a given host. Return a (domain, port) tuple from a given host.
Returned domain is lower-cased. If the host is invalid, the domain will be Returned domain is lowercased. If the host is invalid, the domain will be
empty. empty.
""" """
host = host.lower() host = host.lower()
@ -566,7 +566,7 @@ def validate_host(host, allowed_hosts):
``example.com`` and any subdomain), ``*`` matches anything, and anything ``example.com`` and any subdomain), ``*`` matches anything, and anything
else must match exactly. else must match exactly.
Note: This function assumes that the given host is lower-cased and has Note: This function assumes that the given host is lowercased and has
already had the port, if any, stripped off. already had the port, if any, stripped off.
Return ``True`` for a valid host, ``False`` otherwise. Return ``True`` for a valid host, ``False`` otherwise.

View File

@ -36,7 +36,7 @@ class HttpResponseBase:
status_code = 200 status_code = 200
def __init__(self, content_type=None, status=None, reason=None, charset=None): def __init__(self, content_type=None, status=None, reason=None, charset=None):
# _headers is a mapping of the lower-case name to the original case of # _headers is a mapping of the lowercase name to the original case of
# the header (required for working with legacy systems) and the header # the header (required for working with legacy systems) and the header
# value. Both the name of the header and its value are ASCII strings. # value. Both the name of the header and its value are ASCII strings.
self._headers = {} self._headers = {}

View File

@ -413,7 +413,7 @@ def slugify(value, allow_unicode=False):
def camel_case_to_spaces(value): def camel_case_to_spaces(value):
""" """
Split CamelCase and convert to lower case. Strip surrounding whitespace. Split CamelCase and convert to lowercase. Strip surrounding whitespace.
""" """
return re_camel_case.sub(r' \1', value).strip().lower() return re_camel_case.sub(r' \1', value).strip().lower()

View File

@ -112,7 +112,7 @@ Imports
imports for other Django components and relative imports for local components. imports for other Django components and relative imports for local components.
* On each line, alphabetize the items with the upper case items grouped before * On each line, alphabetize the items with the upper case items grouped before
the lower case items. the lowercase items.
* Break long lines using parentheses and indent continuation lines by 4 spaces. * Break long lines using parentheses and indent continuation lines by 4 spaces.
Include a trailing comma after the last import and put the closing Include a trailing comma after the last import and put the closing

View File

@ -1678,9 +1678,9 @@ related. This works exactly the same as it does for :class:`ForeignKey`,
including all the options regarding :ref:`recursive <recursive-relationships>` including all the options regarding :ref:`recursive <recursive-relationships>`
and :ref:`lazy <lazy-relationships>` relationships. and :ref:`lazy <lazy-relationships>` relationships.
If you do not specify the :attr:`~ForeignKey.related_name` argument for If you do not specify the :attr:`~ForeignKey.related_name` argument for the
the ``OneToOneField``, Django will use the lower-case name of the current model ``OneToOneField``, Django will use the lowercase name of the current model as
as default value. default value.
With the following example:: With the following example::

View File

@ -37,8 +37,8 @@ a model object and return its URL. This is a way of inserting or overriding
'news.story': lambda o: "/stories/%s/%s/" % (o.pub_year, o.slug), 'news.story': lambda o: "/stories/%s/%s/" % (o.pub_year, o.slug),
} }
Note that the model name used in this setting should be all lower-case, regardless The model name used in this setting should be all lowercase, regardless of the
of the case of the actual model class name. case of the actual model class name.
.. setting:: ADMINS .. setting:: ADMINS

View File

@ -172,9 +172,9 @@ they're dealing with publishers here.
Well, if you're dealing with a model object, this is already done for you. When Well, if you're dealing with a model object, this is already done for you. When
you are dealing with an object or queryset, Django is able to populate the you are dealing with an object or queryset, Django is able to populate the
context using the lower cased version of the model class' name. This is context using the lowercased version of the model class' name. This is provided
provided in addition to the default ``object_list`` entry, but contains exactly in addition to the default ``object_list`` entry, but contains exactly the same
the same data, i.e. ``publisher_list``. data, i.e. ``publisher_list``.
If this still isn't a good match, you can manually set the name of the If this still isn't a good match, you can manually set the name of the
context variable. The ``context_object_name`` attribute on a generic view context variable. The ``context_object_name`` attribute on a generic view

View File

@ -981,11 +981,11 @@ To work around this problem, when you are using
class (only), part of the value should contain ``'%(app_label)s'`` and class (only), part of the value should contain ``'%(app_label)s'`` and
``'%(class)s'``. ``'%(class)s'``.
- ``'%(class)s'`` is replaced by the lower-cased name of the child class - ``'%(class)s'`` is replaced by the lowercased name of the child class that
that the field is used in. the field is used in.
- ``'%(app_label)s'`` is replaced by the lower-cased name of the app the child - ``'%(app_label)s'`` is replaced by the lowercased name of the app the child
class is contained within. Each installed application name must be unique class is contained within. Each installed application name must be unique and
and the model class names within each app must also be unique, therefore the the model class names within each app must also be unique, therefore the
resulting name will end up being different. resulting name will end up being different.
For example, given an app ``common/models.py``:: For example, given an app ``common/models.py``::
@ -1065,8 +1065,8 @@ possible::
>>> Restaurant.objects.filter(name="Bob's Cafe") >>> Restaurant.objects.filter(name="Bob's Cafe")
If you have a ``Place`` that is also a ``Restaurant``, you can get from the If you have a ``Place`` that is also a ``Restaurant``, you can get from the
``Place`` object to the ``Restaurant`` object by using the lower-case version ``Place`` object to the ``Restaurant`` object by using the lowercase version of
of the model name:: the model name::
>>> p = Place.objects.get(id=12) >>> p = Place.objects.get(id=12)
# If p is a Restaurant object, this will give the child class: # If p is a Restaurant object, this will give the child class:

View File

@ -67,14 +67,14 @@ Here are some other terms that will help us to handle a common language:
A locale name, either a language specification of the form ``ll`` or a A locale name, either a language specification of the form ``ll`` or a
combined language and country specification of the form ``ll_CC``. combined language and country specification of the form ``ll_CC``.
Examples: ``it``, ``de_AT``, ``es``, ``pt_BR``. The language part is Examples: ``it``, ``de_AT``, ``es``, ``pt_BR``. The language part is
always in lower case and the country part in upper case. The separator always in lowercase and the country part in upper case. The separator is
is an underscore. an underscore.
language code language code
Represents the name of a language. Browsers send the names of the Represents the name of a language. Browsers send the names of the
languages they accept in the ``Accept-Language`` HTTP header using this languages they accept in the ``Accept-Language`` HTTP header using this
format. Examples: ``it``, ``de-at``, ``es``, ``pt-br``. Language codes format. Examples: ``it``, ``de-at``, ``es``, ``pt-br``. Language codes
are generally represented in lower-case, but the HTTP ``Accept-Language`` are generally represented in lowercase, but the HTTP ``Accept-Language``
header is case-insensitive. The separator is a dash. header is case-insensitive. The separator is a dash.
message file message file

View File

@ -44,8 +44,8 @@ class District(models.Model):
# If ticket #1578 ever slips back in, these models will not be able to be # If ticket #1578 ever slips back in, these models will not be able to be
# created (the field names being lower-cased versions of their opposite # created (the field names being lowercased versions of their opposite classes
# classes is important here). # is important here).
class First(models.Model): class First(models.Model):
second = models.IntegerField() second = models.IntegerField()