Last change
on this file since 11027 was
3070,
checked in by joachim, 17 years ago
|
fix doc-string
|
-
Property svn:keywords set to
Id
|
File size:
422 bytes
|
Line | |
---|
1 | ##parameters=key=None |
---|
2 | # $Id: getScratchCardCost.py 3070 2008-01-30 19:34:03Z joachim $ |
---|
3 | """ |
---|
4 | Return the scratchcard-cost as an vocabulary |
---|
5 | |
---|
6 | """ |
---|
7 | if key is None: |
---|
8 | res = context.portal_catalog.search({'portal_type': "ScratchCardBatch"}) |
---|
9 | return [(d.getId,d.getObject().getContent().cost) for d in res] |
---|
10 | res = context.portal_catalog.search({'portal_type': "ScratchCardBatch", 'id': key}) |
---|
11 | if res: |
---|
12 | return res[-1].getObject().getContent().cost |
---|
13 | return "unknown batch %s" % key |
---|
14 | |
---|
Note: See
TracBrowser for help on using the repository browser.