remove the annoying "Hold down control..." messages

1
2
3
4
5
6
7
8
9
def remove_holddown(form, fields):
    """This removes the unhelpful "Hold down the...." help texts for the
    specified fields for a form."""
    remove_message = unicode(_('Hold down "Control", or "Command" on a Mac, to select more than one.'))
    for field in fields:
        if field in form.base_fields:
            if form.base_fields[field].help_text:
                form.base_fields[field].help_text = form.base_fields[field].help_text.replace(remove_message, '').strip()
    return form

More like this

  1. Admin Image Widget by baumer1122 4 years, 9 months ago
  2. GeoDjango maps in admin TabularInlines by alanB 2 years, 7 months ago
  3. unique validation for ModelForm by whiskybar 5 years, 2 months ago
  4. DropDownMultiple widget by marinho 5 years ago
  5. jstree integration to django admin by pawnhearts 3 years, 4 months ago

Comments

malinich (on March 27, 2013):

**need in 8 line:

form.base_fields[field].help_text = ugettext_lazy(form.base_fields[field].help_text.replace(remove_message,''))
but anyway i don't can change in django this problem

#

(Forgotten your password?)