[web2py] Re: Dealing with db objects on duplicated app

2018-04-16 Thread Sergio Romero
I used the starter app example of mjbeller I have the same app code on each app to instantiate the DAL but with different appconfig.ini appconfig.ini of app1 uri= sqlite://storage.sqlite migrate= true pool_size = 10 ; ignored for sqlite appconfig.ini of app2 uri=

Re: [web2py] Re: I cant access db data

2018-04-16 Thread Maurice Waka
Sorry, am still experiencing the same issue. This module is one of the many that I import to the controller . i.e. controller: from gluon import current db = current.db from ..path/to/module import my_module some code.. def access_this(): class Filters(object): @staticmethod

[web2py] table name created as a string in db model is not reference-able as a DB object in the controller

2018-04-16 Thread Michael Cowen
In the model file …/Models/db.py I have the following code *# Connect to a local postgres instance* *db = DAL(**"postgres://user@localhost/DBName"**)* *# Create some fields* *_name * *= Field(**'name'**, * *type=**'string'**, * *length=* *'256'** )* *_author* *

Re: [web2py] Re: Customizing Fields the lazy way

2018-04-16 Thread Richard Vézina
Thanks Joe, I will have a better read... I had fix my issue, my customization of the plugin introduce a couple of problem... I ends up refactoring the and only load data when all the controlled field has to be updated "once". It fix 80% of the loading time issue the rest of the issue is user

Re: [web2py] Re: How to redirect http to https?

2018-04-16 Thread António Ramos
i prefer this tip from other post in models... session.secure() if not request.is_https: redirect(URL(scheme='https', args=request.args, vars=request.vars)) 2018-04-16 15:51 GMT+01:00 Anthony : > Another option is to configure your web server to do the redirect. > > > On

[web2py] Re: table name created as a string in db model is not reference-able as a DB object in the controller

2018-04-16 Thread Anthony
> In the controller default.py I have the following code > > > > *# Connect to a local postgres instance* > > *db = DAL(**"postgres://user@localhost/DBName"**)* > You should not re-create the db object in the controller, as it has already been created in the model file. The code in

[web2py] Re: Requires web2py 2.15.5 or newer?

2018-04-16 Thread Anthony
On Sunday, April 15, 2018 at 11:45:02 PM UTC-4, Tarek Doha wrote: > > Hello, > > How to solve this? > > Requires web2py 2.15.5 or newer > Are you using the scaffolding app from web2py 2.15.5 with an earlier version of web2py? If so, you may run into problems, particularly with appadmin and

[web2py] Re: Reverse relationships

2018-04-16 Thread Leonel Câmara
Note that in web2py you can actually do something like this: db.tag(Field('name')) db.debate(Field('title')) db.debate_tag(Field('tag', 'reference tag'), Field('debate', 'reference debate')) Then say you want to know the tags debate with id 1 has db.debate[1].debate_tag.select() --

[web2py] Re: How to redirect http to https?

2018-04-16 Thread Anthony
Another option is to configure your web server to do the redirect. On Monday, April 16, 2018 at 9:32:36 AM UTC-4, Leonel Câmara wrote: > > You can just put this in your model: > > request.requires_https() > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: Customizing Fields the lazy way

2018-04-16 Thread Anthony
Looks good. A few suggestions: - There is no benefit to using a class with a single static method here -- just extract the new() method and make it a standalone function (maybe call it field_factory). - If you rename kwargs in the new() function to something else (e.g., fargs),

[web2py] Re: table name created as a string in db model is not reference-able as a DB object in the controller

2018-04-16 Thread Michael Cowen
Apologies. That's pretty fundamental to how all this works. Thank you ! On Monday, April 16, 2018 at 9:53:08 AM UTC-5, Michael Cowen wrote: > > In the model file …/Models/db.py I have the following code > > > > *# Connect to a local postgres instance* > > *db =

[web2py] How to redirect http to https?

2018-04-16 Thread António Ramos
hello i have a public web2py server on http. Now i have to switch to https but i have a lot of users. What is the best way to have them all loggin via https and not http? regards -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Re: Reverse relationships

2018-04-16 Thread Anthony
On Monday, April 16, 2018 at 11:47:28 AM UTC-4, Leonel Câmara wrote: > > Note that in web2py you can actually do something like this: > > db.define_table('tag', Field('name')) > > db.define_table('debate'. Field('title')) > > db.define_table('debate_tag', Field('tag', 'reference tag'), >

[web2py] Re: Web2py locks row at auth_user and web2py_session_* tables and doesn't unlock them

2018-04-16 Thread Anthony
Where is the database server running? Is it possible there are occasional network problems connecting to it? Anthony On Monday, April 16, 2018 at 3:15:54 PM UTC-4, Lisandro wrote: > > Hi there, sorry to bother again, I have some additional info that could > help. > > The problem happened

[web2py] Re: Web2py locks row at auth_user and web2py_session_* tables and doesn't unlock them

2018-04-16 Thread Lisandro
Hi there, sorry to bother again, I have some additional info that could help. The problem happened again, exactly the same as the other times. But this time an error ticket was created with this traceback: - Traceback (most recent call last): File

Re: [web2py] Re: Web2py locks row at auth_user and web2py_session_* tables and doesn't unlock them

2018-04-16 Thread Richard Vézina
Hello LIsandro, I recall you have ask question about session in redis... Could there are remaining stuff of experiment with redis that haven't been commented out completly?? Richard On Mon, Apr 16, 2018 at 3:15 PM, Lisandro wrote: > Hi there, sorry to bother again,

Re: [web2py] Re: How to redirect http to https?

2018-04-16 Thread Anthony
On Monday, April 16, 2018 at 11:21:57 AM UTC-4, Ramos wrote: > > i prefer this tip from other post > > in models... > session.secure() > if not request.is_https: >redirect(URL(scheme='https', args=request.args, vars=request.vars)) > request.requires_https() is preferable to the above, as it

[web2py] Re: Web2py locks row at auth_user and web2py_session_* tables and doesn't unlock them

2018-04-16 Thread Lisandro
Hi, thank you both for your time and concern. @Richard: this particular website was still running with sessions stored in Redis. As we have several websites, moving sessions to Redis is something that we will do progressively in the next weeks. @Anthony: the database server is PostgreSQL,

[web2py] Re: Problem with a virtual field, SQLFORM.grid and the fields parameter

2018-04-16 Thread icodk
I had a similar issue and using the latest master branch fixed it for me (after the release of 2.16.1) On Saturday, April 14, 2018 at 10:52:10 PM UTC+2, mweissen wrote: > > I have a model with a virtual field: > > db.define_table("tt", > Field("f"), > Field("gg"), >

[web2py] I cant access db data

2018-04-16 Thread Maurice Waka
from this link, i tried accessing values in db as follows: model: db.define_table('abnvalinterprets', Field('abnvalinterpret', length= 100),) Module: from gluon import current, DAL, Fielddef abnvalinterpret():

[web2py] Re: I cant access db data

2018-04-16 Thread Dave S
On Monday, April 16, 2018 at 9:04:35 PM UTC-7, Maurice Waka wrote: > > from this > > link, i tried accessing values in db as follows: > > > model: > > db.define_table('abnvalinterprets', > Field('abnvalinterpret',

Re: [web2py] Re: I cant access db data

2018-04-16 Thread Maurice Waka
I hadn't done that. I'll redo Regards On Tue, Apr 17, 2018 at 7:26 AM, Dave S wrote: > > > On Monday, April 16, 2018 at 9:04:35 PM UTC-7, Maurice Waka wrote: >> >> from this >> >> link, i tried

[web2py] Dealing with db objects on duplicated app

2018-04-16 Thread Sergio Romero
Hi there. I have to deal with a duplicate example app on the same rocket server instance. I have modified the sqlite file with each application interact but both of the applicattions has the same db dal object name. When I start the server each applications shares the users and have some

[web2py] Re: Dealing with db objects on duplicated app

2018-04-16 Thread Anthony
They are not sharing the same db object just by virtue of it having the same name in the code. The code of each app is executed independently within requests for each app. Please show the code you are using to instantiate the DAL object in each app. Anthony On Monday, April 16, 2018 at

[web2py] Re: How to redirect http to https?

2018-04-16 Thread Leonel Câmara
You can just put this in your model: request.requires_https() -- 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

[web2py] Datetime onSelect event

2018-04-16 Thread tomasz bandura
Hello, I need to do some action after selecting value in datetime field. After my investigation it looks the one way is to create my own datetime component with implemented 'onSelect' event. Another option is to use another datetime (jquery) control. I'd like to avoid it but i have no an idea

Re: [web2py] Re: Problem with a virtual field, SQLFORM.grid and the fields parameter

2018-04-16 Thread Martin Weissenboeck
Thank you, I'll try it! icodk schrieb am Mo., 16. Apr. 2018, 09:28: > I had a similar issue and using the latest master branch fixed it for me > (after the release of 2.16.1) > > On Saturday, April 14, 2018 at 10:52:10 PM UTC+2, mweissen wrote: >> >> I have a model with a