# HG changeset patch # User Aurelien Campeas # Date 1231516611 -3600 # Node ID 66804d97b919f44965a5cb6502b0885ddb9ba4d4 # Parent 06e7f2932afe9473cdcaeb237a7a0ae3ac061952 [FAQ] debugging selectors : a new faq entry diff -r 06e7f2932afe -r 66804d97b919 doc/book/en/D010-faq.en.txt --- a/doc/book/en/D010-faq.en.txt Fri Jan 09 15:29:51 2009 +0100 +++ b/doc/book/en/D010-faq.en.txt Fri Jan 09 16:56:51 2009 +0100 @@ -211,3 +211,17 @@ Any change applied to configuration file requires to restart your application. + +* I get NoSelectableObject exceptions: how do I debug selectors ? + + You just need to put the appropriate context manager around view/component + selection: :: + + from cubicweb.common.selectors import traced_selection + with traced_selection(): + comp = self.vreg.select_object('contentnavigation', 'wfhistory', + self.req, rset, context='navcontentbottom') + + This will yield additional WARNINGs, like this: :: + + 2009-01-09 16:43:52 - (cubicweb.selectors) WARNING: selector one_line_rset returned 0 for