[web2py] Re: db.company.insert() error

2017-09-01 Thread Ben Lawrence
Good point, but I put the commits after the function returns as there are a number of inserts in a variety of tables. So is it preferred to do a commit after every insert instead of grouping them together for one big commit? TIA Ben On Friday, September 1, 2017 at 12:35:01 AM UTC-7, Val K

[web2py] Re: db.company.insert() error

2017-09-01 Thread Ben Lawrence
Also, if i am inserting within a for loop, should I place the db.commit() within the for loop too? On Friday, September 1, 2017 at 9:59:11 AM UTC-7, Ben Lawrence wrote: > > Good point, but I put the commits after the function returns as there are > a number of inserts in a variety of tables. So

[web2py] how to pass table name to controller?

2017-09-01 Thread Alex Glaros
this works db.Role.object_super_object_FK.requires = IS_IN_DB(db (db.cost_center.id), 'cost_center.super_object_fk', '%(cost_center_title)s', zero = T('choose one')) but when I try to pass the table name as a var, it doesn't understand the var specificTableToSearchMembersFromID =

[web2py] Re: how to pass table name to controller?

2017-09-01 Thread 黄祥
had you tried ? e.g. specificTableToSearchMembersFromID = db.cost_center.id 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 (Report Issues) --- You

[web2py] Re: db.company.insert() error

2017-09-01 Thread Val K
I believe, that between inserts/updates and selects you should do commit On Friday, September 1, 2017 at 10:15:00 PM UTC+3, Dave S wrote: > > > > On Friday, September 1, 2017 at 10:03:48 AM UTC-7, Ben Lawrence wrote: >> >> Also, if i am inserting within a for loop, should I place the db.commit()

[web2py] Re: Two database join query

2017-09-01 Thread Pbop
In SQL Server, you can run queries across database tables following the syntax you mention if you have permissions to access both databases and they are on the same server. I presume the same is true on other (not all) database engines. If you have the SQL, then use the executesql feature and

[web2py] Re: how to pass table name to controller?

2017-09-01 Thread Alex Glaros
sorry, should have mentioned that I tried that and every combination possible -- 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

[web2py] Re: mercurial

2017-09-01 Thread Martin Weissenboeck
Ok, thanks. Am 02.09.2017 06:22 schrieb "Massimo DiPierro" : > also we can assume git is already installed so it is a matter of calling > subprocess. I would take a patch to simplify the code. :-) > > On Sep 1, 2017, at 11:21 PM, Martin Weissenboeck

[web2py] Re: Best practice regarding applications

2017-09-01 Thread Massimo Di Pierro
It is fine to have one web2py and as many domains as you need. It should not affect performance provided you take advantage of the cores you have. That means you want to make sure you use nginx+uwsgi or gevent or gunicorn and have about one process per core. On Friday, 1 September 2017

[web2py] Re: mercurial

2017-09-01 Thread Massimo Di Pierro
There is an advantage in having some minimal version control functionality available through the web admin. We just have the wrong functionality. What we need is commit, push, and pull only. In that an admin can upgrade an app by pressing a button in admin, without having to login. On

[web2py] Upload to auth_user

2017-09-01 Thread Tiago Barrionuevo
Hi, I'm trying to upload images to auth_user without success. I already did it with other database tables with no problem. My code: model: auth.settings.extra_fields['auth_user'] = [ Field('picture', 'upload', autodelete=True, label=T('Picture')), ] I'm using the appadmin interface

[web2py] web2py 2.15.4 is OUT

2017-09-01 Thread Massimo Di Pierro
Includes a few bug-fixes (thanks to Anthony and Leonel in particular) and it is tracking the latest python (thanks Giovanni). Please report any outstanding problem so we can continue make web2py better. Massimo -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: mercurial

2017-09-01 Thread Massimo DiPierro
also we can assume git is already installed so it is a matter of calling subprocess. I would take a patch to simplify the code. :-) > On Sep 1, 2017, at 11:21 PM, Martin Weissenboeck wrote: > > I agree! > > Am 02.09.2017 06:18 schrieb "Massimo Di Pierro"

[web2py] Re: mercurial

2017-09-01 Thread Martin Weissenboeck
I agree! Am 02.09.2017 06:18 schrieb "Massimo Di Pierro" : There is an advantage in having some minimal version control functionality available through the web admin. We just have the wrong functionality. What we need is commit, push, and pull only. In that an admin

[web2py] Re: how to pass table name to controller?

2017-09-01 Thread 黄祥
is db.Role.object_super_object_FK.requires = IS_IN_DB(db (db.cost_center.id), 'cost_center.super_object_fk', '%(cost_center_title)s', zero = T('choose one')) really work ? *from the book :* IS_IN_DB(db|set,'table.value_field','%(representing_field)s',zero='choose one') where the third and

[web2py] Re: how to pass table name to controller?

2017-09-01 Thread Alex Glaros
well, I got a variable to work at least: specificTableToSearchMembersFromID = 'cost_center.id>0' db.Role.object_super_object_FK.requires = IS_IN_DB(db(specificTableToSearchMembersFromID), 'cost_center.super_object_fk', '%(cost_center_title)s', zero = T('choose one')) -- Resources: -

[web2py] Re: Rocket logs and server crash

2017-09-01 Thread Dave S
On Thursday, August 31, 2017 at 3:05:56 PM UTC-7, Massimo Di Pierro wrote: > > Can you tell us more about your setup? > > AWS Linux, Python=2.7.12, web2py-shake-the-box: webp2y (2.14.6) + Rocket + Sqlite. Since this is still evolving into production, and usually doesn't involve a lot of

[web2py] Re: db.company.insert() error

2017-09-01 Thread Dave S
On Friday, September 1, 2017 at 10:03:48 AM UTC-7, Ben Lawrence wrote: > > Also, if i am inserting within a for loop, should I place the db.commit() > within the for loop too? > > On Friday, September 1, 2017 at 9:59:11 AM UTC-7, Ben Lawrence wrote: >> >> Good point, but I put the commits after

[web2py] Re: db.company.insert() error

2017-09-01 Thread Val K
from the book: Remember to call db.commit() at the end of every task if it involves inserts/updates to the database. web2py commits by default at the end of a successful action but the scheduler tasks are not actions. On Friday, September 1, 2017 at 8:30:00 AM UTC+3, Ben Lawrence wrote: > >

[web2py] Re: AttributeError: 'SQLite' object has no attribute 'file_open'

2017-09-01 Thread Jitun John
You are totally correct my friend. I updated gluon\packages\dal\pydal with latest pyDal to resolve the issue. On Friday, September 1, 2017 at 3:37:53 AM UTC+5:30, Massimo Di Pierro wrote: > > you have the latest web2py but you have an older pydal. > > On Tuesday, 29 August 2017 03:47:39 UTC-5,

[web2py] Best practice regarding applications

2017-09-01 Thread Najtsirk
Hello, after a long years of active use of web2py it came to me that probably I am not doing it as it should! :) So within one web2py i have several applications and each one is acctualy a separate site ona a different domain. Is this best pracitce or should i have one web2py instance for