510 |
510 |
511 def render_form(self, i18nctx, **kwargs): |
511 def render_form(self, i18nctx, **kwargs): |
512 """fetch and render the form""" |
512 """fetch and render the form""" |
513 entity = self._entity() |
513 entity = self._entity() |
514 divid = '%s-%s-%s' % (self.peid, self.rtype, entity.eid) |
514 divid = '%s-%s-%s' % (self.peid, self.rtype, entity.eid) |
515 title = self.req.pgettext(i18nctx, 'This %s' % entity.e_schema) |
515 title = self.form_title(entity, i18nctx=i18nctx, **kwargs) |
516 removejs = self.removejs % (self.peid, self.rtype, entity.eid) |
516 removejs = self.removejs % (self.peid, self.rtype, entity.eid) |
517 countkey = '%s_count' % self.rtype |
517 countkey = '%s_count' % self.rtype |
518 try: |
518 try: |
519 self.req.data[countkey] += 1 |
519 self.req.data[countkey] += 1 |
520 except KeyError: |
520 except KeyError: |
521 self.req.data[countkey] = 1 |
521 self.req.data[countkey] = 1 |
522 self.w(self.form.form_render( |
522 self.w(self.form.form_render( |
523 divid=divid, title=title, removejs=removejs, i18nctx=i18nctx, |
523 divid=divid, title=title, removejs=removejs, i18nctx=i18nctx, |
524 counter=self.req.data[countkey], **kwargs)) |
524 counter=self.req.data[countkey], **kwargs)) |
|
525 |
|
526 def form_title(self, entity, i18nctx, **kwargs): |
|
527 return self.req.pgettext(i18nctx, 'This %s' % entity.e_schema) |
525 |
528 |
526 def add_hiddens(self, form, entity): |
529 def add_hiddens(self, form, entity): |
527 """to ease overriding (see cubes.vcsfile.views.forms for instance)""" |
530 """to ease overriding (see cubes.vcsfile.views.forms for instance)""" |
528 iid = 'rel-%s-%s-%s' % (self.peid, self.rtype, entity.eid) |
531 iid = 'rel-%s-%s-%s' % (self.peid, self.rtype, entity.eid) |
529 # * str(self.rtype) in case it's a schema object |
532 # * str(self.rtype) in case it's a schema object |