Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 2056:ba1d54edc53f
nicer invalid property error in HTML templating
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 27 Feb 2004 00:41:07 +0000 |
| parents | 5a5f66e6b0e1 |
| children | a94eacad51c8 |
comparison
equal
deleted
inserted
replaced
| 2054:f804d466ed91 | 2056:ba1d54edc53f |
|---|---|
| 374 # we don't exist | 374 # we don't exist |
| 375 if item == 'id': | 375 if item == 'id': |
| 376 return None | 376 return None |
| 377 | 377 |
| 378 # get the property | 378 # get the property |
| 379 prop = self._props[item] | 379 try: |
| 380 prop = self._props[item] | |
| 381 except KeyError: | |
| 382 raise KeyError, 'No such property "%s" on %s'%(item, self.classname) | |
| 380 | 383 |
| 381 # look up the correct HTMLProperty class | 384 # look up the correct HTMLProperty class |
| 382 form = self._client.form | 385 form = self._client.form |
| 383 for klass, htmlklass in propclasses: | 386 for klass, htmlklass in propclasses: |
| 384 if not isinstance(prop, klass): | 387 if not isinstance(prop, klass): |
