rset.py
changeset 5679 0f2ded880d01
parent 5557 1a534c596bff
parent 5671 3a2063b752f3
child 5687 3ea39709b50e
equal deleted inserted replaced
5676:aa04ccb8dd62 5679:0f2ded880d01
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    13 # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """The `ResultSet` class which is returned as result of an rql query
    18 """The `ResultSet` class which is returned as result of an rql query"""
    19 
    19 
    20 """
       
    21 __docformat__ = "restructuredtext en"
    20 __docformat__ = "restructuredtext en"
    22 
    21 
    23 from logilab.common.decorators import cached, clear_cache, copy_cache
    22 from logilab.common.decorators import cached, clear_cache, copy_cache
    24 
    23 
    25 from rql import nodes, stmts
    24 from rql import nodes, stmts
   598             return None, None
   597             return None, None
   599         rel = myvar.main_relation()
   598         rel = myvar.main_relation()
   600         if rel is not None:
   599         if rel is not None:
   601             index = rel.children[0].root_selection_index()
   600             index = rel.children[0].root_selection_index()
   602             if index is not None and self.rows[row][index]:
   601             if index is not None and self.rows[row][index]:
   603                 return self.get_entity(row, index), rel.r_type
   602                 try:
       
   603                     entity = self.get_entity(row, index)
       
   604                     return entity, rel.r_type
       
   605                 except NotAnEntity, exc:
       
   606                     return None, None
   604         return None, None
   607         return None, None
   605 
   608 
   606     @cached
   609     @cached
   607     def searched_text(self):
   610     def searched_text(self):
   608         """returns the searched text in case of full-text search
   611         """returns the searched text in case of full-text search