Hi,

On 01/25/2012 05:59 PM, Gilles Lenfant wrote:
Hi,

Untested but this may work :

pdb> from zope.component.hooks import getSite
pdb> catalog = getSite().portal_catalog

yep this work as well as

catalog = getToolByName(getSite(), 'portal_catalog')

but - if I'm not wrong - I think you should import getSite as

from zope.site.hooks import getSite

Cheers
SimO


...

HTH
--
Gilles Lenfant
Le 25 janvier 2012 16:44, Maarten Nieber <[email protected] <mailto:[email protected]>> a écrit :

    Hi,

    I'm back working on a plone site, and need to test something in
    the debugger.
    However, I don't know how to get the catalog.
    I have no document to start from (for some reason my debugging
    context only has
    an exception object and some LDAP objects), so I cannot do the normal

    catalog = getToolByName(self, 'portal_catalog')

    Does anyone know how to get the catalog without having an object
    to get it from?

    Thanks,
    Maarten

    _______________________________________________
    Product-Developers mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.plone.org/mailman/listinfo/plone-product-developers




--
--
Gilles LENFANT
Ingénieur avant-vente - Architecte senior
ALTER WAY SOLUTIONS
T : 01 78 15 24 00
F : 01 46 02 44 04

Téléchargez notre nouveau livre blanc "Python, le développement autrement"
http://www.alterway.fr/publications/python-le-developpement-autrement

1 rue Royal, Bat. D
227, les Bureaux de la Colinne
92210 Saint Cloud
http://www.alterway.fr/solutions


_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

Reply via email to