[CMF-checkins] CVS: CMF/CMFDefault/skins/generic - TitleOrId.py:1.1

Andrew Sawyers andrew@zope.com
Tue, 9 Oct 2001 14:06:07 -0400


Update of /cvs-repository/CMF/CMFDefault/skins/generic
In directory cvs.zope.org:/tmp/cvs-serv28400

Added Files:
	TitleOrId.py 
Log Message:

*A python script to get rid of using title_or_id -- returns
Title() or Title if present, otherwise returns getId() or id


=== Added File CMF/CMFDefault/skins/generic/TitleOrId.py ===
## Script (Python) "TitleOrId"
##parameters=dontCall=0
##bind namespace=_
##title=Return Title or getId
if dontCall:
    title = context.Title
    id = context.id
else:
    title = context.Title()
    id = context.getId()
if title:
    return title 
else:
    return id