diff -r e8032965f37a -r 78d5b57d4964 web/views/formrenderers.py --- a/web/views/formrenderers.py Fri May 29 14:19:30 2009 +0200 +++ b/web/views/formrenderers.py Fri May 29 14:43:58 2009 +0200 @@ -69,7 +69,7 @@ w = data.append w(self.open_form(form, values)) if self.display_progress_div: - w(u'
%s
' % form.req._('validating...')) + w(u'
%s
' % self.req._('validating...')) w(u'
') w(tags.input(type=u'hidden', name=u'__form_id', value=values.get('formvid', form.id))) @@ -85,7 +85,7 @@ return '\n'.join(data) def render_label(self, form, field): - label = form.req._(field.label) + label = self.req._(field.label) attrs = {'for': form.context[field]['id']} if field.required: attrs['class'] = 'required' @@ -95,11 +95,11 @@ help = [] descr = field.help if descr: - help.append('
%s
' % form.req._(descr)) - example = field.example_format(form.req) + help.append('
%s
' % self.req._(descr)) + example = field.example_format(self.req) if example: help.append('
(%s: %s)
' - % (form.req._('sample format'), example)) + % (self.req._('sample format'), example)) return u' '.join(help) # specific methods (mostly to ease overriding) ############################# @@ -109,7 +109,7 @@ This method should be called once inlined field errors has been consumed """ - req = form.req + req = self.req errex = form.form_valerror # get extra errors if errex is not None: @@ -138,7 +138,7 @@ else: enctype = 'application/x-www-form-urlencoded' if form.action is None: - action = form.req.build_url('edit') + action = self.req.build_url('edit') else: action = form.action tag = ('
') w(u'%s' - % tags.input(type='checkbox', title=form.req._('toggle check boxes'), + % tags.input(type='checkbox', title=self.req._('toggle check boxes'), onclick="setCheckboxesState('eid', this.checked)")) for field in self.forms[0].fields: if self.display_field(form, field) and field.is_visible(): - w(u'%s' % form.req._(field.label)) + w(u'%s' % self.req._(field.label)) w(u'') @@ -319,7 +319,7 @@ def open_form(self, form, values): attrs_fs_label = ('
%s
' - % form.req._('main informations')) + % self.req._('main informations')) attrs_fs_label += '
' return attrs_fs_label + super(EntityFormRenderer, self).open_form(form, values) @@ -352,7 +352,7 @@ srels_by_cat = form.srelations_by_category('generic', 'add') if not srels_by_cat: return u'' - req = form.req + req = self.req _ = req._ label = u'%s :' % _('This %s' % form.edited_entity.e_schema).capitalize() eid = form.edited_entity.eid @@ -371,7 +371,7 @@ if not form.force_display and form.maxrelitems < len(related): link = (u'' % form.req._('view all')) + '' % self.req._('view all')) w(u'' % link) w(u'') w(u'') @@ -413,7 +413,7 @@ if not hasattr(form, 'inlined_relations'): return entity = form.edited_entity - __ = form.req.__ + __ = self.req.__ for rschema, targettypes, role in form.inlined_relations(): # show inline forms only if there's one possible target type # for rschema @@ -473,9 +473,9 @@ w(u'
' % values) else: w(u'
%s
' % ( - values['divid'], form.req._('click on the box to cancel the deletion'))) + values['divid'], self.req._('click on the box to cancel the deletion'))) w(u'
') - values['removemsg'] = form.req.__('remove this %s' % form.edited_entity.e_schema) + values['removemsg'] = self.req.__('remove this %s' % form.edited_entity.e_schema) w(u'
%(title)s ' '#1 ' '[%(removemsg)s]
'