On Friday, September 6, 2019 at 7:17:29 PM UTC-7, Fabio Gubler wrote:
>
> I've realized the scheduler example shown on Vimeo video by M. Di Pierro 
> and it works properly.
> Now I'd like to show the time value on the web page (with a view).
> Could somebody give me an idea about how should I proceed?
> Should I create a Python module? and how to pass the time value from Model 
> to controller function?
> Thanks in advance for any help.
> Fabio
>

I shouldn't be answering this question without taking the time to see the 
video, because I don't really know where you're statring at,  but I'll see 
what I can do.

1.  In web2py, you need a controller function to respond to user requests.

2.  The controller function is invoked with a context that includes the 
request and the globals from the model files.
The globals include the DAL object specified (named "db" in all the 
examples) and the Scheduler object.  In the controller, you use the 
scheduler object to queue tasks or to check the task status.

3.  What the controller function returns is used to display things in the 
view.  If you query the task status in the controller, then you can return 
the values from the status.

What time is it that you want to display?  Do you want to know when it last 
ran or when it will next run?  Those times are in the status.

BTW, I recommend looking over Chapter 3 of the book.  Simple examples, 
probably simpler than the video, but it will help you keep in mind how the 
pieces go together.
<URL:http://web2py.com/books/default/chapter/29/03/overview>

/dps





-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/307ffc03-545a-4856-8631-05b4a5770add%40googlegroups.com.

Reply via email to