Hi Anthony, that worked thanks - although I had found this solution before 
and tried it without apparent success at the time. I can only assume I put 
it in the wrong place or there was another problem.

A couple of related Scheduler questions if I may:
Firstly, I have included all database accesses in the Scheduler code within 
a try... except statement so if there is a conflict then it just returns 
and tries again on the next pass as timing is not critical. However, is it 
possible that the problem can occur the other way round, where accessing 
the database from a view could happen whilst the Scheduler is also 
accessing it? The chances are very small, but it ought to be covered.

Secondly, how can I get the Scheduler to run automatically on startup? 
Web2py is running on a Raspberry Pi, so at the moment I log in remotely via 
PuTTy and type the start command. It obviously stops when I log out which 
is quite convenient during development, but now it all sort of works I 
would like to make it run by default.

Thanks,

Richard



On Thursday, 19 December 2013 23:34:02 UTC, Richard Brown wrote:

> I am using the Scheduler to perform some control functions and so have an 
> autonomous function, called by the Scheduler via 'poll.py', in a module 
> called 'utilities.py'. This scans some databases to decide what to 
> do, and this seems to work fine (I have (hopefully) coded around any 
> potential database conflicts).
>
> However, I want to report a value back from my function to display in a 
> View. How should I do this? Ideally I would like to update a database 
> record from my module function which I can interrogate and modify from the 
> view, but nothing I have tried so far seems to find its way back. I use 
> db=current.db in the function, but although this allow the function to get 
> parameters from the database, anything I write back does not modify the 
> actual database available to the View, or in 'Database Administration'.
>
> I have also tried using a session variable but that also appears as 'None' 
> when I read it in the view. The function is not called from anywhere so 
> there is no obvious way of using a return value. 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to