Hi Web2pyers,

Has anyone sucessfully used the new scheduler functionality with *CouchDB? 
*(I'm 
assuming this is feasible)

I'm currently trying to use the scheduler on *Windows 7* with *CouchDB *as 
the DAL source.
My code works fine with sqlite but seems to silently fail using *CouchDB*- 
although the tables are correctly created.

e.g.

scheduler_db = DAL('couchdb://127.0.0.1:5984')
scheduler = 
Scheduler(scheduler_db,dict(demo1=demo1,demo2=demo2),heartbeat=1) 


(The *CouchDB* scheduler_worker table seems to mysteriously keep growing.)

When I try to manually add a task through the Admin (
http://127.0.0.1:8000/init/appadmin/insert/scheduler_db/scheduler_task)

I get the following error:

Traceback (most recent call last):
  File "C:\Users\ted\dev\web2py\gluon\restricted.py", line 205, in restricted
    exec ccode in environment
  File "C:/Users/ted/dev/Px/applications/init/controllers/appadmin.py" 
<http://127.0.0.1:8000/admin/default/edit/init/controllers/appadmin.py>, line 
270, in <module>
  File "C:\Users\ted\dev\web2py\gluon\globals.py", line 182, in <lambda>
    self._caller = lambda f: f()
  File "C:/Users/ted/dev/Px/applications/init/controllers/appadmin.py" 
<http://127.0.0.1:8000/admin/default/edit/init/controllers/appadmin.py>, line 
103, in insert
    if form.accepts(request.vars, session):
  File "C:\Users\ted\dev\web2py\gluon\sqlhtml.py", line 1307, in accepts
    self.vars.id = self.table.insert(**fields)
  File "C:\Users\ted\dev\web2py\gluon\dal.py", line 7422, in insert
    ret =  self._db._adapter.insert(self,self._listify(fields))
  File "C:\Users\ted\dev\web2py\gluon\dal.py", line 4432, in insert
    values = dict((k.name,self.represent(v,k.type)) for k,v in fields)
  File "C:\Users\ted\dev\web2py\gluon\dal.py", line 4432, in <genexpr>
    values = dict((k.name,self.represent(v,k.type)) for k,v in fields)
  File "C:\Users\ted\dev\web2py\gluon\dal.py", line 4402, in represent
    return repr(not isinstance(value,unicode) and value or value.encode('utf8'))
AttributeError: 'long' object has no attribute 'encode'

Any suggestions on what is going wrong?

Thanks,
Ted


-- 



Reply via email to