Justin Azoff wrote:
> I just reworked an app using sqlobject-0.6 to use a single connection to
> the backend, and to hand out objects converted to dictionaries using
> xmlrpc. This was mostly to enable caching on the db and to simplify a
> few things.
>
> but now, after the first few requests I start to get errors like:
>
> File "/tmp/sqlscanner/scandb.py", line 361, in scanasdict
> st=int(s.starttime)
> exceptions.AttributeError: SQLCall instance has no attribute '__int__'
>
> where that function is:
> def scanasdict(s):
> ...
> if s.starttime:
> st=int(s.starttime)
> else :
> st=0
> ...
> scan={
> "id": s.id,
> "ip": s.ip,
> ...
> "starttime": st,
> ...
> return scan
>
> and starttime is simply a DateTimeCol that can be NULL.
>
> What could be causing a SQLCall instance to be returned instead of a
> date, and how can I fix that?
This is a bug when using sqlbuilder.func.NOW(), like:
s.set(starttime=sqlbuilder.func.NOW())
I'm not sure what to do about this right now, in a general sense. I'd
recommend using DateTime.now() instead.
--
Ian Bicking / ia...@co... / http://blog.ianbicking.org
|