106 linkto = '%s:%s:%s' % (self.rtype, current_entity.eid, target(self)) |
106 linkto = '%s:%s:%s' % (self.rtype, current_entity.eid, target(self)) |
107 return self.build_url(vid='creation', etype=self.etype, |
107 return self.build_url(vid='creation', etype=self.etype, |
108 __linkto=linkto, |
108 __linkto=linkto, |
109 __redirectpath=current_entity.rest_path(), # should not be url quoted! |
109 __redirectpath=current_entity.rest_path(), # should not be url quoted! |
110 __redirectvid=self.req.form.get('__redirectvid', '')) |
110 __redirectvid=self.req.form.get('__redirectvid', '')) |
111 |
|
112 |
|
113 class LinkToEntityAction2(LinkToEntityAction): |
|
114 """LinkToEntity action where the action is not usable on the same |
|
115 entity's type as the one refered by the .etype attribute |
|
116 """ |
|
117 def my_selector(cls, req, rset, row=None, col=0, **kwargs): |
|
118 return chainall(match_search_state('normal'), |
|
119 but_etype, one_line_rset, accept, |
|
120 relation_possible(cls.rtype, role(cls), cls.etype), |
|
121 may_add_relation(cls.rtype, role(cls))) |
|
122 __selectors__ = my_selector, |
|
123 |
111 |