Ticket #8543: internationalized_order_and_delete_labels_for_formsets_r8554.diff
File internationalized_order_and_delete_labels_for_formsets_r8554.diff, 1.4 KB (added by , 16 years ago) |
---|
-
django/forms/formsets.py
1 1 from forms import Form 2 2 from django.utils.encoding import StrAndUnicode 3 3 from django.utils.safestring import mark_safe 4 from django.utils.translation import ugettext as _ 4 5 from fields import IntegerField, BooleanField 5 6 from widgets import Media, HiddenInput 6 7 from util import ErrorList, ValidationError … … 238 239 if self.can_order: 239 240 # Only pre-fill the ordering field for initial forms. 240 241 if index < self._initial_form_count: 241 form.fields[ORDERING_FIELD_NAME] = IntegerField(label= 'Order', initial=index+1, required=False)242 form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), initial=index+1, required=False) 242 243 else: 243 form.fields[ORDERING_FIELD_NAME] = IntegerField(label= 'Order', required=False)244 form.fields[ORDERING_FIELD_NAME] = IntegerField(label=_(u'Order'), required=False) 244 245 if self.can_delete: 245 form.fields[DELETION_FIELD_NAME] = BooleanField(label= 'Delete', required=False)246 form.fields[DELETION_FIELD_NAME] = BooleanField(label=_(u'Delete'), required=False) 246 247 247 248 def add_prefix(self, index): 248 249 return '%s-%s' % (self.prefix, index)