Accueil / Blog / Métier / Archives / How to list views used in your Plone site

How to list views used in your Plone site

Par Jean-Michel François — publié 21/11/2011
A code snippet to retrieve all views

A code snippet to retrieve all views

catalog = container.portal_catalog
types = container.portal_types.objectIds()
views = {}

for t in types:
    brains = catalog(portal_type=t)

    for brain in brains:
        ob = brain.getObject()
        layout = ob.getLayout()
        if t not in views:views[t] = []
        if layout not in views[t]:
            views[t].append(layout)

print views
return printed
ABONNEZ-VOUS À LA NEWSLETTER !
Voir aussi
PloneConf 2016, un vent nouveau sur Plone PloneConf 2016, un vent nouveau sur Plone 02/11/2016

Résumé de la conférence annuelle sur Plone qui s'est tenue à Boston.

Turning hackability into a use case 27/01/2015

When a CMS does not allow happy hacking anymore, it loses a very valid use case.

collective.z3cform.norobots: a captcha based on questions and answers 15/01/2010

I have released a new captcha widget/field for z3c.form in Plone. Unlike other captcha fields that ...

Plone Unified Installer and ZcxOracleDA 02/12/2010

Trying to setup cx_Oracle and ZcxOracleDA on a Plone/Zope Zeo setup using the Unified Installer ...

Connecting to Oracle with SQLAchemy and very simple Plone integration 11/06/2009

SQLAlchemy (The Python SQL Toolkit and Object Relational Mapper) allow Oracle connection through ...