[Zope3-checkins] CVS: Zope3/src/zope/app/browser/workflow - workflows.py:1.1

Stephan Richter srichter@cosmos.phy.tufts.edu
Tue, 29 Jul 2003 21:51:08 -0400


Update of /cvs-repository/Zope3/src/zope/app/browser/workflow
In directory cvs.zope.org:/tmp/cvs-serv7874/app/browser/workflow

Added Files:
	workflows.py 
Log Message:
Oops, forgot to add these files to the CVS. They go with the previous checkin.


=== Added File Zope3/src/zope/app/browser/workflow/workflows.py ===
from zope.app.browser.services.registration import \
     NameComponentRegistryView, NameRegistryView
from zope.app.traversing import traverse, getParent, getName
from zope.component import getView

class WorkflowsRegistryView(NameComponentRegistryView):

    def _getItem(self, name, view, cfg):
        item_dict = NameRegistryView._getItem(self, name, view, cfg)
        if cfg is not None:
            ob = traverse(getParent(getParent(cfg)), cfg.componentPath)
            url = str(getView(ob, 'absolute_url', self.request))
        else:
            url = None
        item_dict['url'] = url
        return item_dict