Last change
on this file since 1389 was
1315,
checked in by joachim, 18 years ago
|
M skins/waeup_student/getFormattedStudentEntry.py
do the sex right.
M skins/waeup_student/getSessionResults.py
remove wrong getattr(student,'clearance')
M profiles/default/schemas/student_study_course.xml
removed redundant fields
|
-
Property svn:keywords set to
Id
|
File size:
569 bytes
|
Rev | Line | |
---|
[1269] | 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 1315 2007-01-17 17:38:41Z 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 f == "sex": |
---|
| 20 | if d[f]: |
---|
[1315] | 21 | d[f] = 'F' |
---|
| 22 | else: |
---|
| 23 | d[f] = 'M' |
---|
[1314] | 24 | elif f == "name": |
---|
| 25 | d[f] = d[f].strip() |
---|
[1269] | 26 | return d |
---|
Note: See
TracBrowser for help on using the repository browser.