goa/appobjects/components.py
changeset 1808 aa09e20dd8c0
parent 1802 d628defebc17
child 1977 606923dff11b
--- a/goa/appobjects/components.py	Tue May 05 17:18:49 2009 +0200
+++ b/goa/appobjects/components.py	Thu May 14 12:48:11 2009 +0200
@@ -1,28 +1,21 @@
 """overrides some base views for cubicweb on google appengine
 
 :organization: Logilab
-:copyright: 2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2008-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
 
-from os.path import join
-
 from logilab.mtconverter import html_escape
-from logilab.common.decorators import cached
 
 from cubicweb import typed_eid
+from cubicweb.selectors import one_line_rset, match_search_state, accept
 from cubicweb.schema import display_name
 from cubicweb.common.view import StartupView, EntityView
-from cubicweb.common.selectors import (one_line_rset, match_search_state,
-                                    accept)
 from cubicweb.web import Redirect
 from cubicweb.web.views import vid_from_rset
-from cubicweb.goa.db import rset_from_objs
 
-from google.appengine.api import datastore, mail
-
-from main import APPLROOT
+from google.appengine.api import mail
 
 
 class SearchForAssociationView(EntityView):
@@ -30,10 +23,8 @@
     to search for something to link to the edited eid
     """
     id = 'search-associate'
-    
-    __selectors__ = (one_line_rset, match_search_state, accept)
-    accepts = ('Any',)
-    search_states = ('linksearch',)
+
+    __select__ = one_line_rset() & match_search_state('linksearch') & accept
 
     def cell_call(self, row, col):
         entity = self.entity(0, 0)
@@ -52,7 +43,7 @@
     binary = True
     content_type = 'image/png'
     def call(self):
-        """display global schema information"""        
+        """display global schema information"""
         skipmeta = not int(self.req.form.get('withmeta', 0))
         if skipmeta:
             url = self.build_url('data/schema.png')