[web2py] Re: how to call LOAD from one controller to access other with pagination as an example

2016-03-09 Thread Ron Chatterjee
Later, I see. So, if I have to call a function within a function I need to define the other one in the model. Learn something new everyday! Thank a lot Anthony. You deserve a gold medal. On Wednesday, March 9, 2016 at 6:44:29 PM UTC-5, Anthony wrote: > > > > On Wednesday, March 9, 2016 at

[web2py] Re: unable to see sqlite tables created through console using python console using gluon

2016-03-09 Thread Shayn Raney
This is some rabbit hole, looks like I need to do the following for some odd reason. db = DAL('sqlite://TestDB.sqlite', migrate_enabled=False On Wednesday, March 9, 2016 at 3:06:45 PM UTC-8, Shayn Raney wrote: > > So I take it I need to redescribe the DB again using define_table()? Ok, >

[web2py] Scheduler mysql error

2016-03-09 Thread Alfonso Serra
The scheduler is working on localhost but on pythonanywhere i get following error: starting single-scheduler for "myapp"... /home/aleonserra/web2py/gluon/packages/dal/pydal/adapters/base.py:1379: Warning: Incorrect integer value: 'F' for column 'is_ticker' at row 1 ret =

[web2py] Re: how to call LOAD from one controller to access other with pagination as an example

2016-03-09 Thread Anthony
On Wednesday, March 9, 2016 at 6:20:38 PM UTC-5, Ron Chatterjee wrote: > > I have a pagination that is called by multiple controller, I want to call > the pagination function by passing few arguments based on my display > requirement and get the output variables rather than keep typing these

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Alfonso Serra
Yes you are right, the connection resets often and even if it works its not worthy. -- 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

[web2py] how to call LOAD from one controller to access other with pagination as an example

2016-03-09 Thread Ron Chatterjee
I have a pagination that is called by multiple controller, I want to call the pagination function by passing few arguments based on my display requirement and get the output variables rather than keep typing these lines all the time to all the controllers. def pagination(): if

[web2py] Re: unable to see sqlite tables created through console using python console using gluon

2016-03-09 Thread Shayn Raney
So I take it I need to redescribe the DB again using define_table()? On Wednesday, March 9, 2016 at 2:59:11 PM UTC-8, Niphlod wrote: > > DAL is a database abstraction layer. you need to define tables EVERY time > you need to access them. > define_table() accidentally creates table if

[web2py] Re: unable to see sqlite tables created through console using python console using gluon

2016-03-09 Thread Niphlod
DAL is a database abstraction layer. you need to define tables EVERY time you need to access them. define_table() accidentally creates table if migrations are turned on, but define_table() doesn't map to "create a table" it stands for "define an entity that is mapped to a table". tl;dr:

[web2py] unable to see sqlite tables created through console using python console using gluon

2016-03-09 Thread Shayn Raney
I've been prototyping a few projects in a stand alone python script, all of this out the web2py framework I am seeing an issue where I can not access an existing sqlite tables and data I've created/inserted. But when I directly connect to it with SQLite console or other tools I have, the

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Niphlod
as soon as you acknowledge that: - what you're trying to do is highly discouraged - lots os safer/documented/supported/simpler ways exist feel free to experiment . On Wednesday, March 9, 2016 at 11:08:06 PM UTC+1, Alfonso Serra wrote: > > This looks like it works. > > import subprocess > ret

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Alfonso Serra
This looks like it works. import subprocess ret = subprocess.Popen(["python","D:/web2py/web2py.py", "-K", "myapp"], shell=True) print ret.pid I have the stdout in the same console as the server but both, the sched and the server, are working. This whole scheduler thing looks very messy but

[web2py] Amazon like slider

2016-03-09 Thread rajjmatthur
Trying to create amazon like slider for images/docs. Does anyone know of any jquery plugin for web2py that allows to do that? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Niphlod
simply said, you can't reliably. The whole reason you offload tasks to a worker vs a really simpler ajax call is because it's a totally external process that is NOT managed by the webserver. webservers do kill long-running processes (usually after 60 seconds) spawned by themselves to avoid

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Alfonso Serra
> > Ok this should do it. > def sched_running(): workers = sched.get_workers() for key, worker in workers.items(): last = (request.now - worker.last_heartbeat).seconds if last < 4: return True return False One last thing, any idea on how to

[web2py] Re: Get the auth_user.id after login

2016-03-09 Thread Anthony
On Wednesday, March 9, 2016 at 2:37:35 PM UTC-5, Ron Chatterjee wrote: > > db.auth_user.id > No, db.auth_user.id is simply a Field object, representing the "id" field in the auth_user table model definition. > Or > auth.user_id > In the above, "auth" refers to the instantiation of the Auth

Re: [web2py] Re: Get the auth_user.id after login

2016-03-09 Thread prashant joshi
db.auth_user.id... id from auth_user table On Thu, Mar 10, 2016 at 1:07 AM, Ron Chatterjee wrote: > db.auth_user.id > Or > auth.user_id > > > On Wednesday, March 9, 2016 at 2:29:55 PM UTC-5, prashant joshi wrote: >> >> how to get auth_user.id after login?? >> means if

[web2py] Re: Get the auth_user.id after login

2016-03-09 Thread Ron Chatterjee
db.auth_user.id Or auth.user_id On Wednesday, March 9, 2016 at 2:29:55 PM UTC-5, prashant joshi wrote: > > how to get auth_user.id after login?? > means if user1 is login then show his auth_user.id > if user2 login then show his idwhich is query or method for this > -- Resources: -

[web2py] Re: Get the auth_user.id after login

2016-03-09 Thread Anthony
Not quite sure what you mean. It's auth.user_id, not auth_user.id, and auth.user_id is always the ID of the currently logged in user (i.e., within each request, the value of auth.user_id is the ID of the user that made the request). auth.user_id is None if the user making the current request is

[web2py] Get the auth_user.id after login

2016-03-09 Thread prashant joshi
how to get auth_user.id after login?? means if user1 is login then show his auth_user.id if user2 login then show his idwhich is query or method for this -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] bug in IS_NOT_EMPTY() ?

2016-03-09 Thread Richard Vézina
Damn it, there is surely something else wrong also... Even with the removal I seems to have difficulty with other fields not included in the custom form which are removed with readable and writable False... I start to be clue less about the root cause of this issue... This form has worked

Re: [web2py] bug in IS_NOT_EMPTY() ?

2016-03-09 Thread Richard Vézina
Hello Anthony, Last suggestion seems the way to go... I do understand and I realise by trying to hack IS_NOT_EMPTY() that it makes no sens to refactoring it in anyway to make it support bool null since it never going to allow null value to be input in the DB. Though it certainly shouldn't prevent

[web2py] App using CAS doesn't have Profile option in User dropdown

2016-03-09 Thread Bill Black
I added an app to serve as CAS and another app (A) to use that service. Authentication works and all but in the app A, user menu has only 'Logout' option. I need access to the 'Profile'. So I manually added it (/appa/default/user/profile) and when I click on it, it gives me 404 error. I can go

[web2py] How i can do a form factory 2 tables with bulkdata

2016-03-09 Thread Yoel Baez
I need to do something like this in web2py... please help me.. Regards, Yoel -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

[web2py] Re: smartgrid example problem

2016-03-09 Thread JoeCodeswell
Dear Jim, Thanks for the response. I should have said the config info before. Web2py version: 2.13.4-stable+timestamp.2015.12.26.04.59.39 - Installed from source Os: windows -10 64 bit Python Interpreter: Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32 I

Re: [web2py] query sql form

2016-03-09 Thread Kiran Subbaraman
Am guessing you want to display the student's details, when they log in? It's a good idea to show some code that you have written. Also, I suggest you take a look at the web2py book ... the DAL section, and also this: http://web2py.com/books/default/chapter/29/09/access-control#Customizing-Auth

[web2py] query sql form

2016-03-09 Thread prashant joshi
I have create stud_mark table. and i use @auth.requires_login table *my question is * If i am login then it will show my record..,, eg if rohit is login then rohit show its 10 mark 12 mark...etc i also reference the stud_mark id field to auth_user how i done this??? please suggest me

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Niphlod
I'd check for < 30 to be sure that the worker is not sleeping but the general idea is that. BTW: don't ever ever do from datetime import datetime given web2py's unique execution model, anything past that will have the import screwed . use plain import datetime if in need. BTW2: you don't

[web2py] Re: list:reference, multiple=True, validation error

2016-03-09 Thread villas
I just saw that issue no. 1203 has been addressed by a new commit. I did a quick test and the bug seems to have been resolved. Many thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Alfonso Serra
This would be the funcion: from gluon.scheduler import Scheduler sched = Scheduler(db) def sched_running(): from datetime import datetime workers = sched.get_workers() for key, worker in workers.items(): last = (datetime.now() - worker.last_heartbeat).seconds if

[web2py] Re: list:reference, multiple=True, validation error

2016-03-09 Thread villas
On Tuesday, 8 March 2016 18:12:07 UTC, Leonel Câmara wrote: > > Do you have multiple=True as a keyword argument to your IS_IN_DB validator? > My entire test code is as stated in this thread. I invite anyone who wishes to reproduce the bug to use that code. Make sure your web2py is using the

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Alfonso Serra
Thanks Niphlod. So i can inspect for workers with a last_heartbeat less than 4 seconds ago (default interval is 3 i think). Is that right? It might work, thanks. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Niphlod
there's a method for it, get_workers(). according to your heartbeat interval, you can inspect for any worker that has a last_heartbeat too much in the past to see if it's running or not. On Wednesday, March 9, 2016 at 12:06:50 PM UTC+1, Niphlod wrote: > > BTW: exactly as a webapp is suppossed

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Niphlod
BTW: exactly as a webapp is suppossed to be kept alive from the os, the same applies to the scheduler. That being said the controller that queue tasks can see if any scheduler is alive inspecting the scheduler_worker table. On Wednesday, March 9, 2016 at 11:42:25 AM UTC+1, Alfonso Serra wrote:

[web2py] Re: How to know if the scheduler is running?

2016-03-09 Thread Alfonso Serra
Thanks Nico ill give it a try. On Wednesday, 9 March 2016 09:46:55 UTC, Nico de Groot wrote: > > Or use something like Monit (on Linux) to check if scheduler is still > running, restarting it if it's not. > > Nico de Groot > -- Resources: - http://web2py.com - http://web2py.com/book

[web2py] How to know if the scheduler is running?

2016-03-09 Thread Nico de Groot
Or use something like Monit (on Linux) to check if scheduler is still running, restarting it if it's not. Nico de Groot -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list