diff --git a/django/bin/make-messages.py b/django/bin/make-messages.py index 600799858f..5c74faecbb 100755 --- a/django/bin/make-messages.py +++ b/django/bin/make-messages.py @@ -1,6 +1,6 @@ #!/usr/bin/python -from django.utils.translation import templateize +from django.utils.translation import templatize import re import os import sys @@ -96,7 +96,7 @@ def make_messages(): thefile = file if file.endswith('.html'): src = open(os.path.join(dirpath, file), "rb").read() - open(os.path.join(dirpath, '%s.py' % file), "wb").write(templateize(src)) + open(os.path.join(dirpath, '%s.py' % file), "wb").write(templatize(src)) thefile = '%s.py' % file if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) cmd = 'xgettext %s -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy -o - "%s"' % ( diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py index e30157dc7d..bce5937770 100644 --- a/django/conf/global_settings.py +++ b/django/conf/global_settings.py @@ -110,6 +110,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', +# 'django.core.context_processors.request', ) # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a diff --git a/django/contrib/admin/media/css/global.css b/django/contrib/admin/media/css/global.css index 7daf3b818f..c8961459a6 100644 --- a/django/contrib/admin/media/css/global.css +++ b/django/contrib/admin/media/css/global.css @@ -47,7 +47,7 @@ hr { clear:both; color:#eee; background-color:#eee; height:1px; border:none; mar #footer { clear:both; padding:10px; } /* COLUMN TYPES */ -.colSM #content-main { float:right; } +.colSM #content-main { float:right; } .colSM #content-related { float:left; } .colMS #content-main, .colSM #content-main { width:68%; } .colMS #content-related { margin-left:12px; width:30%; } @@ -170,6 +170,9 @@ fieldset.collapsed h2 { background-image:url(../img/admin/nav-bg.gif); backgroun fieldset.collapsed .collapse-toggle { padding:3px 5px !important; background:#efefef; } fieldset.collapsed .collapse-toggle a { display:inline !important; } +/* MONOSPACE TEXTAREAS */ +fieldset.monospace textarea { font-family:"Bitstream Vera Sans Mono",Monaco,"Courier New",Courier,monospace; } + /* MESSAGES & ERRORS */ ul.messagelist { padding:0 0 5px 0; margin:0; } ul.messagelist li { font-size:12px; display:block; padding:4px 5px 4px 25px; margin:0 0 3px 0; border-bottom:1px solid #ddd; color:#666; background:#ffc url(../img/admin/icon_success.gif) 5px .3em no-repeat; } diff --git a/django/contrib/admin/templates/registration/password_change_form.html b/django/contrib/admin/templates/registration/password_change_form.html index 32e5569458..096e66ce13 100644 --- a/django/contrib/admin/templates/registration/password_change_form.html +++ b/django/contrib/admin/templates/registration/password_change_form.html @@ -1,6 +1,6 @@ {% extends "admin/base_site" %} {% load i18n %} - +{% block userlinks %}{% trans 'Documentation' %} / {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} {% block breadcrumbs %}{% endblock %} {% block title %}{% trans 'Password change' %}{% endblock %} diff --git a/django/core/context_processors.py b/django/core/context_processors.py index 004c95cfd0..1ab0768776 100644 --- a/django/core/context_processors.py +++ b/django/core/context_processors.py @@ -38,6 +38,9 @@ def i18n(request): context_extras['LANGUAGE_CODE'] = settings.LANGUAGE_CODE return context_extras +def request(request): + return {'request': request} + # PermWrapper and PermLookupDict proxy the permissions system into objects that # the template system can understand. diff --git a/django/core/validators.py b/django/core/validators.py index 200ada4c0a..ce90f9dfe2 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -13,7 +13,7 @@ from django.utils.translation import gettext, gettext_lazy, ngettext from django.utils.functional import Promise, lazy import re -_datere = r'\d{4}-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[12][0-9])|(?:3[0-1]))' +_datere = r'(19|2\d)\d{2}-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[12][0-9])|(?:3[0-1]))' _timere = r'(?:[01]?[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?' alnum_re = re.compile(r'^\w+$') alnumurl_re = re.compile(r'^[\w/]+$') diff --git a/django/utils/translation.py b/django/utils/translation.py index 7bd442a070..a877f60009 100644 --- a/django/utils/translation.py +++ b/django/utils/translation.py @@ -369,7 +369,7 @@ dot_re = re.compile(r'\S') def blankout(src, char): """ Changes every non-whitespace character to the given char. - Used in the templateize function. + Used in the templatize function. """ return dot_re.sub(char, src) @@ -378,7 +378,7 @@ block_re = re.compile(r"""^\s*blocktrans(?:\s+|$)""") endblock_re = re.compile(r"""^\s*endblocktrans$""") plural_re = re.compile(r"""^\s*plural$""") constant_re = re.compile(r"""_\(((?:".*?")|(?:'.*?'))\)""") -def templateize(src): +def templatize(src): """ Turns a Django template into something that is understood by xgettext. It does so by translating the Django translation tags into standard gettext diff --git a/docs/email.txt b/docs/email.txt index ba2adf8201..c39fbbd114 100644 --- a/docs/email.txt +++ b/docs/email.txt @@ -110,8 +110,8 @@ This sends a message to john@example.com and jane@example.com, with them both receiving a separate e-mail:: datatuple = ( - ('Subject', 'Message.', 'from@example.com', ['john@example.com'], - ('Subject', 'Message.', 'from@example.com', ['jane@example.com'], + ('Subject', 'Message.', 'from@example.com', ['john@example.com']), + ('Subject', 'Message.', 'from@example.com', ['jane@example.com']), ) send_mass_mail(datatuple) diff --git a/docs/faq.txt b/docs/faq.txt index 2bf31aeffd..717bfa6665 100644 --- a/docs/faq.txt +++ b/docs/faq.txt @@ -419,6 +419,14 @@ How do I limit admin access so that objects can only be edited by the users who See the answer to the previous question. +My admin-site CSS and images showed up fine using the development server, but they're not displaying when using mod_python. +--------------------------------------------------------------------------------------------------------------------------- + +See `serving the admin files`_ in the "How to use Django with mod_python" +documentation. + +.. _serving the admin files: http://www.djangoproject.com/documentation/modpython/#serving-the-admin-files + My "list_filter" contains a ManyToManyField, but the filter doesn't display. ---------------------------------------------------------------------------- diff --git a/docs/templates_python.txt b/docs/templates_python.txt index d712bc30ac..6c90dbfd55 100644 --- a/docs/templates_python.txt +++ b/docs/templates_python.txt @@ -335,6 +335,16 @@ See the `internationalization docs`_ for more. .. _LANGUAGE_CODE setting: http://www.djangoproject.com/documentation/settings/#language-code .. _internationalization docs: http://www.djangoproject.com/documentation/i18n/ +django.core.context_processors.request +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**New in Django development version** + +If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every +``DjangoContext`` will contain a variable ``request``, which is the current +`HttpRequest object`_. Note that this processor is not enabled by default; +you'll have to activate it. + Loading templates -----------------