From 67f9f385aa36c0337d0e961d3a06e9d5f44d678e Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 5 Jul 2014 20:28:30 +0200 Subject: [PATCH] Fixed various minor doc typos / references. --- django/contrib/admin/options.py | 10 +++++----- django/core/management/commands/inspectdb.py | 2 +- django/db/models/fields/related.py | 2 +- django/forms/models.py | 2 +- docs/howto/custom-model-fields.txt | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py index e01cdd051c0..16be58e15d2 100644 --- a/django/contrib/admin/options.py +++ b/django/contrib/admin/options.py @@ -1707,9 +1707,9 @@ class InlineModelAdmin(BaseModelAdmin): """ Options for inline editing of ``model`` instances. - Provide ``name`` to specify the attribute name of the ``ForeignKey`` from - ``model`` to its parent. This is required if ``model`` has more than one - ``ForeignKey`` to its parent. + Provide ``fk_name`` to specify the attribute name of the ``ForeignKey`` + from ``model`` to its parent. This is required if ``model`` has more than + one ``ForeignKey`` to its parent. """ model = None fk_name = None @@ -1771,8 +1771,8 @@ class InlineModelAdmin(BaseModelAdmin): # Take the custom ModelForm's Meta.exclude into account only if the # InlineModelAdmin doesn't define its own. exclude.extend(self.form._meta.exclude) - # if exclude is an empty list we use None, since that's the actual - # default + # If exclude is an empty list we use None, since that's the actual + # default. exclude = exclude or None can_delete = self.can_delete and self.has_delete_permission(request, obj) defaults = { diff --git a/django/core/management/commands/inspectdb.py b/django/core/management/commands/inspectdb.py index 1eecf29dc6a..7feef23b08c 100644 --- a/django/core/management/commands/inspectdb.py +++ b/django/core/management/commands/inspectdb.py @@ -209,7 +209,7 @@ class Command(BaseCommand): field_type = 'TextField' field_notes.append('This field type is a guess.') - # This is a hook for DATA_TYPES_REVERSE to return a tuple of + # This is a hook for data_types_reverse to return a tuple of # (field_type, field_params_dict). if type(field_type) is tuple: field_type, new_params = field_type diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index e277e1025de..b311fbe3f63 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -2144,7 +2144,7 @@ class ManyToManyField(RelatedField): def _get_path_info(self, direct=False): """ - Called by both direct an indirect m2m traversal. + Called by both direct and indirect m2m traversal. """ pathinfos = [] int_model = self.rel.through diff --git a/django/forms/models.py b/django/forms/models.py index 9e6cab8c849..e6e1203f6d8 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -930,7 +930,7 @@ def _get_foreign_key(parent_model, model, fk_name=None, can_fail=False): """ Finds and returns the ForeignKey from model to parent if there is one (returns None if can_fail is True and no such field exists). If fk_name is - provided, assume it is the name of the ForeignKey field. Unles can_fail is + provided, assume it is the name of the ForeignKey field. Unless can_fail is True, an exception is raised if there is no ForeignKey from model to parent_model. """ diff --git a/docs/howto/custom-model-fields.txt b/docs/howto/custom-model-fields.txt index 0d3901bd40c..4d066348564 100644 --- a/docs/howto/custom-model-fields.txt +++ b/docs/howto/custom-model-fields.txt @@ -795,7 +795,7 @@ storing a string. If :meth:`.get_internal_type` returns a string that is not known to Django for the database backend you are using -- that is, it doesn't appear in -``django.db.backends..creation.DATA_TYPES`` -- the string will still be +``django.db.backends..creation.data_types`` -- the string will still be used by the serializer, but the default :meth:`.db_type` method will return ``None``. See the documentation of :meth:`.db_type` for reasons why this might be useful. Putting a descriptive string in as the type of the field for the