web/uicfg.py
changeset 2689 44f041222d0f
parent 2671 ee5538bdf0ea
child 2703 27c04321fc81
equal deleted inserted replaced
2685:0518ca8f63e3 2689:44f041222d0f
    65 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
    65 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
    66 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
    66 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
    67 """
    67 """
    68 __docformat__ = "restructuredtext en"
    68 __docformat__ = "restructuredtext en"
    69 
    69 
    70 from cubicweb import neg_role
    70 from cubicweb import neg_role, onevent
    71 from cubicweb.rtags import (RelationTags, RelationTagsBool,
    71 from cubicweb.rtags import (RelationTags, RelationTagsBool,
    72                             RelationTagsSet, RelationTagsDict)
    72                             RelationTagsSet, RelationTagsDict)
    73 from cubicweb.web import formwidgets
    73 from cubicweb.web import formwidgets
    74 
    74 
    75 
    75 
   141     rtag.setdefault((sschema, rschema, oschema, role), 'label', label)
   141     rtag.setdefault((sschema, rschema, oschema, role), 'label', label)
   142     rtag.setdefault((sschema, rschema, oschema, role), 'order', rtag._counter)
   142     rtag.setdefault((sschema, rschema, oschema, role), 'order', rtag._counter)
   143 
   143 
   144 primaryview_display_ctrl = DisplayCtrlRelationTags('primaryview_display_ctrl',
   144 primaryview_display_ctrl = DisplayCtrlRelationTags('primaryview_display_ctrl',
   145                                                    init_primaryview_display_ctrl)
   145                                                    init_primaryview_display_ctrl)
   146 
       
   147 
   146 
   148 # index view configuration ####################################################
   147 # index view configuration ####################################################
   149 # entity type section in the index/manage page. May be one of
   148 # entity type section in the index/manage page. May be one of
   150 # * 'application'
   149 # * 'application'
   151 # * 'system'
   150 # * 'system'
   203 # set of tags of the form <action>_on_new on relations. <action> is a
   202 # set of tags of the form <action>_on_new on relations. <action> is a
   204 # schema action (add/update/delete/read), and when such a tag is found
   203 # schema action (add/update/delete/read), and when such a tag is found
   205 # permissions checking is by-passed and supposed to be ok
   204 # permissions checking is by-passed and supposed to be ok
   206 autoform_permissions_overrides = RelationTagsSet('autoform_permissions_overrides')
   205 autoform_permissions_overrides = RelationTagsSet('autoform_permissions_overrides')
   207 
   206 
   208 
       
   209 # boxes.EditBox configuration #################################################
   207 # boxes.EditBox configuration #################################################
   210 
   208 
   211 # 'link' / 'create' relation tags, used to control the "add entity" submenu
   209 # 'link' / 'create' relation tags, used to control the "add entity" submenu
   212 def init_actionbox_appearsin_addmenu(rtag, sschema, rschema, oschema, role):
   210 def init_actionbox_appearsin_addmenu(rtag, sschema, rschema, oschema, role):
   213     if rtag.get(sschema, rschema, oschema, role) is None:
   211     if rtag.get(sschema, rschema, oschema, role) is None:
   217             rtag.tag_relation((sschema, rschema, oschema, role), True)
   215             rtag.tag_relation((sschema, rschema, oschema, role), True)
   218 
   216 
   219 actionbox_appearsin_addmenu = RelationTagsBool('actionbox_appearsin_addmenu',
   217 actionbox_appearsin_addmenu = RelationTagsBool('actionbox_appearsin_addmenu',
   220                                                init_actionbox_appearsin_addmenu)
   218                                                init_actionbox_appearsin_addmenu)
   221 
   219 
       
   220 @onevent('before-source-reload')
       
   221 def clear_rtag_objects():
       
   222     print 'YAHOO ' * 80
       
   223     primaryview_section.clear()
       
   224     primaryview_display_ctrl.clear()
       
   225     autoform_section.clear()
       
   226     autoform_field.clear()
       
   227     autoform_field_kwargs.clear()
       
   228     autoform_is_inlined.clear()
       
   229     autoform_permissions_overrides.clear()
       
   230     actionbox_appearsin_addmenu.clear()