make title overriddable stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 27 Nov 2009 22:05:10 +0100
branchstable
changeset 3931 882de7c1c247
parent 3930 c0ae3148b893
child 3932 8c883f1f108e
make title overriddable
web/views/editforms.py
--- a/web/views/editforms.py	Fri Nov 27 22:04:54 2009 +0100
+++ b/web/views/editforms.py	Fri Nov 27 22:05:10 2009 +0100
@@ -512,7 +512,7 @@
         """fetch and render the form"""
         entity = self._entity()
         divid = '%s-%s-%s' % (self.peid, self.rtype, entity.eid)
-        title = self.req.pgettext(i18nctx, 'This %s' % entity.e_schema)
+        title = self.form_title(entity, i18nctx=i18nctx, **kwargs)
         removejs = self.removejs % (self.peid, self.rtype, entity.eid)
         countkey = '%s_count' % self.rtype
         try:
@@ -523,6 +523,9 @@
             divid=divid, title=title, removejs=removejs, i18nctx=i18nctx,
             counter=self.req.data[countkey], **kwargs))
 
+    def form_title(self, entity, i18nctx, **kwargs):
+        return self.req.pgettext(i18nctx, 'This %s' % entity.e_schema)
+
     def add_hiddens(self, form, entity):
         """to ease overriding (see cubes.vcsfile.views.forms for instance)"""
         iid = 'rel-%s-%s-%s' % (self.peid, self.rtype, entity.eid)