Re: [SQLObject] Method to validate data
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2010-03-15 10:29:36
|
Hi. Please answer to the list, not to my personal address. On Fri, Mar 12, 2010 at 04:09:23PM -0600, ji...@ql... wrote: > My apologies for providing the superfluous info. I was just trying to be thorough. However, I've inserted the following code and again, am not getting to the second debug statement. > > def _set_dateRequested(self, value): > dateRequested = value.strftime('%Y/%m/%d') > log.debug('here') > requisitionPeriod = self.requisitionPeriod.id > log.debug(requisitionPeriod) With Python, a code is either executed, or raise an exception, or crash an interpreter. Did the code raise an exception or crash the interpreter? Perhaps, no. Hence the code was executed. How come requisitionPeriod was not in the log? I am not sure. It could be because it is None, though it's stranage for a ForeignKey. Try logging it with additional text: log.debug('requisitionPeriod=%s', requisitionPeriod) Even better log it with its type: log.debug('requisitionPeriod: %r %s', type(requisitionPeriod), requisitionPeriod) Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |