387 # set of tags of the form <action>_on_new on relations. <action> is a |
387 # set of tags of the form <action>_on_new on relations. <action> is a |
388 # schema action (add/update/delete/read), and when such a tag is found |
388 # schema action (add/update/delete/read), and when such a tag is found |
389 # permissions checking is by-passed and supposed to be ok |
389 # permissions checking is by-passed and supposed to be ok |
390 autoform_permissions_overrides = RelationTagsSet('autoform_permissions_overrides') |
390 autoform_permissions_overrides = RelationTagsSet('autoform_permissions_overrides') |
391 |
391 |
|
392 class _ReleditTags(RelationTagsDict): |
|
393 _keys = frozenset('reload default_value noedit'.split()) |
|
394 |
|
395 def tag_subject_of(self, key, *args, **kwargs): |
|
396 subj, rtype, obj = key |
|
397 if obj != '*': |
|
398 self.warning('using explict target type in display_ctrl.tag_subject_of() ' |
|
399 'has no effect, use (%s, %s, "*") instead of (%s, %s, %s)', |
|
400 subj, rtype, subj, rtype, obj) |
|
401 super(_ReleditTags, self).tag_subject_of(key, *args, **kwargs) |
|
402 |
|
403 def tag_object_of(self, key, *args, **kwargs): |
|
404 subj, rtype, obj = key |
|
405 if subj != '*': |
|
406 self.warning('using explict subject type in display_ctrl.tag_object_of() ' |
|
407 'has no effect, use ("*", %s, %s) instead of (%s, %s, %s)', |
|
408 rtype, obj, subj, rtype, obj) |
|
409 super(_ReleditTags, self).tag_object_of(key, *args, **kwargs) |
|
410 |
|
411 def tag_relation(self, key, tag): |
|
412 for tagkey in tag.iterkeys(): |
|
413 assert tagkey in self._keys |
|
414 return super(_ReleditTags, self).tag_relation(key, tag) |
|
415 |
|
416 reledit_ctrl = _ReleditTags('reledit') |
|
417 |
392 # boxes.EditBox configuration ################################################# |
418 # boxes.EditBox configuration ################################################# |
393 |
419 |
394 # 'link' / 'create' relation tags, used to control the "add entity" submenu |
420 # 'link' / 'create' relation tags, used to control the "add entity" submenu |
395 def init_actionbox_appearsin_addmenu(rtag, sschema, rschema, oschema, role): |
421 def init_actionbox_appearsin_addmenu(rtag, sschema, rschema, oschema, role): |
396 if rtag.get(sschema, rschema, oschema, role) is None: |
422 if rtag.get(sschema, rschema, oschema, role) is None: |