Ticket #12359: help_text_r12827.diff

File help_text_r12827.diff, 2.2 KB (added by trey@…, 15 years ago)
  • django/db/models/fields/related.py

     
    88from django.db.models.query import QuerySet
    99from django.db.models.query_utils import QueryWrapper
    1010from django.utils.encoding import smart_unicode
    11 from django.utils.translation import ugettext_lazy as _, string_concat, ungettext, ugettext
     11from django.utils.translation import ugettext_lazy as _, ungettext, ugettext
    1212from django.utils.functional import curry
    1313from django.core import exceptions
    1414from django import forms
     
    956956
    957957        Field.__init__(self, **kwargs)
    958958
    959         msg = _('Hold down "Control", or "Command" on a Mac, to select more than one.')
    960         self.help_text = string_concat(self.help_text, ' ', msg)
    961 
    962959    def get_choices_default(self):
    963960        return Field.get_choices(self, include_blank=False)
    964961
  • django/contrib/admin/options.py

     
    2121from django.utils.functional import curry
    2222from django.utils.text import capfirst, get_text_list
    2323from django.utils.translation import ugettext as _
    24 from django.utils.translation import ungettext, ugettext_lazy
     24from django.utils.translation import ungettext, ugettext_lazy, string_concat
    2525from django.utils.encoding import force_unicode
    2626try:
    2727    set
     
    5454    models.FileField:       {'widget': widgets.AdminFileWidget},
    5555}
    5656
     57SELECT_MULTIPLE_MSG = _('Hold down "Control", or "Command" on a Mac, to select more than one.')
     58
    5759csrf_protect_m = method_decorator(csrf_protect)
    5860
    5961class BaseModelAdmin(object):
     
    172174        elif db_field.name in (list(self.filter_vertical) + list(self.filter_horizontal)):
    173175            kwargs['widget'] = widgets.FilteredSelectMultiple(db_field.verbose_name, (db_field.name in self.filter_vertical))
    174176
     177        kwargs['help_text'] = string_concat(kwargs.get('help_text', ''), ' ', SELECT_MULTIPLE_MSG)
    175178        return db_field.formfield(**kwargs)
    176179
    177180    def _declared_fieldsets(self):
Back to Top