[web2py] Is web2py incompatible with 2nd generation Google Cloud SQL ?

2017-04-24 Thread Karoly Kantor
Dear Sirs, I can connect my Google App Engine web2p app to a first generation GAE SQL instance, but not to a second generation one. I was talking to a cloud SQL support person on another forum and he said, I quote: "Your first generation CloudSQL instance has the app name as an authorized

[web2py] Open uploaded files in some editor.

2017-04-24 Thread akshay055kumar
Hello, I am creating an SQLFORM which asks user to upload their files. this is the table defination: db.define_table('scripts', Field('script', 'upload',requires=IS_NOT_EMPTY(error_message='Upload some file'), Field('category',requires=IS_IN_SET(['Ruby', 'Python', 'Linux'])),

[web2py] SQLFORM.grid question

2017-04-24 Thread Jim Russell
Hi all. I'm having an issue with an SQLFORM.gird query. I have a table where one of the columns references another table. Here are the table definitions: db.define_table('osrwhitelistpool', Field('id', type='id'), Field('pool', type='string', length=255, unique=True),

[web2py] Re: Forms with readonly fields

2017-04-24 Thread Anthony
Right. I think I didn't run into that issue because the original values in the updated record already satisfied the validation criteria. Note, there was another problem with the solution allowing a malicious user to pass back altered values for the readonly fields, so I updated the code to an

[web2py] Re: btw: great job

2017-04-24 Thread Carlos Kitu
Yeah! Awesome product and support. So good that I seldom need to make questions in this forum. Thank you and best regards. El domingo, 23 de abril de 2017, 5:35:29 (UTC+2), lucas escribió: > > hey everyone, > > I think we should recognize and congratulate Massimo and the developers of >

[web2py] Re: conditional block insert

2017-04-24 Thread Pierre
found the bogue.a nasty supernumerary {{pass}} in the sidebar.html thank you guys for your patience and perseverence... -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

Re: [web2py] Re: table already exists; 'Rows' object has no attribute 'fields'

2017-04-24 Thread Dave S
On Saturday, April 22, 2017 at 9:49:26 PM UTC-7, pbreit wrote: > > I reinstalled Mac OS Sierra which appears to have fixed the problems. > That seems like a rather drastic solution. Perhaps there were issues with paths variables pointing in various directions as new replaced old (FSVO

[web2py] Re: Field date error

2017-04-24 Thread Dave S
On Sunday, April 23, 2017 at 9:04:09 PM UTC-7, Winter Kryz wrote: > > Hello everybody, > > I have a table > db.define_table('Person', > Field('last_name', 'string'), > Field('first_name', 'string'), > Field('nationality','string'), >

[web2py] Re: How do I run the web2py scheduler under the models directory

2017-04-24 Thread Dave S
On Monday, April 24, 2017 at 12:40:00 PM UTC-7, Anthony wrote: > > Yeah, don't put the queue_task code in the model, as it will get executed > every time the model is executed. If you just need to set up the task once, > you can do so by directly inserting a record in the scheduler_task table

[web2py] Re: force redirect after expiration login session expiration time

2017-04-24 Thread Dave S
On Monday, April 24, 2017 at 12:49:56 PM UTC-7, Anthony wrote: > > On Monday, April 24, 2017 at 6:52:16 AM UTC-4, A3 wrote: >> >> Thanks, I thought there was a standard solution. >> > > This is not a very common pattern except on highly secure websites (e.g., > banking). > Indeed, a common use

[web2py] Re: force redirect after expiration login session expiration time

2017-04-24 Thread Anthony
On Monday, April 24, 2017 at 6:52:16 AM UTC-4, A3 wrote: > > Thanks, I thought there was a standard solution. > This is not a very common pattern except on highly secure websites (e.g., banking). > Unfortunately it doesn't work: > I hoped it worked but it seems that the ajax call keeps the

[web2py] Re: How do I run the web2py scheduler under the models directory

2017-04-24 Thread Anthony
Yeah, don't put the queue_task code in the model, as it will get executed every time the model is executed. If you just need to set up the task once, you can do so by directly inserting a record in the scheduler_task table via appadmin or by calling queue_task() in a web2py shell. Or you could

[web2py] How do I run the web2py scheduler under the models directory

2017-04-24 Thread Kenneth Ban
Hi, I'm trying to set up the web2py scheduler to run an hourly task and put the following code as scheduler.py in the models directory: from gluon.scheduler import Scheduler def log(): logging.warning('is when this event was logged.') import logging logger =

[web2py] Re: GET queries other than ID

2017-04-24 Thread David Shavers
Sweet, 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 the Google Groups "web2py-users"

[web2py] Re: GET queries other than ID

2017-04-24 Thread Anthony
On Monday, April 24, 2017 at 3:15:48 PM UTC-4, David Shavers wrote: > > Hey Anthony, > > Thanks for replying. So what you're saying is that the auto generated > value for cost_per_night is trying to get me to put in two integers and > that the resulting json will be a range withing those two?

[web2py] Re: conditional block insert

2017-04-24 Thread Anthony
In general, that approach should work, so you'll have to show your code for further diagnosis. Anthony On Monday, April 24, 2017 at 9:49:04 AM UTC-4, Pierre wrote: > > hello everyone, > > {{block left_sidebar}} > {{if auth.has_membership('manager'):}} >{{include 'manager_sidebar.html'}} >

Re: [web2py] conditional block insert

2017-04-24 Thread Anthony
On Monday, April 24, 2017 at 10:27:55 AM UTC-4, Áureo Dias Neto wrote: > > is all python code, you can use one '{{' at the begin of code and '}}' at > end > > {{block left_sidebar > if auth.has_membership('manager'): > include 'manager_sidebar.html' > else: >include 'sidebar.html' > pass >

[web2py] Re: GET queries other than ID

2017-04-24 Thread David Shavers
Hey Anthony, Thanks for replying. So what you're saying is that the auto generated value for cost_per_night is trying to get me to put in two integers and that the resulting json will be a range withing those two? For example: the link you posted would give me all of the values between 25 and

[web2py] Re: GET queries other than ID

2017-04-24 Thread Anthony
On Friday, April 21, 2017 at 3:12:00 PM UTC-4, David Shavers wrote: > > /room-owner/cost-per-night/{room_owner.cost_per_night.ge}/{ > room_owner.cost_per_night.lt} > /room-owner/cost-per-night/{room_owner.cost_per_night.ge}/{ > room_owner.cost_per_night.lt}/:field > Notice the pattern for

[web2py] Re: more on @auth.requires

2017-04-24 Thread Anthony
The main issue is not to do the database hit to generate the list_of_roles_manger_site until you actually need to check the roles. You code below is not ideal because the expensive operation is generating the list, and you are generating the list every time the controller file is accessed. You

Re: {Disarmed} Re: {Disarmed} Re: [web2py] Re: lack of documentation

2017-04-24 Thread Anthony
On Monday, April 24, 2017 at 7:07:29 AM UTC-4, Andrea Fae' wrote: > > Yes you are right, but there is something in the book, something in the > codeno complete full documentation...managed in only one site. It's > like it is...I have to accept this. thanks > You don't have to accept it --

Re: [web2py] Re: Open Sourced dating website

2017-04-24 Thread David Shavers
I've been trying to keep spam accounts to a minimum, but I do agree that I should provide a test account for other developers to browse. Username: alex101 Password: alex101 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

Re: [web2py] IMPORTANT - WEB2PY CONSULTING

2017-04-24 Thread David Shavers
Hey Richard, I've been trying to keep spam accounts to a minimum, but I do agree that I should provide a test account for other developers to browse. Username: alex101 Password: alex101 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] IMPORTANT - WEB2PY CONSULTING

2017-04-24 Thread Richard Vézina
No offense David, but if I want to see your site I am not going to register for it... I suggest you allow a lending page without @auth.requires_login() On Mon, Apr 24, 2017 at 10:55 AM, David Shavers wrote: > Hi, I have a dating website that uses a lot of web2py features.

[web2py] Re: UPDATE BOOTSTRAP VERSION FROM 3 TO 4

2017-04-24 Thread Donald McClymont
I think there are use cases for both sqlform and client side frameworks. In terms of bs4 there seem to be sites that will do a conversion so I would think it must be possible to make new form styles for bs4 as was done for bs3? Albeit I imagine this is not a particularly fun job it can't be

[web2py] Re: Google SQL Database user and password - where to set?

2017-04-24 Thread Karoly Kantor
More info: This in the log: DEBUG: connect attempt 4, connection error: Traceback (most recent call last): File "/base/data/home/apps/e~unidb-project/2.400786701713097994/gluon/packages/dal/pydal/base.py", line 446

Re: {Disarmed} Re: {Disarmed} Re: [web2py] Re: lack of documentation

2017-04-24 Thread Andrea Fae'
I completely agree with you about the book. It's very good written. Il giorno lunedì 24 aprile 2017 15:05:35 UTC+2, Ramos ha scritto: > > After a while you will go back to the book and say, aha here it is... and > then you realize that the "ONES" that made the book did a great job... > > That is

[web2py] more on @auth.requires

2017-04-24 Thread Andrea Fae'
As Anthony suggested me (and thank you for his help), I use for example these function to control authorization @auth.requires(lambda: verifica_manager_site(list_of_roles_manager_site)) At the starting of default.py, where I have the other function that needs authotiation, I putted code to

[web2py] IMPORTANT - WEB2PY CONSULTING

2017-04-24 Thread David Shavers
Hi, I have a dating website that uses a lot of web2py features. I know android and web2py and can help bring people up to speed if they need. www.jbtus.com Contact - www.facebook.com/shaversapps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] GET queries other than ID

2017-04-24 Thread David Shavers
Bump -- 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

Re: [web2py] conditional block insert

2017-04-24 Thread Áureo Dias Neto
is all python code, you can use one '{{' at the begin of code and '}}' at end {{block left_sidebar if auth.has_membership('manager'): include 'manager_sidebar.html' else: include 'sidebar.html' pass end}} -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

Re: [web2py] conditional block insert

2017-04-24 Thread Richard Vézina
Hello Pierre, Simplify your code... Remove the if and try one side bar at a time first... You may find that they are not properly constructed... I mean, the code above seems fine... So I suspect that it is the way you construct your side bar that are causing your issue. There is maybe another

[web2py] Re: Could I use SQLFORM.factory to update 2 tables in a single form

2017-04-24 Thread Rudy
Hi Massimo, I tried below, it could populate database values into the UPDATE FORM and updated the 2 tables correctly, not sure if it's the best way to do it. Any comment is appreciated, thanks again! item_id = request.args(0) item_row = db.item(item_id) quote_row =

[web2py] conditional block insert

2017-04-24 Thread Pierre
hello everyone, {{block left_sidebar}} {{if auth.has_membership('manager'):}} {{include 'manager_sidebar.html'}} {{else:}} {{include 'sidebar.html'}} {{pass}} {{end}} for some reason this doesn't work. It inserts a mixture of the two sidebars. If i move blocks inside of the if same

[web2py] SQLFfor,.grid export query

2017-04-24 Thread Yebach
Hello I would like to use a different query to export data from table when using SQLform.grid, compared to the one i use to represent data in the grid. Also I would like to export more columns than I show in the grid. I tried with this instructions but I am getting different types of errors.

Re: [web2py] Re: GAE Datastore performance / potential index issue

2017-04-24 Thread Áureo Dias Neto
Hello, i have the same problem with sqlite/mysql.. when i fetch some 1000 row, with one column only, its takes about 15/20 seconds to load a page.. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: GAE Datastore performance / potential index issue

2017-04-24 Thread Karoly Kantor
More info again, still hoping someone can help: I tried to replace the DAL query with native app engine code. Original DAL: query=( (mydb[record].application == application_id) & (mydb[record].entity == entity_id) &

Re: {Disarmed} Re: {Disarmed} Re: [web2py] Re: lack of documentation

2017-04-24 Thread António Ramos
After a while you will go back to the book and say, aha here it is... and then you realize that the "ONES" that made the book did a great job... That is my story :) Sem vírus. www.avast.com

Re: {Disarmed} Re: {Disarmed} Re: [web2py] Re: lack of documentation

2017-04-24 Thread Andrea Fae'
Yes you are right, but there is something in the book, something in the codeno complete full documentation...managed in only one site. It's like it is...I have to accept this. thanks Il giorno martedì 11 aprile 2017 15:07:00 UTC+2, Anthony ha scritto: > > On Tuesday, April 11, 2017 at

[web2py] Re: force redirect after expiration login session expiration time

2017-04-24 Thread A3
Thanks, I thought there was a standard solution. I tried this: add this scrip to layout: var time = new Date().getTime(); $(document.body).bind("mousemove keypress", function(e) { time = new Date().getTime(); }); function refresh() { if(new

[web2py] SQLFORM.grid without advanced search

2017-04-24 Thread Gael Princivalle
Hello. Is it possible to customize a SQLFORM.grid for having only the global search field? In other words by default when the user click in the global search field another area is displayed that give the possibility to the user to choose in which field he would like to search. I would like to

[web2py] Re: GAE Datastore performance / potential index issue

2017-04-24 Thread Karoly Kantor
Sorry for commenting on my own issue, but i have more information: The following query takes 20 seconds for only 800 items: query=( (mydb[record].application == application_id) & (mydb[record].entity == entity_id) &