Formatting fixes from the past round of checkins

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4052 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-11-07 19:07:27 +00:00
parent 6f164ad485
commit a84404c190
6 changed files with 15 additions and 17 deletions

View File

@ -101,7 +101,7 @@ DATABASE_USER = '' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. 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_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. # Host for sending e-mail.
EMAIL_HOST = 'localhost' EMAIL_HOST = 'localhost'

View File

@ -53,7 +53,7 @@ def send_mass_mail(datatuple, fail_silently=False, auth_user=settings.EMAIL_HOST
msg['From'] = from_email msg['From'] = from_email
msg['To'] = ', '.join(recipient_list) msg['To'] = ', '.join(recipient_list)
msg['Date'] = rfc822.formatdate() 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: try:
server.sendmail(from_email, recipient_list, msg.as_string()) server.sendmail(from_email, recipient_list, msg.as_string())
num_sent += 1 num_sent += 1

View File

@ -6,8 +6,6 @@ __all__ = ('backend', 'connection', 'DatabaseError')
if not settings.DATABASE_ENGINE: if not settings.DATABASE_ENGINE:
settings.DATABASE_ENGINE = 'dummy' settings.DATABASE_ENGINE = 'dummy'
if not settings.DATABASE_OPTIONS:
settings.DATABASE_OPTIONS = {}
try: try:
backend = __import__('django.db.backends.%s.base' % settings.DATABASE_ENGINE, {}, {}, ['']) backend = __import__('django.db.backends.%s.base' % settings.DATABASE_ENGINE, {}, {}, [''])

View File

@ -657,14 +657,14 @@ def ifchanged(parser, token):
<a href="{{ date|date:"M/d"|lower }}/">{{ date|date:"j" }}</a> <a href="{{ date|date:"M/d"|lower }}/">{{ date|date:"j" }}</a>
{% endfor %} {% 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 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 %} {% for date in days %}
{% ifchanged date.date %} {{date.date}} {% endifchanged %} {% ifchanged date.date %} {{ date.date }} {% endifchanged %}
{% ifchanged date.hour date.date %} {% ifchanged date.hour date.date %}
{{date.hour}} {{ date.hour }}
{% endifchanged %} {% endifchanged %}
{% endfor %} {% endfor %}
""" """

View File

@ -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. string comparison here, you will need to write your own validator.
``NumberIsInRange`` ``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 field is greater than ``lower`` (if given) and less than ``upper`` (if
given). given).
Both checks are inclusive; that is, ``NumberIsInRange(10, 20)`` will allow Both checks are inclusive. That is, ``NumberIsInRange(10, 20)`` will allow
values of both 10 and 20. This validator only checks numeric fields values of both 10 and 20. This validator only checks numeric values
(i.e. floats and integer fields). (e.g., float and integer values).
``IsAPowerOf`` ``IsAPowerOf``
Takes an integer argument and when called as a validator, checks that the Takes an integer argument and when called as a validator, checks that the

View File

@ -538,14 +538,14 @@ The 'ifchanged' block tag is used within a loop. It has two possible uses.
<a href="{{ date|date:"M/d"|lower }}/">{{ date|date:"j" }}</a> <a href="{{ date|date:"M/d"|lower }}/">{{ date|date:"j" }}</a>
{% endfor %} {% endfor %}
2. If given a variable, check if that variable has changed. For example, the 2. **New in Django development version.** If given a variable, check whether that
following shows the date every time it changes, but only shows the hour if both variable has changed. For example, the following shows the date every time it
the hour and the date has changed:: changes, but only shows the hour if both the hour and the date has changed::
{% for date in days %} {% for date in days %}
{% ifchanged date.date %} {{date.date}} {% endifchanged %} {% ifchanged date.date %} {{ date.date }} {% endifchanged %}
{% ifchanged date.hour date.date %} {% ifchanged date.hour date.date %}
{{date.hour}} {{ date.hour }}
{% endifchanged %} {% endifchanged %}
{% endfor %} {% endfor %}