~ubuntu-branches/ubuntu/quantal/python-django/quantal

« back to all changes in this revision

Viewing changes to django/contrib/admin/widgets.py

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2009-10-12 19:22:16 UTC
  • mfrom: (1.1.9 upstream) (4.4.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091012192216-l4wb7fp72wow19zp
Tags: 1.1.1-1ubuntu1
* Merge python-django 1.1.1-1 from debian unstable (LP: #447617)
  for security and bug fixes, all Ubuntu changes merged by Debian.
* Add to debian/patches:
  - 20_python2.6.3_regression.patch - backported upstream commit 11620
    to make Django work with Python 2.6.3 properly. (LP: #445639)

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
from django import forms
8
8
from django.forms.widgets import RadioFieldRenderer
9
9
from django.forms.util import flatatt
 
10
from django.utils.html import escape
10
11
from django.utils.text import truncate_words
11
12
from django.utils.translation import ugettext as _
12
13
from django.utils.safestring import mark_safe
148
149
    def label_for_value(self, value):
149
150
        key = self.rel.get_related_field().name
150
151
        obj = self.rel.to._default_manager.get(**{key: value})
151
 
        return '&nbsp;<strong>%s</strong>' % truncate_words(obj, 14)
 
152
        return '&nbsp;<strong>%s</strong>' % escape(truncate_words(obj, 14))
152
153
 
153
154
class ManyToManyRawIdWidget(ForeignKeyRawIdWidget):
154
155
    """