web/views/cwproperties.py
branchstable
changeset 7879 9aae456abab5
parent 7855 54283a5b7afc
child 7894 ad0eeb0f7a8d
equal deleted inserted replaced
7874:be04706eacc9 7879:9aae456abab5
     1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
   300     """
   300     """
   301     widget = Select
   301     widget = Select
   302 
   302 
   303     def render(self, form, renderer):
   303     def render(self, form, renderer):
   304         wdg = self.get_widget(form)
   304         wdg = self.get_widget(form)
       
   305         # pylint: disable=E1101
   305         wdg.attrs['tabindex'] = form._cw.next_tabindex()
   306         wdg.attrs['tabindex'] = form._cw.next_tabindex()
   306         wdg.attrs['onchange'] = "javascript:setPropValueWidget('%s', %s)" % (
   307         wdg.attrs['onchange'] = "javascript:setPropValueWidget('%s', %s)" % (
   307             form.edited_entity.eid, form._cw.next_tabindex())
   308             form.edited_entity.eid, form._cw.next_tabindex())
   308         return wdg.render(form, self, renderer)
   309         return wdg.render(form, self, renderer)
   309 
   310 
   335             # on key selection
   336             # on key selection
   336             return
   337             return
   337         try:
   338         try:
   338             pdef = form._cw.vreg.property_info(entity.pkey)
   339             pdef = form._cw.vreg.property_info(entity.pkey)
   339         except UnknownProperty, ex:
   340         except UnknownProperty, ex:
   340             self.warning('%s (you should probably delete that property '
   341             form.warning('%s (you should probably delete that property '
   341                          'from the database)', ex)
   342                          'from the database)', ex)
   342             msg = form._cw._('you should probably delete that property')
   343             msg = form._cw._('you should probably delete that property')
   343             self.widget = NotEditableWidget(entity.printable_value('value'),
   344             self.widget = NotEditableWidget(entity.printable_value('value'),
   344                                             '%s (%s)' % (msg, ex))
   345                                             '%s (%s)' % (msg, ex))
   345         if entity.pkey.startswith('system.'):
   346         if entity.pkey.startswith('system.'):