From 7ebf3068c16d29c0288a317dac45166a8bc4c23c Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 8 Oct 2007 16:10:39 +0000 Subject: queryset-refactor: Merged changed from trunk up to [6463]. git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6466 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- AUTHORS | 6 +- django/bin/compile-messages.py | 3 +- django/bin/make-messages.py | 95 +++++------ django/conf/locale/de/LC_MESSAGES/django.mo | Bin 44119 -> 44534 bytes django/conf/locale/de/LC_MESSAGES/django.po | 59 +++---- .../templates/admin/auth/user/change_password.html | 1 - django/contrib/admin/templates/admin/base.html | 9 +- .../contrib/admin/templates/admin/change_form.html | 1 - .../contrib/admin/templates/admin/change_list.html | 1 - .../admin/templates/admin/delete_confirmation.html | 1 - .../admin/templates/admin/object_history.html | 1 - .../admin/templates/admin_doc/bookmarklets.html | 1 - .../contrib/admin/templates/admin_doc/index.html | 1 - .../templates/admin_doc/missing_docutils.html | 1 - .../admin/templates/admin_doc/model_detail.html | 1 - .../admin/templates/admin_doc/model_index.html | 1 - .../admin/templates/admin_doc/template_detail.html | 1 - .../templates/admin_doc/template_filter_index.html | 1 - .../templates/admin_doc/template_tag_index.html | 1 - .../admin/templates/admin_doc/view_detail.html | 1 - .../admin/templates/admin_doc/view_index.html | 1 - .../registration/password_change_done.html | 1 - .../registration/password_change_form.html | 1 - django/contrib/admin/templatetags/admin_modify.py | 8 +- django/contrib/auth/backends.py | 5 + django/contrib/comments/templatetags/comments.py | 12 +- django/contrib/sessions/backends/base.py | 25 +-- django/contrib/sessions/models.py | 9 +- django/core/handlers/wsgi.py | 17 +- django/core/management/__init__.py | 176 ++++++++++++++++----- django/core/management/base.py | 16 +- django/core/management/commands/startapp.py | 2 +- django/db/models/fields/__init__.py | 2 +- django/http/__init__.py | 5 +- django/middleware/http.py | 7 +- django/newforms/widgets.py | 18 ++- django/oldforms/__init__.py | 4 +- django/template/__init__.py | 152 ++++++++++++------ django/template/defaultfilters.py | 8 +- django/template/defaulttags.py | 18 +-- django/template/loader_tags.py | 6 +- django/templatetags/i18n.py | 6 +- django/utils/cache.py | 15 +- django/utils/datastructures.py | 2 +- django/utils/encoding.py | 3 +- django/utils/translation/__init__.py | 14 +- django/utils/translation/trans_null.py | 1 - django/utils/translation/trans_real.py | 6 - django/views/static.py | 4 +- docs/databases.txt | 115 ++++++++++++++ docs/db-api.txt | 7 +- docs/django-admin.txt | 29 ++++ docs/email.txt | 22 +-- docs/generic_views.txt | 7 +- docs/i18n.txt | 9 +- docs/install.txt | 2 + docs/newforms.txt | 25 ++- docs/request_response.txt | 2 +- docs/sessions.txt | 2 +- docs/settings.txt | 2 +- docs/templates_python.txt | 36 ++++- docs/unicode.txt | 30 ++-- tests/modeltests/basic/models.py | 2 +- tests/modeltests/field_defaults/models.py | 2 +- tests/modeltests/serializers/models.py | 14 +- tests/modeltests/signals/models.py | 4 +- tests/modeltests/user_commands/__init__.py | 0 .../user_commands/management/__init__.py | 0 .../user_commands/management/commands/__init__.py | 0 .../user_commands/management/commands/dance.py | 9 ++ tests/modeltests/user_commands/models.py | 30 ++++ tests/regressiontests/httpwrappers/tests.py | 6 +- tests/regressiontests/i18n/models.py | 12 ++ tests/regressiontests/i18n/tests.py | 8 + .../views/tests/generic/date_based.py | 10 +- 75 files changed, 790 insertions(+), 325 deletions(-) create mode 100644 tests/modeltests/user_commands/__init__.py create mode 100644 tests/modeltests/user_commands/management/__init__.py create mode 100644 tests/modeltests/user_commands/management/commands/__init__.py create mode 100644 tests/modeltests/user_commands/management/commands/dance.py create mode 100644 tests/modeltests/user_commands/models.py diff --git a/AUTHORS b/AUTHORS index b6c9141db9..548ac9c03d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -114,6 +114,7 @@ answer newbie questions, and generally made Django that much better: Enrico A. Murat Eren Ludvig Ericson + eriks@win.tue.nl Dirk Eschler Marc Fargas Szilveszter Farkas @@ -234,6 +235,7 @@ answer newbie questions, and generally made Django that much better: Jay Parlar pavithran s Barry Pederson + permonik@mesias.brnonet.cz petr.marhoun@gmail.com pgross@thoughtworks.com phaedo @@ -312,7 +314,8 @@ answer newbie questions, and generally made Django that much better: Vlado Milton Waddams wam-djangobug@wamber.net - wangchun + Wang Chun + Filip Wasilewski Filip Wasilewski Dan Watson Chris Wesseling @@ -321,6 +324,7 @@ answer newbie questions, and generally made Django that much better: Rachel Willmer Gary Wilson Jakub Wiśniowski + Maciej Wiśniowski wojtek ye7cakf02@sneakemail.com ymasuda@ethercube.com diff --git a/django/bin/compile-messages.py b/django/bin/compile-messages.py index 2838cb8aa4..8693022644 100755 --- a/django/bin/compile-messages.py +++ b/django/bin/compile-messages.py @@ -14,7 +14,8 @@ def compile_messages(locale=None): basedirs = [os.path.join('conf', 'locale'), 'locale'] if os.environ.get('DJANGO_SETTINGS_MODULE'): from django.conf import settings - basedirs += settings.LOCALE_PATHS + if hasattr(settings, 'LOCALE_PATHS'): + basedirs += settings.LOCALE_PATHS # Gather existing directories. basedirs = set(map(os.path.abspath, filter(os.path.isdir, basedirs))) diff --git a/django/bin/make-messages.py b/django/bin/make-messages.py index 11616c9ca5..44040390ea 100755 --- a/django/bin/make-messages.py +++ b/django/bin/make-messages.py @@ -74,59 +74,62 @@ def make_messages(): if os.path.exists(potfile): os.unlink(potfile) + all_files = [] for (dirpath, dirnames, filenames) in os.walk("."): - for file in filenames: - if domain == 'djangojs' and file.endswith('.js'): - if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) + all_files.extend([(dirpath, f) for f in filenames]) + all_files.sort() + for dirpath, file in all_files: + if domain == 'djangojs' and file.endswith('.js'): + if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) + src = open(os.path.join(dirpath, file), "rb").read() + src = pythonize_re.sub('\n#', src) + open(os.path.join(dirpath, '%s.py' % file), "wb").write(src) + thefile = '%s.py' % file + cmd = 'xgettext %s -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( + os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile)) + (stdin, stdout, stderr) = os.popen3(cmd, 't') + msgs = stdout.read() + errors = stderr.read() + if errors: + print "errors happened while running xgettext on %s" % file + print errors + sys.exit(8) + old = '#: '+os.path.join(dirpath, thefile)[2:] + new = '#: '+os.path.join(dirpath, file)[2:] + msgs = msgs.replace(old, new) + if msgs: + open(potfile, 'ab').write(msgs) + os.unlink(os.path.join(dirpath, thefile)) + elif domain == 'django' and (file.endswith('.py') or file.endswith('.html')): + thefile = file + if file.endswith('.html'): src = open(os.path.join(dirpath, file), "rb").read() - src = pythonize_re.sub('\n#', src) - open(os.path.join(dirpath, '%s.py' % file), "wb").write(src) thefile = '%s.py' % file - cmd = 'xgettext %s -d %s -L Perl --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( - os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile)) - (stdin, stdout, stderr) = os.popen3(cmd, 't') - msgs = stdout.read() - errors = stderr.read() - if errors: - print "errors happened while running xgettext on %s" % file - print errors - sys.exit(8) + open(os.path.join(dirpath, thefile), "wb").write(templatize(src)) + if verbose: + sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) + cmd = 'xgettext -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( + domain, os.path.join(dirpath, thefile)) + (stdin, stdout, stderr) = os.popen3(cmd, 't') + msgs = stdout.read() + errors = stderr.read() + if errors: + print "errors happened while running xgettext on %s" % file + print errors + sys.exit(8) + if thefile != file: old = '#: '+os.path.join(dirpath, thefile)[2:] new = '#: '+os.path.join(dirpath, file)[2:] msgs = msgs.replace(old, new) - if msgs: - open(potfile, 'ab').write(msgs) + if os.path.exists(potfile): + # Strip the header + msgs = '\n'.join(dropwhile(len, msgs.split('\n'))) + else: + msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8') + if msgs: + open(potfile, 'ab').write(msgs) + if thefile != file: os.unlink(os.path.join(dirpath, thefile)) - elif domain == 'django' and (file.endswith('.py') or file.endswith('.html')): - thefile = file - if file.endswith('.html'): - src = open(os.path.join(dirpath, file), "rb").read() - thefile = '%s.py' % file - open(os.path.join(dirpath, thefile), "wb").write(templatize(src)) - if verbose: - sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) - cmd = 'xgettext -d %s -L Python --keyword=gettext_noop --keyword=gettext_lazy --keyword=ngettext_lazy:1,2 --keyword=ugettext_noop --keyword=ugettext_lazy --keyword=ungettext_lazy:1,2 --from-code UTF-8 -o - "%s"' % ( - domain, os.path.join(dirpath, thefile)) - (stdin, stdout, stderr) = os.popen3(cmd, 't') - msgs = stdout.read() - errors = stderr.read() - if errors: - print "errors happened while running xgettext on %s" % file - print errors - sys.exit(8) - if thefile != file: - old = '#: '+os.path.join(dirpath, thefile)[2:] - new = '#: '+os.path.join(dirpath, file)[2:] - msgs = msgs.replace(old, new) - if os.path.exists(potfile): - # Strip the header - msgs = '\n'.join(dropwhile(len, msgs.split('\n'))) - else: - msgs = msgs.replace('charset=CHARSET', 'charset=UTF-8') - if msgs: - open(potfile, 'ab').write(msgs) - if thefile != file: - os.unlink(os.path.join(dirpath, thefile)) if os.path.exists(potfile): (stdin, stdout, stderr) = os.popen3('msguniq --to-code=utf-8 "%s"' % potfile, 'b') diff --git a/django/conf/locale/de/LC_MESSAGES/django.mo b/django/conf/locale/de/LC_MESSAGES/django.mo index 307976e4d5..2699d25e55 100644 Binary files a/django/conf/locale/de/LC_MESSAGES/django.mo and b/django/conf/locale/de/LC_MESSAGES/django.mo differ diff --git a/django/conf/locale/de/LC_MESSAGES/django.po b/django/conf/locale/de/LC_MESSAGES/django.po index 6978cf2d44..50fa66d43f 100644 --- a/django/conf/locale/de/LC_MESSAGES/django.po +++ b/django/conf/locale/de/LC_MESSAGES/django.po @@ -1,6 +1,7 @@ -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. +# Translation of django.po to German +# +# Copyright (C) 2005-2007, +# This file is distributed under the same license as the django package. # msgid "" "" @@ -1629,76 +1630,76 @@ msgstr "Webseite" msgid "flat pages" msgstr "Webseiten" -#: contrib/humanize/templatetags/humanize.py:17 +#: contrib/humanize/templatetags/humanize.py:20 msgid "th" -msgstr "" +msgstr "." -#: contrib/humanize/templatetags/humanize.py:17 +#: contrib/humanize/templatetags/humanize.py:20 msgid "st" -msgstr "" +msgstr "." -#: contrib/humanize/templatetags/humanize.py:17 +#: contrib/humanize/templatetags/humanize.py:20 msgid "nd" -msgstr "" +msgstr "." -#: contrib/humanize/templatetags/humanize.py:17 +#: contrib/humanize/templatetags/humanize.py:20 msgid "rd" -msgstr "" +msgstr "." -#: contrib/humanize/templatetags/humanize.py:47 +#: contrib/humanize/templatetags/humanize.py:50 #, python-format msgid "%(value).1f million" msgid_plural "%(value).1f million" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "%(value).1f Million" +msgstr[1] "%(value).1f Millionen" -#: contrib/humanize/templatetags/humanize.py:50 +#: contrib/humanize/templatetags/humanize.py:53 #, python-format msgid "%(value).1f billion" msgid_plural "%(value).1f billion" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "%(value).1f Milliarde" +msgstr[1] "%(value).1f Milliarden" -#: contrib/humanize/templatetags/humanize.py:53 +#: contrib/humanize/templatetags/humanize.py:56 #, python-format msgid "%(value).1f trillion" msgid_plural "%(value).1f trillion" -msgstr[0] "" -msgstr[1] "" +msgstr[0] "%(value).1f Billion" +msgstr[1] "%(value).1f Billionen" -#: contrib/humanize/templatetags/humanize.py:68 +#: contrib/humanize/templatetags/humanize.py:71 msgid "one" msgstr "ein" -#: contrib/humanize/templatetags/humanize.py:68 +#: contrib/humanize/templatetags/humanize.py:71 msgid "two" msgstr "zwei" -#: contrib/humanize/templatetags/humanize.py:68 +#: contrib/humanize/templatetags/humanize.py:71 msgid "three" msgstr "drei" -#: contrib/humanize/templatetags/humanize.py:68 +#: contrib/humanize/templatetags/humanize.py:71 msgid "four" msgstr "vier" -#: contrib/humanize/templatetags/humanize.py:68 +#: contrib/humanize/templatetags/humanize.py:71 msgid "five" msgstr "fünf" -#: contrib/humanize/templatetags/humanize.py:68 +#: contrib/humanize/templatetags/humanize.py:71 msgid "six" msgstr "sechs" -#: contrib/humanize/templatetags/humanize.py:68 +#: contrib/humanize/templatetags/humanize.py:71 msgid "seven" msgstr "sieben" -#: contrib/humanize/templatetags/humanize.py:68 +#: contrib/humanize/templatetags/humanize.py:71 msgid "eight" msgstr "acht" -#: contrib/humanize/templatetags/humanize.py:68 +#: contrib/humanize/templatetags/humanize.py:71 msgid "nine" msgstr "neun" diff --git a/django/contrib/admin/templates/admin/auth/user/change_password.html b/django/contrib/admin/templates/admin/auth/user/change_password.html index d9c1eae637..28e342da86 100644 --- a/django/contrib/admin/templates/admin/auth/user/change_password.html +++ b/django/contrib/admin/templates/admin/auth/user/change_password.html @@ -6,7 +6,6 @@ {% endblock %} {% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %} {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} -{% block userlinks %}{% trans 'Documentation' %} / {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} {% block breadcrumbs %}{% if not is_popup %} {% if user.is_authenticated and user.is_staff %} -
{% trans 'Welcome,' %} {% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}. {% block userlinks %}{% trans 'Documentation' %} / {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %}
+
+ {% trans 'Welcome,' %} {% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}. + {% block userlinks %} + {% trans 'Documentation' %} + / {% trans 'Change password' %} + / {% trans 'Log out' %} + {% endblock %} +
{% endif %} {% block nav-global %}{% endblock %} diff --git a/django/contrib/admin/templates/admin/change_form.html b/django/contrib/admin/templates/admin/change_form.html index 7e7b639139..49e709caf6 100644 --- a/django/contrib/admin/templates/admin/change_form.html +++ b/django/contrib/admin/templates/admin/change_form.html @@ -7,7 +7,6 @@ {% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %} {% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %} {% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %} -{% block userlinks %}{% trans 'Documentation' %} / {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %} {% block breadcrumbs %}{% if not is_popup %}