Last change
on this file since 15284 was
1959,
checked in by joachim, 17 years ago
|
faster method to detect isStudent
|
-
Property svn:keywords set to
Id
|
File size:
476 bytes
|
Rev | Line | |
---|
[845] | 1 | ## Script (Python) "isStudent" |
---|
[600] | 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
[874] | 7 | ##parameters= |
---|
[600] | 8 | ##title= |
---|
| 9 | ## |
---|
[805] | 10 | # $Id: isStudent.py 1959 2007-06-25 20:17:04Z joachim $ |
---|
[885] | 11 | |
---|
[1077] | 12 | member_id = str(context.portal_membership.getAuthenticatedMember()) |
---|
[1957] | 13 | #from Products.zdb import set_trace;set_trace() |
---|
| 14 | # if len(member_id) != 7: |
---|
| 15 | # return False |
---|
| 16 | # try: |
---|
| 17 | # int(member_id[1:]) |
---|
| 18 | # return True |
---|
| 19 | # except: |
---|
| 20 | # return False |
---|
[1959] | 21 | o = ord(member_id[1]) |
---|
| 22 | return o >= 48 and o <= 57 |
---|
Note: See
TracBrowser for help on using the repository browser.