[Product-Developers] get catalog from Nothing

Gilles Lenfant gilles.lenfant at alterway.fr
Wed Jan 25 16:59:54 UTC 2012


Hi,

Untested but this may work :

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

HTH
-- 
Gilles Lenfant
Le 25 janvier 2012 16:44, Maarten Nieber <maarten at usecm.com> 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
> Product-Developers at lists.plone.org
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plone.org/pipermail/plone-product-developers/attachments/20120125/5357c7a3/attachment.html>


More information about the Product-Developers mailing list