<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
On 01/25/2012 05:59 PM, Gilles Lenfant wrote:
<blockquote
cite="mid:CAJ8oE9LjPp6w3E2oB_RGbE3g6xG1n_eQwDGsKE4tCkEW2WQSUQ@mail.gmail.com"
type="cite">Hi,<br>
<br>
Untested but this may work :<br>
<br>
pdb> from zope.component.hooks import getSite<br>
pdb> catalog = getSite().portal_catalog<br>
</blockquote>
<br>
yep this work as well as <br>
<br>
catalog = getToolByName(getSite(), 'portal_catalog')<br>
<br>
but - if I'm not wrong - I think you should import getSite as<br>
<br>
from zope.site.hooks import getSite<br>
<br>
Cheers<br>
SimO<br>
<br>
<br>
<blockquote
cite="mid:CAJ8oE9LjPp6w3E2oB_RGbE3g6xG1n_eQwDGsKE4tCkEW2WQSUQ@mail.gmail.com"
type="cite">...<br>
<br>
HTH<br>
-- <br>
Gilles Lenfant<br>
<div class="gmail_quote">Le 25 janvier 2012 16:44, Maarten Nieber
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:maarten@usecm.com">maarten@usecm.com</a>></span>
a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm back working on a plone site, and need to test something
in the debugger.<br>
However, I don't know how to get the catalog.<br>
I have no document to start from (for some reason my debugging
context only has<br>
an exception object and some LDAP objects), so I cannot do the
normal<br>
<br>
catalog = getToolByName(self, 'portal_catalog')<br>
<br>
Does anyone know how to get the catalog without having an
object to get it from?<br>
<br>
Thanks,<br>
Maarten<br>
<br>
_______________________________________________<br>
Product-Developers mailing list<br>
<a moz-do-not-send="true"
href="mailto:Product-Developers@lists.plone.org">Product-Developers@lists.plone.org</a><br>
<a moz-do-not-send="true"
href="https://lists.plone.org/mailman/listinfo/plone-product-developers"
target="_blank">https://lists.plone.org/mailman/listinfo/plone-product-developers</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<span></span><span></span>-- <br>
Gilles LENFANT<br>
Ingénieur avant-vente - Architecte senior<br>
ALTER WAY SOLUTIONS<br>
T : 01 78 15 24 00<br>
F : 01 46 02 44 04<br>
<br>
Téléchargez notre nouveau livre blanc "Python, le développement
autrement"<br>
<a moz-do-not-send="true"
href="http://www.alterway.fr/publications/python-le-developpement-autrement"
target="_blank">http://www.alterway.fr/publications/python-le-developpement-autrement</a><br>
<br>
1 rue Royal, Bat. D<br>
227, les Bureaux de la Colinne<br>
92210 Saint Cloud<br>
<a moz-do-not-send="true" href="http://www.alterway.fr/solutions"
target="_blank">http://www.alterway.fr/solutions</a><br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Product-Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Product-Developers@lists.plone.org">Product-Developers@lists.plone.org</a>
<a class="moz-txt-link-freetext" href="https://lists.plone.org/mailman/listinfo/plone-product-developers">https://lists.plone.org/mailman/listinfo/plone-product-developers</a>
</pre>
</blockquote>
<br>
</body>
</html>