From 52a9e15794ac050afb17837a34407722e7249854 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Sat, 7 Jul 2012 15:29:20 +0200 Subject: [PATCH 1/7] Fixed a regression in the user admin page introduced in a92e7f37c4ae84b6b8d8016cc6783211e9047219. a92e7f37c4ae84b6b8d8016cc6783211e9047219 switched most of the internal stuff to format_html. Using format_html in the `render` method of `ReadOnlyPasswordHashWidget` caused it to generate `SafeString` instances. Later these safe strings where returned from `BoundField.__unicode__` which caused force_unicode to loose the "safe" information. This commit fixes that by ensuring that the render method returns `SafeUnicode` instead of `SafeString`. --- django/contrib/auth/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py index bce8747661..d2cb039e68 100644 --- a/django/contrib/auth/forms.py +++ b/django/contrib/auth/forms.py @@ -1,3 +1,5 @@ +from __future__ import unicode_literals + from django import forms from django.forms.util import flatatt from django.template import loader From 29ca3d3c4b3d330337cce8713196ef7eea956dc9 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 7 Jul 2012 16:00:03 +0200 Subject: [PATCH 2/7] Fixed #18587 -- Typo in management command example Thanks Frank Wiles. --- docs/howto/custom-management-commands.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/howto/custom-management-commands.txt b/docs/howto/custom-management-commands.txt index 4a27bdf7a9..12e8ec2494 100644 --- a/docs/howto/custom-management-commands.txt +++ b/docs/howto/custom-management-commands.txt @@ -129,7 +129,7 @@ default options such as :djadminopt:`--verbosity` and :djadminopt:`--traceback`. class Command(BaseCommand): ... - self.can_import_settings = True + can_import_settings = True def handle(self, *args, **options): From bbc590697a8cde2faf067b124d08fe9488db4905 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 7 Jul 2012 16:44:55 +0200 Subject: [PATCH 3/7] Removed Django 1.0-specific sections. --- docs/ref/contrib/gis/install.txt | 11 ----------- docs/ref/models/querysets.txt | 16 ---------------- 2 files changed, 27 deletions(-) diff --git a/docs/ref/contrib/gis/install.txt b/docs/ref/contrib/gis/install.txt index 00f8f8a370..805772fa88 100644 --- a/docs/ref/contrib/gis/install.txt +++ b/docs/ref/contrib/gis/install.txt @@ -838,17 +838,6 @@ your ``.profile`` to be able to run the package programs from the command-line:: __ http://www.kyngchaos.com/software/frameworks __ http://www.kyngchaos.com/software/postgres -.. note:: - - Use of these binaries requires Django 1.0.3 and above. If you are - using a previous version of Django (like 1.0.2), then you will have - to add the following in your settings: - - .. code-block:: python - - GEOS_LIBRARY_PATH='/Library/Frameworks/GEOS.framework/GEOS' - GDAL_LIBRARY_PATH='/Library/Frameworks/GDAL.framework/GDAL' - .. _psycopg2_kyngchaos: psycopg2 diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 2876f1474d..0a9005ad26 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -1768,22 +1768,6 @@ This queryset will be evaluated as subselect statement:: SELECT ... WHERE blog.id IN (SELECT id FROM ... WHERE NAME LIKE '%Cheddar%') -The above code fragment could also be written as follows:: - - inner_q = Blog.objects.filter(name__contains='Cheddar').values('pk').query - entries = Entry.objects.filter(blog__in=inner_q) - -.. warning:: - - This ``query`` attribute should be considered an opaque internal attribute. - It's fine to use it like above, but its API may change between Django - versions. - -This second form is a bit less readable and unnatural to write, since it -accesses the internal ``query`` attribute and requires a ``ValuesQuerySet``. -If your code doesn't require compatibility with Django 1.0, use the first -form, passing in a queryset directly. - If you pass in a ``ValuesQuerySet`` or ``ValuesListQuerySet`` (the result of calling ``values()`` or ``values_list()`` on a queryset) as the value to an ``__in`` lookup, you need to ensure you are only extracting one field in the From d94cfdcfae92fd4409cd1b5e14eebc75033266fd Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sat, 7 Jul 2012 17:42:04 +0200 Subject: [PATCH 4/7] Fixed #18589 -- Typo in generic CBV docs. Thanks cpthomas for the report. --- docs/topics/class-based-views/generic-display.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/topics/class-based-views/generic-display.txt b/docs/topics/class-based-views/generic-display.txt index 4c2f95ce17..0d4cb6244d 100644 --- a/docs/topics/class-based-views/generic-display.txt +++ b/docs/topics/class-based-views/generic-display.txt @@ -157,7 +157,7 @@ might look like the following:: That's really all there is to it. All the cool features of generic views come from changing the attributes set on the generic view. The :doc:`generic views reference` documents all the -generic views and their options in detail; the rest of this document will +generic views and their options in detail; the rest of this document will consider some of the common ways you might customize and extend generic views. @@ -220,7 +220,7 @@ more:: def get_context_data(self, **kwargs): # Call the base implementation first to get a context - context = super(PublisherDetailView, self).get_context_data(**kwargs) + context = super(PublisherDetail, self).get_context_data(**kwargs) # Add in a QuerySet of all the books context['book_list'] = Book.objects.all() return context @@ -284,7 +284,7 @@ technique:: from django.views.generic import ListView from books.models import Book - class AcmeBookListView(ListView): + class AcmeBookList(ListView): context_object_name = 'book_list' queryset = Book.objects.filter(publisher__name='Acme Publishing') @@ -361,7 +361,7 @@ use it in the template:: def get_context_data(self, **kwargs): # Call the base implementation first to get a context - context = super(PublisherBookListView, self).get_context_data(**kwargs) + context = super(PublisherBookList, self).get_context_data(**kwargs) # Add in the publisher context['publisher'] = self.publisher return context From 249c445446f0811d6396cfd3053aed33edf2e7b3 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sat, 7 Jul 2012 23:08:43 +0200 Subject: [PATCH 5/7] Fixed #18164 -- Precised startapp template context content --- docs/ref/django-admin.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 7ca1ee5ddd..31c46c7fa0 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -888,7 +888,8 @@ through the template engine: the files whose extensions match the with the ``--name`` option. The :class:`template context ` used is: -- Any option passed to the startapp command +- Any option passed to the startapp command (among the command's supported + options) - ``app_name`` -- the app name as passed to the command - ``app_directory`` -- the full path of the newly created app From 8015593bc1f2f226e7979bfdee8b7e88658d0e74 Mon Sep 17 00:00:00 2001 From: Julien Phalip Date: Sat, 7 Jul 2012 15:41:04 -0700 Subject: [PATCH 6/7] Fixed #17978 -- Fixed a minor layout issue when an inline contains a filter horizontal widget. Thanks to Aymeric Augustin for the report. --- django/contrib/admin/static/admin/css/widgets.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/contrib/admin/static/admin/css/widgets.css b/django/contrib/admin/static/admin/css/widgets.css index 2989f2f4fd..0a7012c7b2 100644 --- a/django/contrib/admin/static/admin/css/widgets.css +++ b/django/contrib/admin/static/admin/css/widgets.css @@ -41,7 +41,8 @@ text-align: left; } -.selector .selector-filter label { +.selector .selector-filter label, +.inline-group .aligned .selector .selector-filter label { width: 16px; padding: 2px; } From 5e94ef293cb1cfe4dc43cbd5509653c0e0bf66cf Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 8 Jul 2012 11:53:45 +0200 Subject: [PATCH 7/7] Fixed #18374 -- Explained "corrupt image" error Thanks fabian and charettes. --- docs/ref/forms/fields.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 486d49d796..082ec17a35 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -591,7 +591,11 @@ For each field, we describe the default widget used if you don't specify * Error message keys: ``required``, ``invalid``, ``missing``, ``empty``, ``invalid_image`` - Using an ImageField requires that the `Python Imaging Library`_ is installed. + Using an ``ImageField`` requires that the `Python Imaging Library`_ (PIL) + is installed and supports the image formats you use. If you encounter a + ``corrupt image`` error when you upload an image, it usually means PIL + doesn't understand its format. To fix this, install the appropriate + library and reinstall PIL. When you use an ``ImageField`` on a form, you must also remember to :ref:`bind the file data to the form `.