[reledit] #894131: use "<`attribute` unset>" instead of generic "<not specified>" when an attribute or relation has no value stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 26 May 2010 11:01:50 +0200
branchstable
changeset 5583 24125df012f3
parent 5582 3e133b29a1a4
child 5584 c1823448f81d
[reledit] #894131: use "<`attribute` unset>" instead of generic "<not specified>" when an attribute or relation has no value
web/views/editforms.py
--- a/web/views/editforms.py	Wed May 26 10:28:48 2010 +0200
+++ b/web/views/editforms.py	Wed May 26 11:01:50 2010 +0200
@@ -17,8 +17,8 @@
 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
 """Set of HTML automatic forms to create, delete, copy or edit a single entity
 or a list of entities of the same type
+"""
 
-"""
 __docformat__ = "restructuredtext en"
 _ = unicode
 
@@ -27,10 +27,11 @@
 from logilab.mtconverter import xml_escape
 from logilab.common.decorators import cached
 
+from cubicweb import tags
 from cubicweb.selectors import (match_kwargs, one_line_rset, non_final_entity,
                                 specified_etype_implements, implements, yes)
 from cubicweb.view import EntityView
-from cubicweb import tags
+from cubicweb.schema import display_name
 from cubicweb.web import uicfg, stdmsgs, eid_param, dumps, \
      formfields as ff, formwidgets as fw
 from cubicweb.web.form import FormViewMixIn, FieldNotFound
@@ -306,7 +307,8 @@
         self._cw.add_js('cubicweb.edition.js')
         self._cw.add_css('cubicweb.form.css')
         if default is None:
-            default = xml_escape(self._cw._('<no value>'))
+            default = xml_escape(self._cw._('<%s not specified>')
+                                 % display_name(self._cw, rtype, role))
         schema = self._cw.vreg.schema
         entity = self.cw_rset.get_entity(row, col)
         rschema = schema.rschema(rtype)