1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

[multi-db] Merged to [3646]

git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3648 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-08-22 16:46:32 +00:00
parent f4a52d16b5
commit d82245be55
6 changed files with 28 additions and 12 deletions

View File

@ -1,4 +1,4 @@
body { margin:0; padding:0; font-size:12px; font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif; color:#333; background:#fff; } body { margin:0; padding:0; font-size:12px; font-family:"Lucida Grande","DejaVu Sans","Bitstream Vera Sans",Verdana,Arial,sans-serif; color:#333; background:#fff; }
/* LINKS */ /* LINKS */
a:link, a:visited { color: #5b80b2; text-decoration:none; } a:link, a:visited { color: #5b80b2; text-decoration:none; }

View File

@ -35,7 +35,7 @@
<tr> <tr>
<td>{{ field.name }}</td> <td>{{ field.name }}</td>
<td>{{ field.data_type }}</td> <td>{{ field.data_type }}</td>
<td>{% if field.verbose %}{{ field.verbose|escape }}{% endif %}{% if field.help_text %} - {{ field.help_text|escape }}{% endif %}</td> <td>{% if field.verbose %}{{ field.verbose }}{% endif %}{% if field.help_text %} - {{ field.help_text }}{% endif %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

View File

@ -68,7 +68,7 @@ def isAlphaNumericURL(field_data, all_data):
def isSlug(field_data, all_data): def isSlug(field_data, all_data):
if not slug_re.search(field_data): if not slug_re.search(field_data):
raise ValidationError, "This value must contain only letters, numbers, underscores or hyphens." raise ValidationError, gettext("This value must contain only letters, numbers, underscores or hyphens.")
def isLowerCase(field_data, all_data): def isLowerCase(field_data, all_data):
if field_data.lower() != field_data: if field_data.lower() != field_data:

View File

@ -1,6 +1,7 @@
from django.template import loader, RequestContext from django.template import loader, RequestContext
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from django.core.xheaders import populate_xheaders from django.core.xheaders import populate_xheaders
from django.db.models.fields import DateTimeField
from django.http import Http404, HttpResponse from django.http import Http404, HttpResponse
import datetime, time import datetime, time
@ -235,9 +236,10 @@ def archive_day(request, year, month, day, queryset, date_field,
model = queryset.model model = queryset.model
now = datetime.datetime.now() now = datetime.datetime.now()
lookup_kwargs = { if isinstance(model._meta.get_field(date_field), DateTimeField):
'%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)), lookup_kwargs = {'%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max))}
} else:
lookup_kwargs = {date_field: date}
# Only bother to check current date if the date isn't in the past and future objects aren't requested. # Only bother to check current date if the date isn't in the past and future objects aren't requested.
if date >= now.date() and not allow_future: if date >= now.date() and not allow_future:
@ -304,9 +306,10 @@ def object_detail(request, year, month, day, queryset, date_field,
model = queryset.model model = queryset.model
now = datetime.datetime.now() now = datetime.datetime.now()
lookup_kwargs = { if isinstance(model._meta.get_field(date_field), DateTimeField):
'%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max)), lookup_kwargs = {'%s__range' % date_field: (datetime.datetime.combine(date, datetime.time.min), datetime.datetime.combine(date, datetime.time.max))}
} else:
lookup_kwargs = {date_field: date}
# Only bother to check current date if the date isn't in the past and future objects aren't requested. # Only bother to check current date if the date isn't in the past and future objects aren't requested.
if date >= now.date() and not allow_future: if date >= now.date() and not allow_future:

View File

@ -473,25 +473,36 @@ LANGUAGES
Default: A tuple of all available languages. Currently, this is:: Default: A tuple of all available languages. Currently, this is::
LANGUAGES = ( LANGUAGES = (
('ar', _('Arabic')),
('bn', _('Bengali')), ('bn', _('Bengali')),
('cs', _('Czech')), ('cs', _('Czech')),
('cy', _('Welsh')), ('cy', _('Welsh')),
('da', _('Danish')), ('da', _('Danish')),
('de', _('German')), ('de', _('German')),
('el', _('Greek')),
('en', _('English')), ('en', _('English')),
('es', _('Spanish')), ('es', _('Spanish')),
('es_AR', _('Argentinean Spanish')),
('fr', _('French')), ('fr', _('French')),
('gl', _('Galician')), ('gl', _('Galician')),
('hu', _('Hungarian')),
('he', _('Hebrew')),
('is', _('Icelandic')), ('is', _('Icelandic')),
('it', _('Italian')), ('it', _('Italian')),
('ja', _('Japanese')),
('nl', _('Dutch')),
('no', _('Norwegian')), ('no', _('Norwegian')),
('pt-br', _('Brazilian')), ('pt-br', _('Brazilian')),
('ro', _('Romanian')), ('ro', _('Romanian')),
('ru', _('Russian')), ('ru', _('Russian')),
('sk', _('Slovak')), ('sk', _('Slovak')),
('sl', _('Slovenian')),
('sr', _('Serbian')), ('sr', _('Serbian')),
('sv', _('Swedish')), ('sv', _('Swedish')),
('ta', _('Tamil')),
('uk', _('Ukrainian')),
('zh-cn', _('Simplified Chinese')), ('zh-cn', _('Simplified Chinese')),
('zh-tw', _('Traditional Chinese')),
) )
A tuple of two-tuples in the format (language code, language name). This A tuple of two-tuples in the format (language code, language name). This

View File

@ -141,6 +141,7 @@ It's easiest to understand template inheritance by starting with an example::
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
</body> </body>
</html>
This template, which we'll call ``base.html``, defines a simple HTML skeleton This template, which we'll call ``base.html``, defines a simple HTML skeleton
document that you might use for a simple two-column page. It's the job of document that you might use for a simple two-column page. It's the job of
@ -196,6 +197,7 @@ like::
<p>This is my second entry.</p> <p>This is my second entry.</p>
</div> </div>
</body> </body>
</html>
Note that since the child template didn't define the ``sidebar`` block, the Note that since the child template didn't define the ``sidebar`` block, the
value from the parent template is used instead. Content within a ``{% block %}`` value from the parent template is used instead. Content within a ``{% block %}``
@ -363,7 +365,7 @@ extends
Signal that this template extends a parent template. Signal that this template extends a parent template.
This tag can be used in two ways: This tag can be used in two ways:
* ``{% extends "base.html" %}`` (with quotes) uses the literal value * ``{% extends "base.html" %}`` (with quotes) uses the literal value
``"base.html"`` as the name of the parent template to extend. ``"base.html"`` as the name of the parent template to extend.
@ -961,13 +963,13 @@ any string.
pluralize pluralize
~~~~~~~~~ ~~~~~~~~~
Returns a plural suffix if the value is not 1. By default, this suffix is ``'s'``. Returns a plural suffix if the value is not 1. By default, this suffix is ``'s'``.
Example:: Example::
You have {{ num_messages }} message{{ num_messages|pluralize }}. You have {{ num_messages }} message{{ num_messages|pluralize }}.
For words that require a suffix other than ``'s'``, you can provide an alternate For words that require a suffix other than ``'s'``, you can provide an alternate
suffix as a parameter to the filter. suffix as a parameter to the filter.
Example:: Example::