Bugs item #1073535, was opened at 2004-11-26 07:33
Message generated for change (Settings changed) made by phd
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1073535&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: SQLObject release (specify)
>Status: Closed
>Resolution: Wont Fix
Priority: 4
Private: No
Submitted By: Justin A (justin_a)
Assigned to: Nobody/Anonymous (nobody)
Summary: sqlbuilder funcs get cached instead of their value
Initial Comment:
when caching is enabled and you do
foo.bardate=sqlbuilder.func.now()
it updates the db correctly, but foo.bardate then has
the value of the sqlbuilder function:
----------------------------------------------------------------------
Comment By: Ian Bicking (ianbicking)
Date: 2005-09-20 20:06
Message:
Logged In: YES
user_id=210337
As a workaround, if you call obj.sync() or obj.expire()
after setting one of its attributes to a sqlbuilder object,
it will refetch the data (immediately or lazily,
respectively) and get rid of that bad value.
In this particular case, it is best to use datetime.now
(e.g., default=datetime.now).
However, I'm not closing this, as SQLObject should detect
these objects and call obj.expire() on its own.
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-01 19:12
Message:
Logged In: YES
user_id=4799
That breaks the rule "do a least unexpected thing". Running
SELECT upon an assignment is certainly a very unexpected
beahviour. Even running SELECT upon reading such attribute
is a bit strange.
Currently one can overcome that by setting cacheValues to
False. Well, I must admit the solution solves too much - it
forces a SELECT for accessing ANY attribute.
Well, I can be wrong. Can you bring the subject to the
mailing list? Public discussions about controversial
subjects are better than SF tracker.
----------------------------------------------------------------------
Comment By: Justin A (justin_a)
Date: 2005-03-01 18:46
Message:
Logged In: YES
user_id=547833
I would think it should run SELECT on any assignment to a
function...
----------------------------------------------------------------------
Comment By: Oleg Broytmann (phd)
Date: 2005-03-01 18:08
Message:
Logged In: YES
user_id=4799
Ok, now look. You ran the query
UPDATE dates SET dateb = NOW() WHERE id = 2
How should SQLObject know the value of NOW() on the server?
Should it run SELECT? Really, should it run SELECT on the
attribute assignment?! on any attribute assignment?
----------------------------------------------------------------------
Comment By: Justin A (justin_a)
Date: 2004-11-26 07:34
Message:
Logged In: YES
user_id=547833
This is with sqlobject 0.6.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1073535&group_id=74338
|