Line | |
---|
1 | ##parameters=key=None,doc=None |
---|
2 | # $Id: reservedRoomsVoc.py 3254 2008-02-28 13:06:20Z joachim $ |
---|
3 | """ |
---|
4 | Return the reservedrooms as an vocabulary |
---|
5 | |
---|
6 | """ |
---|
7 | if doc is None: |
---|
8 | doc = context.getContent() |
---|
9 | voc = [("_".join((r.split('/')[0].strip(),r.split('/')[1].strip())),r) |
---|
10 | for r in doc.reserved_rooms.split(',') if r] |
---|
11 | #from Products.zdb import set_trace;set_trace() |
---|
12 | if not key: |
---|
13 | return voc |
---|
14 | for k,v in voc: |
---|
15 | if k == key: |
---|
16 | return v |
---|
17 | raise KeyError |
---|
Note: See
TracBrowser for help on using the repository browser.