Re: [Modeling-users] validateForSave question
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-09-17 11:34:48
|
"Ernesto Revilla" <er...@si...> wrote: > In the doc: http://modeling.sourceforge.net/UserGuide/validate-for-save.h= tml > appears the following text: >=20 > <quote> [...] > <quote> >=20 > 1. doing the import and trying a Validation.Exception() fails. I think it= should be, Validation.ValidationException(), shouldn't it? > 2. On the other hand the instruction sequence: >=20 > error=3DValidation.Exception() > try: > CustomObject.validateForSave(self) > except Validation.Exception, error: > error.aggregateException(error) >=20 > gets me confused. Shouldn't it be as follow?: >=20 > error=3DValidation.Exception() > try: > CustomObject.validateForSave(self) > except Validation.Exception, exc: > error.aggregateException(exc) >=20 > Note that I catch the exception argument with exc and add it afterwards= to error with 'aggregateException'. You're absolutely right: 1. ValidationException was indeed Validation a long time ago, and doc. was not updated. 2. the code snippet in the code is really buggy, it should read e.g. _error=3DValidationException() try: CustomObject.validateForSave(self) except ValidationException, error: _error.aggregateException(error) or just the way you do. BTW I tend to think that requiring the super's method to be called is somehow not a good idea. This might change in a n= ear future if you think that it could be a better idea (so that it works just as validate<AttributeName>() does, without calling super). Thanks for reporting, I'll change the doc. accordingly. -- S=E9bastien. |