[web2py] Re: web2py 2.15.2 is OUT

2017-07-21 Thread tim . nyborg
Creating a SQLFORM.factory() from multiple tables, or a combination of tables and fields, now breaks, because the underlying logic assumes the tables are fields: form = SQLFORM.factory(idb.catering, idb.catering_diet) File "/home/www-data/internal-apps/gluon/sqlhtml.py", line 1922, in factory

[web2py] Re: web2py 2.15.2 is OUT

2017-07-21 Thread tim . nyborg
Actually, this should be simple enough that I can post a fix. On Friday, 21 July 2017 09:35:34 UTC+1, tim.n...@conted.ox.ac.uk wrote: > > Creating a SQLFORM.factory() from tables, or a combination of tables and > fields, now breaks, because the underlying logic assumes the tables are > fields: >

[web2py] Re: python Help with classes

2017-07-21 Thread António Ramos
any help ? 2017-07-20 22:45 GMT+01:00 António Ramos : > hello i tested this simple code outside web2py > > class a(): > def a1(self): > temp=getattr(eval("b")(), "b1")('testing result') > return temp > > class b(): > def b1(self,param): >* s=somevar2.somesubvar1* >

Re: [web2py] Re: Help - Grid with left joins and sending arguments/variables to other functions

2017-07-21 Thread 'Matthew J Watts' via web2py-users
Hi, do you know if this is the same when i use primary keys of legacy tables - doesn't seem to be working when i change my tables to primary key. thanks On Wed, Jul 19, 2017 at 4:10 PM, Jim S wrote: > We were all there once. Glad I was able to help. Part of the beauty of > web2py is the commun

[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread Leonel Câmara
Yes I'm pretty sure it's a RAM issue, 48 free MB is way too low. You easily start having to use virtual memory with a couple of requests. To give you an idea, on a similar setup but a much better machine, I have a much much more complex page than yours appears to be, with quite a lot of aj

[web2py] python Help with classes

2017-07-21 Thread Anthony
Do you have the following in your module: from gluon import current Anthony -- 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 be

Re: [web2py] python Help with classes

2017-07-21 Thread António Ramos
yes i have from gluon import current in my wf_validates.py 2017-07-21 13:39 GMT+01:00 Anthony : > Do you have the following in your module: > > from gluon import current > > Anthony > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py

Re: [web2py] python Help with classes

2017-07-21 Thread António Ramos
this is my real code in wf_validates.py from gluon import current class Validate(object): def status(self,table,field,row,db): wf=db.workflows(id=row[table]["workflow"])["workflow"] if wf in ["Ficheiros","Load","Pessoa"]: cb=getattr(eval("Ficheiros")(), "status"+"_"+"Draft")('xx','db') return cb

[web2py] what's the best way to use scheduler for a daily task?

2017-07-21 Thread Rudy
I want to clean up a table daily using schedule at midnight, I don't want scheduler to poll too often to waste unnecessary resource. how should I do it? 1) give heartbeat a large number in scheduler = Scheduler(db_sch, heartbeat=7200)? 2) scheduler.queue_task(clear_curr_exch_cache, period=86400,

Re: [web2py] python Help with classes

2017-07-21 Thread Anthony
What is the traceback? -- 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-

Re: [web2py] python Help with classes

2017-07-21 Thread António Ramos
There is no traceback. the record is returned like this if i remove session=current.session , 'titleenter': 'Review', 'title': 'Draft', 'titleaction': 'Draft', 'entities_extra': , 'entities': , 'rgb': '#00c0ef', 'rules': , 'details': 'Person', 'id': 8L,* 'isavailable': True*, 'icon': 'fa-user', '

Re: [web2py] Re: Help - Grid with left joins and sending arguments/variables to other functions

2017-07-21 Thread Jim Steil
I'm assuming you're talking about a primary key made up of multiple fields. Is that correct. I've never done that, but I don't see how it would change anything other than the 'left' setup. -Jim On Fri, Jul 21, 2017 at 5:54 AM, 'Matthew J Watts' via web2py-users < web2py@googlegroups.com> wrote:

Re: [web2py] python Help with classes

2017-07-21 Thread Jim S
there is no *"isavailable"* Yes there is. Did you paste the wrong result? 'isavailable' is True in the second result set too. -Jim On Friday, July 21, 2017 at 9:46:26 AM UTC-5, Ramos wrote: > > There is no traceback. the record is returned like this if i remove > session=current.session

[web2py] Re: web2py deployment strategies

2017-07-21 Thread Jim S
Only if you're using conditional models. -Jim On Thursday, July 20, 2017 at 6:00:45 PM UTC-5, Alex Glaros wrote: > > any performance advantage to moving controller files out of default.py > into their own file? > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - htt

Re: [web2py] Re: Auth.signature not updating update_on

2017-07-21 Thread António Ramos
For this simple test db.define_table('tab1', Field('name'), auth.signature ) i got to admin and create a record Initially the record is saved with modified_on as 2017-07-21 16:21:36 then via admin i edit the record and change name field and save. The modified_on is still with 2017-07-21 16:21:3

[web2py] passing additional variables in selectable function of sqlform.grid

2017-07-21 Thread Amit Kumar Modak
Hello, I have created a form with sqlform.grid and added an additional sqlform.factory to the same form. The sqlform.grid has a selectable function where I want to pass the value of sqlform.factory fields. Please suggest how this can be done. Regards, Amit -- Resources: - http://web2py.com -

[web2py] Is it possible to set Cache-Control: no-cache using @cache.action decorator?

2017-07-21 Thread Lisandro
Maybe my question is wrong because of some background that I'm not seeing. Due to the structure of my app, I use @cache.action like this in all my controller functions: @cache.action(cache_model=CACHE.model, time_expire=CACHE.time_expire, session=CACHE.session, vars=CACHE.vars, public=CACHE.publ

Re: [web2py] Re: Help - Grid with left joins and sending arguments/variables to other functions

2017-07-21 Thread 'Matthew J Watts' via web2py-users
Ok thanks for your help Jim, i was getting confused - i introudced a bug into my app but all working fine now i moved all the code to a fresh app On Fri, Jul 21, 2017 at 3:51 PM, Jim Steil wrote: > I'm assuming you're talking about a primary key made up of multiple > fields. Is that correct. >

Re: [web2py] Re: Help - Grid with left joins and sending arguments/variables to other functions

2017-07-21 Thread Jim Steil
I've certainly done that in the past as well. Have a great weekend! -Jim On Fri, Jul 21, 2017 at 1:32 PM, 'Matthew J Watts' via web2py-users < web2py@googlegroups.com> wrote: > Ok thanks for your help Jim, i was getting confused - i introudced a bug > into my app but all working fine now i move

[web2py] Re: what's the best way to use scheduler for a daily task?

2017-07-21 Thread Dave S
On Friday, July 21, 2017 at 6:27:50 AM UTC-7, Rudy wrote: > > I want to clean up a table daily using schedule at midnight, I don't want > scheduler to poll too often to waste unnecessary resource. how should I do > it? > I'm pretty sure Niphlod will say (and has said), "Why bother?" -- the sche

[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread Bernardo Leon
It seems that you are right, I set up a virtual machine with 4gb ram only for the database and I ran the code along with redis on my laptop with 16gb ram and my times now are nearly the 600ms. I think it is good enough. Having some components that don't perform selects rendering only a simple h

[web2py] Re: what's the best way to use scheduler for a daily task?

2017-07-21 Thread Dave S
On Friday, July 21, 2017 at 12:29:47 PM UTC-7, Dave S wrote: > > On Friday, July 21, 2017 at 6:27:50 AM UTC-7, Rudy wrote: > >> >> Another question: how to i associate tasks to a specific group? I seem to >> miss this in the doc >> >> > I'd take a look at the scheduler tests -- Niphlod's default

[web2py] Re: Is a good practice add .table files to source control?

2017-07-21 Thread Bernardo Leon
You are right, maybe a development server and a production server could have different .table files but share the same model file. There is no problem for us to keep one of our versions with fake_migrate=True. Can we switch who is using migrate=True? What happens if both of us use migrate=True

[web2py] Re: ValueError: Field is already bound to a table <-- need a fix for this

2017-07-21 Thread Joe Barnhart
Yes. I just tested with 2.15.2 and all works perfectly as expected. -- Joe On Thursday, July 20, 2017 at 2:58:08 PM UTC-7, Massimo Di Pierro wrote: > > Can you confirm all is good now with 2.15.2? > Thanks to you and Leonel for looking into this so quickly. > > On Sunday, 16 July 2017 21:34:40

Re: [web2py] Re: Auth.signature not updating update_on

2017-07-21 Thread Anthony
In appadmin, I think all fields are made writable, which means the modified_on field should appear in the form - is that what you see? If so, the old value will simply be submitted with the form, so the value will not be updated (unless you manually change it). The automatic update will only ha

Re: [web2py] Re: Auth.signature not updating update_on

2017-07-21 Thread António Ramos
Great and simple. Thank you Anthony 2017-07-21 22:19 GMT+01:00 Anthony : > In appadmin, I think all fields are made writable, which means the > modified_on field should appear in the form - is that what you see? If so, > the old value will simply be submitted with the form, so the value will not

[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread Leonel Câmara
I'm using a 32GB quad core server, which is way **way** more than I need at the moment, but soyoustart is ridiculously cheap and I have this stupid idea that before scaling horizontally you scale vertically as much as possible. -- Resources: - http://web2py.com - http://web2py.com/book (Docu

[web2py] Re: web2py deployment strategies

2017-07-21 Thread pbreit
There are lots of easy ways to optimize for scaling up. Spend your energy on end user functionality until you run into issues. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread 黄祥
@leonel, might i know what do you mean with scaling horizontally and scaling vertically? thanks and best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Rep

[web2py] Re: Page with four LOAD components is too slow

2017-07-21 Thread Leonel Câmara
What I mean is that nowadays it's not that expensive to have a 256GB server with 20 cores. So instead of having a load balancer, a lot of machines running web and application servers, a lot of other machines running databases, etc. You can start with a small server and keep improving it for qui

[web2py] Web2py Docker

2017-07-21 Thread briannd81
I've searched through the discussion archive before posting this question. There were few threads here and there but nothing definitive. Please share your experience with using the web2py docker image. Can you recommend a docker image(s) that you've been using in production? Thanks, CD -- Res