##parameters=key=None
# $Id: getScratchCardCost.py 2668 2007-11-15 16:05:55Z joachim $
"""
Return the faculties as an vocabulary

"""
if key is None:
    res = context.portal_catalog.search({'portal_type': "ScratchCardBatch"})    
    return [(d.getId,d.getObject().getContent().cost) for d in res]
res = context.portal_catalog.search({'portal_type': "ScratchCardBatch", 'id': key})
if res:
    return res[-1].getObject().getContent().cost
return "unknown batch %s" % key

