I am trying to access tables that require the user to be logged in.  Am I able to access these tables within my scheduler functions?


On Wed, Jun 25, 2014 at 2:55 AM, Niphlod <[email protected]> wrote:

why on hearth should you define tables based on the fact that a user is logged-in or not ?
Scheduler functions are executed in a world that does not care for the usual request/response/session environment, and surely they do no count to be "logged in"...  

On Wednesday, June 25, 2014 12:53:57 AM UTC+2, Cory wrote:
Hi,
I am trying to access tables within my scheduler function. The tables I am trying to access require "@auth.requires_login()".
Am I able to access these tables within my scheduler.py model file? right now I am passing table row fields as parameters
to the scheduler function and it is very messy. 
In scheduler.py I have tried to include:

db = DAL("postgres://postgres......blah)
from gluon.tools import Auth
auth = Auth(db)

if auth.is_logged_in():


thanks!


--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/_-MWC1WrOkY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to