Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 1224:e58a59b2a290
reversion - allow unsetting of Links again
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 26 Sep 2002 03:21:03 +0000 |
| parents | 2658b694c3ab |
| children | eae6a5eb62e0 |
comparison
equal
deleted
inserted
replaced
| 1223:3232e3f11a23 | 1224:e58a59b2a290 |
|---|---|
| 1 # $Id: client.py,v 1.44 2002-09-25 05:27:07 richard Exp $ | 1 # $Id: client.py,v 1.45 2002-09-26 03:21:03 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 |
| 1131 else: | 1131 else: |
| 1132 continue | 1132 continue |
| 1133 elif isinstance(proptype, hyperdb.Link): | 1133 elif isinstance(proptype, hyperdb.Link): |
| 1134 # see if it's the "no selection" choice | 1134 # see if it's the "no selection" choice |
| 1135 if value == '-1': | 1135 if value == '-1': |
| 1136 continue | 1136 value = None |
| 1137 # handle key values | 1137 else: |
| 1138 link = proptype.classname | 1138 # handle key values |
| 1139 if not num_re.match(value): | 1139 link = proptype.classname |
| 1140 try: | 1140 if not num_re.match(value): |
| 1141 value = db.classes[link].lookup(value) | 1141 try: |
| 1142 except KeyError: | 1142 value = db.classes[link].lookup(value) |
| 1143 raise ValueError, _('property "%(propname)s": ' | 1143 except KeyError: |
| 1144 '%(value)s not a %(classname)s')%{'propname':key, | 1144 raise ValueError, _('property "%(propname)s": ' |
| 1145 'value': value, 'classname': link} | 1145 '%(value)s not a %(classname)s')%{'propname':key, |
| 1146 except TypeError, message: | 1146 'value': value, 'classname': link} |
| 1147 raise ValueError, _('you may only enter ID values ' | 1147 except TypeError, message: |
| 1148 'for property "%(propname)s": %(message)s')%{ | 1148 raise ValueError, _('you may only enter ID values ' |
| 1149 'propname':key, 'message': message} | 1149 'for property "%(propname)s": %(message)s')%{ |
| 1150 'propname':key, 'message': message} | |
| 1150 elif isinstance(proptype, hyperdb.Multilink): | 1151 elif isinstance(proptype, hyperdb.Multilink): |
| 1151 if isinstance(value, type([])): | 1152 if isinstance(value, type([])): |
| 1152 # it's a list of MiniFieldStorages | 1153 # it's a list of MiniFieldStorages |
| 1153 value = [i.value.strip() for i in value] | 1154 value = [i.value.strip() for i in value] |
| 1154 else: | 1155 else: |
