|
Last change
on this file since 8564 was
1415,
checked in by joachim, 20 years ago
|
|
added new Function add_student
|
-
Property svn:keywords set to
Id
|
|
File size:
567 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 1415 2007-02-14 12:54:55Z 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]: |
|---|
| 21 | d[f] = 'F' |
|---|
| 22 | else: |
|---|
| 23 | d[f] = 'M' |
|---|
| 24 | elif f == "name": |
|---|
| 25 | d[f] = d[f].strip() |
|---|
| 26 | return d |
|---|
Note: See
TracBrowser for help on using the repository browser.