Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 1056:1c2a2ecc1b03
fix to :required
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 05 Sep 2002 23:48:55 +0000 |
| parents | cf72eae57a2c |
| children | a55ef5a98fd3 |
comparison
equal
deleted
inserted
replaced
| 1055:cf72eae57a2c | 1056:1c2a2ecc1b03 |
|---|---|
| 1 # $Id: client.py,v 1.15 2002-09-05 23:39:12 richard Exp $ | 1 # $Id: client.py,v 1.16 2002-09-05 23:48:55 richard Exp $ |
| 2 | 2 |
| 3 __doc__ = """ | 3 __doc__ = """ |
| 4 WWW request handler (also used in the stand-alone server). | 4 WWW request handler (also used in the stand-alone server). |
| 5 """ | 5 """ |
| 6 | 6 |
| 1050 must be supplied or a ValueError will be raised. | 1050 must be supplied or a ValueError will be raised. |
| 1051 ''' | 1051 ''' |
| 1052 required = [] | 1052 required = [] |
| 1053 if form.has_key(':required'): | 1053 if form.has_key(':required'): |
| 1054 value = form[':required'] | 1054 value = form[':required'] |
| 1055 print 'required', value | |
| 1055 if isinstance(value, type([])): | 1056 if isinstance(value, type([])): |
| 1056 required = [i.value.strip() for i in value] | 1057 required = [i.value.strip() for i in value] |
| 1057 else: | 1058 else: |
| 1058 required = [i.strip() for i in value.value.split(',')] | 1059 required = [i.strip() for i in value.value.split(',')] |
| 1059 | 1060 |
| 1076 # we've got a MiniFieldStorage, so pull out the value and strip | 1077 # we've got a MiniFieldStorage, so pull out the value and strip |
| 1077 # surrounding whitespace | 1078 # surrounding whitespace |
| 1078 value = value.value.strip() | 1079 value = value.value.strip() |
| 1079 | 1080 |
| 1080 if isinstance(proptype, hyperdb.String): | 1081 if isinstance(proptype, hyperdb.String): |
| 1081 pass | 1082 if not value: |
| 1082 value = form[key].value.strip() | 1083 continue |
| 1083 elif isinstance(proptype, hyperdb.Password): | 1084 elif isinstance(proptype, hyperdb.Password): |
| 1084 if not value: | 1085 if not value: |
| 1085 # ignore empty password values | 1086 # ignore empty password values |
| 1086 continue | 1087 continue |
| 1087 value = password.Password(value) | 1088 value = password.Password(value) |
