Re: [web2py] _href to URL()

2018-04-20 Thread 黄祥
it seems, the db/menu.py and views/layout.html must be match each other when modified it (list length and list index). never thought that the scaffolding menu can be modified too. *e.g.* *models/menu.py* response.menu += [ (T('Home'), False, URL('default', 'index')*, T('Title'), 'a',* []),

[web2py] Re: web2py 2.16.1 is OUT

2018-04-20 Thread lyn2py
I just git cloned the latest web2py and started it up with *python3* Version 2.16.1-stable+timestamp.2018.03.08.10.23.01 Database drivers available: sqlite3, imaplib, pymysql, pyodbc I got this error in console ERROR:root:New installation error: unable to create welcome.w2p file When I quit the p

[web2py] Re: 'Column table.id not found (SQLTABLE)'

2018-04-20 Thread Brian M
Thank you for mentioning this - just wasted an hour plus trying to figure out why my code had stopped working only to find that it was because I'd done pip install pydal for something else and foolishly not used a venv. Uninstalled pydal and everything was good again. So warning to others, avoi

[web2py] Re: Problem: Sum total price and total quantity of a product

2018-04-20 Thread pbreit
Something like this? http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#sum--avg--min--max-and-len sum = db(db.product.type=='large').select(sum).first()[sum] count = db(db.product.type=='large').count() On Friday, April 20, 2018 at 12:35:22 PM UTC-7, Ayron Rangel

[web2py] Re: Problem: Sum total price and total quantity of a product

2018-04-20 Thread Alby Cartner
I have just worked through it myself. My solution is below - I did a small test app to sort it. I am sure there are more elegant ways to solve it but this worked for me. *Model* db.define_table('additup', Field('number1','integer', default = 0), Field('number2','int

[web2py] Re: Pass a query from form to another function

2018-04-20 Thread Yoel Benitez Fonseca
Umm... sorry took long to answer, i have put on issue on PyDAL repo and a pull request with a posible fix: https://github.com/web2py/pydal/pull/531 El martes, 10 de abril de 2018, 22:20:04 (UTC-4), Anthony escribió: > > On Tuesday, April 10, 2018 at 6:14:06 PM UTC-4, Yoel Benitez Fonseca wrote:

[web2py] Re: Login not working on smartphone - no the same menu layout

2018-04-20 Thread Dave S
On Friday, April 20, 2018 at 11:15:52 AM UTC-7, Andrea Fae' wrote: > > Please help me... > > I'm not going to be much help, but I can confirm that the "hamburger" doesn't appear to have any life, where as the "<" and ">" buttons in the regular part of the page do change the date displayed. Thi

[web2py] Problem: Sum total price and total quantity of a product

2018-04-20 Thread Ayron Rangel
I am developing an Inventory Control and am having difficulty calculating the sum of the values ​​of a given product type and calculating the quantity of products with the same model -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (S

Re: [web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Anthony
On Friday, April 20, 2018 at 3:06:59 PM UTC-4, Richard wrote: > > It maybe just me, but I kind of think that if my models says decimal(10, > 2) it means that I don't want to store more than 2 places... Since my > models should behave like the database table and column as they are just an > abstr

Re: [web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Anthony
On Friday, April 20, 2018 at 3:00:16 PM UTC-4, Richard wrote: > > There seems to have some thing related to gae : > https://github.com/web2py/pydal/blob/a7b7e4c11604d0b8b2de46e832469b78bfd7a1cf/pydal/helpers/gae.py#L16 > That's just the means of storing and retrieving decimal data in the GAE dat

[web2py] Re: self-reference parter autoupdate

2018-04-20 Thread Anthony
On Friday, April 20, 2018 at 2:32:45 PM UTC-4, JSalvat wrote: > > Hello, > > Why on update/insert a record with a non-empty partner, the partner does > not get updated as well with the backwards reference? > > db.define_table('person', > Field('name', requires=IS_NOT_EMPTY()), >

Re: [web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Richard Vézina
It maybe just me, but I kind of think that if my models says decimal(10, 2) it means that I don't want to store more than 2 places... Since my models should behave like the database table and column as they are just an abstraction of the later... I know web2py offer alot of granularity control and

Re: [web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Richard Vézina
There seems to have some thing related to gae : https://github.com/web2py/pydal/blob/a7b7e4c11604d0b8b2de46e832469b78bfd7a1cf/pydal/helpers/gae.py#L16 I guess custom validator with quantize decimal parameters would do it. I recall having use that for report porpuses, but was on the impression tha

Re: [web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Anthony
On Friday, April 20, 2018 at 2:36:58 PM UTC-4, Richard wrote: > > It appears that it get silently "cropped/rounded" by the backend field > type configuration... If I have field with 2 places in the backend and 3 > places defined in the models and input 0.647, it will be stored as 0.65. > > Do we

Re: [web2py] web2py, nginx and big files

2018-04-20 Thread Richard Vézina
You seems to have found good information... I don't have much time to investigate that subject and realize it could be quite complexe... And involve security issue : https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ Although, I thought that you might have a read that

Re: [web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Anthony
On Friday, April 20, 2018 at 2:30:22 PM UTC-4, Richard wrote: > > Realize that, though I am sure it use to managed it... > Not going back to at least web2py 2.02, as far as I can tell. > Anyway, I find it curious that even if I have field of type decimal(10, 2) > for instance, if I insert 1.30

Re: [web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Richard Vézina
It appears that it get silently "cropped/rounded" by the backend field type configuration... If I have field with 2 places in the backend and 3 places defined in the models and input 0.647, it will be stored as 0.65. Do we have control over the rounding in web2py or it configure in the database en

[web2py] self-reference parter autoupdate

2018-04-20 Thread JSalvat
Hello, Why on update/insert a record with a non-empty partner, the partner does not get updated as well with the backwards reference? db.define_table('person', Field('name', requires=IS_NOT_EMPTY()), Field('partner', 'reference person', requires=IS_EMPTY_OR(IS_IN

[web2py] Docker Image for CentOS and Alpine

2018-04-20 Thread David Sperling
We have been using Web2py for several years and are now Dockerizing our solution for a cloud deployment. After looking through the existing Docker solutions, we did not find a project that met our requirements: - Based on CentOS (Alpine is supported as well) - Void of HTTPS support - we h

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

2018-04-20 Thread Anthony
On Friday, April 20, 2018 at 11:58:47 AM UTC-4, Lisandro wrote: > > I see what you mean. > But still, if my interpretation is correct, in those cases we should see > the *__lock key stored. > What is weird about my specific issue is that there was no *__lock key. > > Anyway, regardless upgrading

Re: [web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Richard Vézina
Realize that, though I am sure it use to managed it... Anyway, I find it curious that even if I have field of type decimal(10, 2) for instance, if I insert 1.304, and submit the form it ends up with 1.304 in the read form (backend has 3 places). How do we validated the number of places?? Richard

[web2py] Re: Login not working on smartphone - no the same menu layout

2018-04-20 Thread Andrea Fae'
Please help me... Il giorno mercoledì 18 aprile 2018 20:31:38 UTC+2, Andrea Fae' ha scritto: > > this is my application > > https://andfae.pythonanywhere.com/tcf/default/index > > I can't login with android. I don't know. I see in the upper right of the > smartphone 3 lines but when I click nothi

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

2018-04-20 Thread Lisandro
I see what you mean. But still, if my interpretation is correct, in those cases we should see the *__lock key stored. What is weird about my specific issue is that there was no *__lock key. Anyway, regardless upgrading web2py, now I'm wondering if I should set with_lock True or False. Do you ha

Re: [web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Anthony
On Friday, April 20, 2018 at 9:38:47 AM UTC-4, Richard wrote: > > Hello, > > I was under the impression that IS_DECIMAL_IN_RANGE(2.25, 5.25) would > validate and prevent input having more places the number of places of min > and max... > No, it just ensures that the value is greater than or equa

[web2py] Re: Automatically repeat field text in another before record insertion

2018-04-20 Thread Anthony
Sorry, using your exact code, I cannot reproduce the problem. I am able to edit records (including the article_link field) using the grid. Anthony On Friday, April 20, 2018 at 9:03:50 AM UTC-4, dirman wrote: > > db.define_table('articles', > Field('article_date', 'date'), > Field('article_title'

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

2018-04-20 Thread Anthony
On Friday, April 20, 2018 at 10:47:10 AM UTC-4, Lisandro wrote: > > Thank you very much for your time Anthony. > > Yes, I use Redis with_lock=True. > I checked but there is no *__lock key stored in Redis. I double checked > that. > > But, giving you mentioned with_lock, I tried to set with_lock=Fa

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

2018-04-20 Thread Lisandro
Thank you very much for your time Anthony. Yes, I use Redis with_lock=True. I checked but there is no *__lock key stored in Redis. I double checked that. But, giving you mentioned with_lock, I tried to set with_lock=False, and it worked. Then I set with_lock=True again, and it worked too. *App

Re: [web2py] web2py, nginx and big files

2018-04-20 Thread Carlos Cesar Caballero Díaz
El 19/04/18 a las 16:21, Richard Vézina escribió: Ah ok, make sens then. Are you storing the file in database or on file system at web2py level?? In the file system, I think that storing big (or so many) files in the database can overload it. There is surely a way to make the copy only o

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

2018-04-20 Thread Anthony
When you set up the Redis cache, do you set with_lock=True? If so, I wonder if an error here could be causing the key to be locked and never released. I guess you can check for a

[web2py] IS_DECIMAL_IN_RANGE

2018-04-20 Thread Richard
Hello, I was under the impression that IS_DECIMAL_IN_RANGE(2.25, 5.25) would validate and prevent input having more places the number of places of min and max... I am I wrong? Did it use to work like that in the past?? How can we make sure there is only a given number of places in an input? T

[web2py] Re: Automatically repeat field text in another before record insertion

2018-04-20 Thread dirman
db.define_table('articles', Field('article_date', 'date'), Field('article_title'), Field('article_link', compute=lambda r: r.article_title.replace(' ', '-')), Field('image', 'upload'), Field('body', 'text')) def index(): return dict() def articles() article = db(db.

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

2018-04-20 Thread Lisandro
Sorry to bother you again with this, but I think I've found the problem. *The problem is apparently with Redis integration. *It had nothing to do with connections, database, sessions, none of that. Here is what I've found. Remember, the line where my app hangs is this: *session.important_message