Ticket #9321: django_t9321_r15242_a.diff

File django_t9321_r15242_a.diff, 2.2 KB (added by Rob Speed, 14 years ago)

Updated patch from #12359 by trey@…

  • django/db/models/fields/related.py

     
    99from django.db.models.query_utils import QueryWrapper
    1010from django.db.models.deletion import CASCADE
    1111from django.utils.encoding import smart_unicode
    12 from django.utils.translation import (ugettext_lazy as _, string_concat,
    13     ungettext, ugettext)
     12from django.utils.translation import ugettext_lazy as _, ungettext, ugettext
    1413from django.utils.functional import curry
    1514from django.core import exceptions
    1615from django import forms
     
    10071006
    10081007        Field.__init__(self, **kwargs)
    10091008
    1010         msg = _('Hold down "Control", or "Command" on a Mac, to select more than one.')
    1011         self.help_text = string_concat(self.help_text, ' ', msg)
    1012 
    10131009    def get_choices_default(self):
    10141010        return Field.get_choices(self, include_blank=False)
    10151011
  • django/contrib/admin/options.py

     
    2424from django.utils.functional import curry
    2525from django.utils.text import capfirst, get_text_list
    2626from django.utils.translation import ugettext as _
    27 from django.utils.translation import ungettext
     27from django.utils.translation import ungettext, string_concat
    2828from django.utils.encoding import force_unicode
    2929
    3030HORIZONTAL, VERTICAL = 1, 2
     
    5353    models.FileField:       {'widget': widgets.AdminFileWidget},
    5454}
    5555
     56SELECT_MULTIPLE_MSG = _('Hold down "Control", or "Command" on a Mac, to select more than one.')
     57
    5658csrf_protect_m = method_decorator(csrf_protect)
    5759
    5860class BaseModelAdmin(object):
     
    180182        elif db_field.name in (list(self.filter_vertical) + list(self.filter_horizontal)):
    181183            kwargs['widget'] = widgets.FilteredSelectMultiple(db_field.verbose_name, (db_field.name in self.filter_vertical))
    182184
     185        kwargs['help_text'] = string_concat(kwargs.get('help_text', ''), ' ', SELECT_MULTIPLE_MSG)
     186
    183187        return db_field.formfield(**kwargs)
    184188
    185189    def _declared_fieldsets(self):
Back to Top