Last change
on this file since 1560 was
913,
checked in by Henrik Bettermann, 18 years ago
|
is_* keys removed from get* functions
|
-
Property svn:keywords set to
Id
|
File size:
833 bytes
|
Rev | Line | |
---|
[845] | 1 | ## Script (Python) "getCertificateInfo" |
---|
[556] | 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters=student=None |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
[805] | 10 | # $Id: getCertificateInfo.py 913 2006-11-21 10:49:45Z henrik $ |
---|
[556] | 11 | """ |
---|
| 12 | return Info about a Certificate |
---|
| 13 | """ |
---|
| 14 | request = context.REQUEST |
---|
| 15 | |
---|
| 16 | wf = context.portal_workflow |
---|
| 17 | path_info = request.get('PATH_INFO').split('/') |
---|
| 18 | |
---|
| 19 | info = {} |
---|
[573] | 20 | info['action'] = "%s" % context.campus.absolute_url() |
---|
[556] | 21 | info['choosen_ids'] = request.get('ids',[]) |
---|
| 22 | info['doc'] = context.getContent() |
---|
| 23 | items = [] |
---|
| 24 | levels = context.objectValues() |
---|
| 25 | for l in levels: |
---|
| 26 | row = {} |
---|
| 27 | ld = l.getContent() |
---|
| 28 | row['id'] = l.getId() |
---|
[577] | 29 | if hasattr(ld,'Title'): |
---|
| 30 | row['title'] = ld.Title() |
---|
| 31 | else: |
---|
| 32 | row['title'] = getattr(ld,'title','no title') |
---|
[556] | 33 | row['url'] = l.absolute_url() |
---|
| 34 | items.append(row) |
---|
| 35 | info['items'] = items |
---|
| 36 | return info |
---|
Note: See
TracBrowser for help on using the repository browser.