From a84404c190f1d3e9d507faf8031c98517c4c4466 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 7 Nov 2006 19:07:27 +0000 Subject: [PATCH] Formatting fixes from the past round of checkins git-svn-id: http://code.djangoproject.com/svn/django/trunk@4052 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/conf/global_settings.py | 2 +- django/core/mail.py | 2 +- django/db/__init__.py | 2 -- django/template/defaulttags.py | 8 ++++---- docs/forms.txt | 8 ++++---- docs/templates.txt | 10 +++++----- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py index eca0120f12..36fee9ec6d 100644 --- a/django/conf/global_settings.py +++ b/django/conf/global_settings.py @@ -101,7 +101,7 @@ DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. -DATABASE_OPTIONS = {} # Set to empy dictionary for default. +DATABASE_OPTIONS = {} # Set to empty dictionary for default. # Host for sending e-mail. EMAIL_HOST = 'localhost' diff --git a/django/core/mail.py b/django/core/mail.py index 0f607136d8..d1e5d0aa55 100644 --- a/django/core/mail.py +++ b/django/core/mail.py @@ -53,7 +53,7 @@ def send_mass_mail(datatuple, fail_silently=False, auth_user=settings.EMAIL_HOST msg['From'] = from_email msg['To'] = ', '.join(recipient_list) msg['Date'] = rfc822.formatdate() - msg['Message-ID'] = "<%d.%d@%s>" % ( time.time(), random.getrandbits(64), socket.getfqdn() ) + msg['Message-ID'] = "<%d.%d@%s>" % (time.time(), random.getrandbits(64), socket.getfqdn()) try: server.sendmail(from_email, recipient_list, msg.as_string()) num_sent += 1 diff --git a/django/db/__init__.py b/django/db/__init__.py index bed41dfdbc..e5b4d32e0b 100644 --- a/django/db/__init__.py +++ b/django/db/__init__.py @@ -6,8 +6,6 @@ __all__ = ('backend', 'connection', 'DatabaseError') if not settings.DATABASE_ENGINE: settings.DATABASE_ENGINE = 'dummy' -if not settings.DATABASE_OPTIONS: - settings.DATABASE_OPTIONS = {} try: backend = __import__('django.db.backends.%s.base' % settings.DATABASE_ENGINE, {}, {}, ['']) diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index c2e29e5342..3f3f4bda56 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -657,14 +657,14 @@ def ifchanged(parser, token): {{ date|date:"j" }} {% endfor %} - 2. If given a variable, check if that variable has changed. For example, the + 2. If given a variable, check whether that variable has changed. For example, the following shows the date every time it changes, but only shows the hour if both - the hour and the date has changed:: + the hour and the date have changed:: {% for date in days %} - {% ifchanged date.date %} {{date.date}} {% endifchanged %} + {% ifchanged date.date %} {{ date.date }} {% endifchanged %} {% ifchanged date.hour date.date %} - {{date.hour}} + {{ date.hour }} {% endifchanged %} {% endfor %} """ diff --git a/docs/forms.txt b/docs/forms.txt index 1c683c44f7..ff192a4717 100644 --- a/docs/forms.txt +++ b/docs/forms.txt @@ -611,13 +611,13 @@ fails. If no message is passed in, a default message is used. string comparison here, you will need to write your own validator. ``NumberIsInRange`` - Takes two boundary number, ``lower`` and ``upper`` and checks that the + Takes two boundary numbers, ``lower`` and ``upper``, and checks that the field is greater than ``lower`` (if given) and less than ``upper`` (if given). - Both checks are inclusive; that is, ``NumberIsInRange(10, 20)`` will allow - values of both 10 and 20. This validator only checks numeric fields - (i.e. floats and integer fields). + Both checks are inclusive. That is, ``NumberIsInRange(10, 20)`` will allow + values of both 10 and 20. This validator only checks numeric values + (e.g., float and integer values). ``IsAPowerOf`` Takes an integer argument and when called as a validator, checks that the diff --git a/docs/templates.txt b/docs/templates.txt index cb06fa27d9..46040c6972 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -538,14 +538,14 @@ The 'ifchanged' block tag is used within a loop. It has two possible uses. {{ date|date:"j" }} {% endfor %} -2. If given a variable, check if that variable has changed. For example, the - following shows the date every time it changes, but only shows the hour if both - the hour and the date has changed:: +2. **New in Django development version.** If given a variable, check whether that + variable has changed. For example, the following shows the date every time it + changes, but only shows the hour if both the hour and the date has changed:: {% for date in days %} - {% ifchanged date.date %} {{date.date}} {% endifchanged %} + {% ifchanged date.date %} {{ date.date }} {% endifchanged %} {% ifchanged date.hour date.date %} - {{date.hour}} + {{ date.hour }} {% endifchanged %} {% endfor %}