Last change
on this file since 7657 was
1970,
checked in by joachim, 17 years ago
|
add dumpStudentsCatalog
|
-
Property svn:keywords set to
Id
|
File size:
615 bytes
|
Line | |
---|
1 | ## Script (Python) "getFormattedStudentEntry" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters=brain |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: getFormattedStudentEntry.py 1970 2007-06-26 15:01:57Z joachim $ |
---|
11 | """ |
---|
12 | return a formatted StudentCatalog Entry |
---|
13 | """ |
---|
14 | #from Products.zdb import set_trace;set_trace() |
---|
15 | fields = context.students_catalog.schema() |
---|
16 | d = {} |
---|
17 | for f in fields: |
---|
18 | d[f] = getattr(brain,f,'') |
---|
19 | if not d[f]: |
---|
20 | d[f] = '' |
---|
21 | if f == "sex": |
---|
22 | if d[f]: |
---|
23 | d[f] = 'F' |
---|
24 | else: |
---|
25 | d[f] = 'M' |
---|
26 | elif f == "name": |
---|
27 | d[f] = d[f].strip() |
---|
28 | |
---|
29 | return d |
---|
Note: See
TracBrowser for help on using the repository browser.