equal
deleted
inserted
replaced
10 |
10 |
11 from logilab.mtconverter import html_escape |
11 from logilab.mtconverter import html_escape |
12 from logilab.common.decorators import cached |
12 from logilab.common.decorators import cached |
13 |
13 |
14 from cubicweb import typed_eid |
14 from cubicweb import typed_eid |
|
15 from cubicweb.selectors import one_line_rset, match_search_state, accept |
15 from cubicweb.schema import display_name |
16 from cubicweb.schema import display_name |
16 from cubicweb.common.view import StartupView, EntityView |
17 from cubicweb.common.view import StartupView, EntityView |
17 from cubicweb.common.selectors import (one_line_rset, match_search_state, |
|
18 accept) |
|
19 from cubicweb.web import Redirect |
18 from cubicweb.web import Redirect |
20 from cubicweb.web.views import vid_from_rset |
19 from cubicweb.web.views import vid_from_rset |
21 from cubicweb.goa.db import rset_from_objs |
20 from cubicweb.goa.db import rset_from_objs |
22 |
21 |
23 from google.appengine.api import datastore, mail |
22 from google.appengine.api import datastore, mail |
29 """view called by the edition view when the user asks |
28 """view called by the edition view when the user asks |
30 to search for something to link to the edited eid |
29 to search for something to link to the edited eid |
31 """ |
30 """ |
32 id = 'search-associate' |
31 id = 'search-associate' |
33 |
32 |
34 __selectors__ = (one_line_rset, match_search_state, accept) |
33 __selectors__ = (one_line_rset, match_search_state('linksearch'), accept) |
35 accepts = ('Any',) |
|
36 search_states = ('linksearch',) |
|
37 |
34 |
38 def cell_call(self, row, col): |
35 def cell_call(self, row, col): |
39 entity = self.entity(0, 0) |
36 entity = self.entity(0, 0) |
40 role, eid, rtype, etype = self.req.search_state[1] |
37 role, eid, rtype, etype = self.req.search_state[1] |
41 assert entity.eid == typed_eid(eid) |
38 assert entity.eid == typed_eid(eid) |