[web2py] Re: Web2py + Nginx - Logging

2020-07-02 Thread icodk
 I have a system running  Web2py + Nginx + ubuntu  (installed with provided 
ubuntu script)   and all print statements are logged to the uwsgi log at  
/var/log/uwsgi


On Thursday, July 2, 2020 at 7:19:21 AM UTC+2 snide...@gmail.com wrote:

>
>
> On Wednesday, July 1, 2020 at 2:51:32 PM UTC-7, Luciano Bovio wrote:
>>
>> Is it possible to log web2py output messages  to a file when running 
>> web2py+nginx+uwsgi (installed with provided ubuntu script) ?
>>
>> I need to view the messages that i see in console when running rocket 
>> server.
>>
>> Thanks
>>
>
>
> The built-in logging works pretty good.  Replace your print statements 
> with logger.debug() or logger.error() ...The same formatted string you fed 
> print works for the argument of logger.debug.   Log files are in 
> web2py/logs, and there's an autorotate feature to prevent logs from takng 
> over your server.
>
> http://web2py.com/books/default/chapter/29/04/the-core#Logging>
>
> (I'm running nginx+uwsgi on AWS linux)
>
> /dps
>  
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/80a89819-2336-4757-8134-d8b67e284bd8n%40googlegroups.com.


[web2py] Web2py or py4web for a brand new project

2019-12-12 Thread icodk
Should I use Web2py or py4web for a brand new project ?
What is still missing from py4web  ?
Can I debug with pycharm ?
I need all the great authentication I got with web2py : Registration,pass 
change, groups mail, etc.
smartgreed will be very nice to have or similar.
Stability ?
Can it be deployed with nginx  and pg ?
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b5e74419-11d7-496b-a3e3-dafa75fc6422%40googlegroups.com.


[web2py] smartgrid linked table edit returns to main table listing and not to the linked table listing

2019-09-10 Thread icodk
 smartgrid that shows list of parents from a parents table and a Children  
linked table. Clicking on the Children link on a specific parent line shows 
a list of children's of that parent.
So far so good. 
Click on the edit button on specific child in the list  I can edit this 
child.
Finish editing by submitting the edit form of the child takes me back to 
the parent list and not to the list of children where I was just before I 
started editing specific child.
How can I get back to the list of children of the parent instead of to the 
parents list after editing  a child record?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ee62c36b-4395-47fe-af29-23f901c46eb8%40googlegroups.com.


[web2py] Re: recaptcha language settings How ?

2019-07-11 Thread icodk
Thanks it works
Here is what works:
form.element('table').insert(-1, TR('' ,Recaptcha2(request, 'PUBLIC_KEY', 
'PRIVATE_KEY',options={'hl':'da'}), ''))



On Thursday, July 11, 2019 at 9:37:49 AM UTC+2, Nico de Groot wrote:
>
> Looks like the parameter is ‘hl’ not ‘nl’. I think hl: ‘da’ might work.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/5070dde5-e2fa-43b2-b87e-722174c8acb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-26 Thread icodk
The whole point for me  is to prepare my app to python3 that seems to be 
the default on newer virtual machines on AWS and others.
I am sure it can run with 2.18.5.
If anybody on this forum managed to run web2py 2.18.5, python3 and Rocket 
without errors, please let me know.


On Wednesday, June 26, 2019 at 11:14:32 AM UTC+2, Dave S wrote:
>
>
>
> On Tuesday, June 25, 2019 at 2:35:12 PM UTC-7, icodk wrote:
>>
>> Appreciate your effort to help me, tahnks. I  use  Rocket as development 
>> server, and it served me well with python2 and web2py up to 2.17.1.
>> Production runs with nginx with ssl on aws. I thought  I will try to 
>> upgrade my app to python3 and 2.18.5 and the easyest would be Rocket. I 
>> will try it with http but it is not optimal for me because I have some IoT 
>> devices that
>> use https.
>> Wished somebody could help because it is part of the core functionality 
>> of web2py development (IMHO) and one of the things that make web2py 
>> development so easy to get up and running. 
>>
>>
> Perhaps you should test 2.18.5 with Python2.  It might be the Python3 
> libraries that are the stumbling block. 
>
> /dps
>
>
>  
>
>> On Tuesday, June 25, 2019 at 9:52:33 PM UTC+2, Dave S wrote:
>>>
>>>
>>>
>>> On Tuesday, June 25, 2019 at 10:04:39 AM UTC-7, icodk wrote:
>>>>
>>>> Now I tried both another Windows 10 machine and ubuntu with similar 
>>>> errors
>>>> As you can see bellow I used port 8000 on liniux because using port 443 
>>>> gave the following error:
>>>>
>>>> ERROR:Rocket.Errors.Port443:Socket 0.0.0.0:443 in use by other process 
>>>> and it won't share.
>>>> WARNING:Rocket.Errors.Port443:Listener started when not ready.
>>>>
>>>> However, netstat didn't revile any process using 443 and nc could 
>>>> listen on this port 
>>>> $ sudo nc -l  -p 443
>>>>
>>>>
>>>> and receive connections from another machine (telnet 192.168.1.223 443)
>>>>
>>>>
>>>>
>>> Well, I've used all my rounds.  I have run Rocket on port 443, but that 
>>> was with a 2.15.4 version on AWS Linux.   And when I renewed the 
>>> certificates, I got something messed up, couldn't figure it out, and so I 
>>> finished the move to Nginx.  I don't think Rocket has had many changes, 
>>> although the Python3 effort may have had to touch it some.
>>>
>>> I have not tried 443 on Windows (just 8000, 8080, 8800, ...), and I have 
>>> not tried the Nginx Windows port (I believe it is still marked 
>>> "experimental").
>>>
>>> As a relatively easy choice of alternate technology, you can do a real 
>>> simple Node.js server that echos your request.  Mercurial includes a 
>>> webserver (might not be stand-alone on Windows) and I believe it's in the 
>>> standard release package, just waiting to be turned on.
>>>
>>> Good luck!
>>>
>>> /dps
>>>
>>>
>>>> The error from the server on linux
>>>> $ python3 web2py.py -c cert/ca.crt -k cert/ca.key -a "password" -i 
>>>> 192.168.1.223 -p 8000
>>>> web2py Web Framework
>>>> Created by Massimo Di Pierro, Copyright 2007-2019
>>>> Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
>>>> Database drivers available: sqlite3, imaplib, pymysql
>>>>
>>>> please visit:
>>>> https://192.168.1.223:8000/
>>>> use "kill -SIGTERM 7818" to shutdown the web2py server
>>>>
>>>>
>>>> Exception in thread Thread-2:
>>>> Traceback (most recent call last):
>>>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>>>> self.run()
>>>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>>>> conn = Connection(*conn)
>>>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>>>> self.socket.settimeout(SOCKET_TIMEOUT)
>>>> OSError: [Errno 9] Bad file descriptor
>>>>
>>>> Exception in thread Thread-3:
>>>> Traceback (most recent call last):
>>>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>>>> self.run()
>>>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>>>> conn = Connection(*conn)
>>>>   File "/home/ico/web2py/

[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-25 Thread icodk
Appreciate your effort to help me, tahnks. I  use  Rocket as development 
server, and it served me well with python2 and web2py up to 2.17.1.
Production runs with nginx with ssl on aws. I thought  I will try to 
upgrade my app to python3 and 2.18.5 and the easyest would be Rocket. I 
will try it with http but it is not optimal for me because I have some IoT 
devices that
use https.
Wished somebody could help because it is part of the core functionality of 
web2py development (IMHO) and one of the things that make web2py 
development so easy to get up and running. 

On Tuesday, June 25, 2019 at 9:52:33 PM UTC+2, Dave S wrote:
>
>
>
> On Tuesday, June 25, 2019 at 10:04:39 AM UTC-7, icodk wrote:
>>
>> Now I tried both another Windows 10 machine and ubuntu with similar errors
>> As you can see bellow I used port 8000 on liniux because using port 443 
>> gave the following error:
>>
>> ERROR:Rocket.Errors.Port443:Socket 0.0.0.0:443 in use by other process 
>> and it won't share.
>> WARNING:Rocket.Errors.Port443:Listener started when not ready.
>>
>> However, netstat didn't revile any process using 443 and nc could listen 
>> on this port 
>> $ sudo nc -l  -p 443
>>
>>
>> and receive connections from another machine (telnet 192.168.1.223 443)
>>
>>
>>
> Well, I've used all my rounds.  I have run Rocket on port 443, but that 
> was with a 2.15.4 version on AWS Linux.   And when I renewed the 
> certificates, I got something messed up, couldn't figure it out, and so I 
> finished the move to Nginx.  I don't think Rocket has had many changes, 
> although the Python3 effort may have had to touch it some.
>
> I have not tried 443 on Windows (just 8000, 8080, 8800, ...), and I have 
> not tried the Nginx Windows port (I believe it is still marked 
> "experimental").
>
> As a relatively easy choice of alternate technology, you can do a real 
> simple Node.js server that echos your request.  Mercurial includes a 
> webserver (might not be stand-alone on Windows) and I believe it's in the 
> standard release package, just waiting to be turned on.
>
> Good luck!
>
> /dps
>
>
>> The error from the server on linux
>> $ python3 web2py.py -c cert/ca.crt -k cert/ca.key -a "password" -i 
>> 192.168.1.223 -p 8000
>> web2py Web Framework
>> Created by Massimo Di Pierro, Copyright 2007-2019
>> Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
>> Database drivers available: sqlite3, imaplib, pymysql
>>
>> please visit:
>> https://192.168.1.223:8000/
>> use "kill -SIGTERM 7818" to shutdown the web2py server
>>
>>
>> Exception in thread Thread-2:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> Exception in thread Thread-3:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> Exception in thread Thread-4:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> Exception in thread Thread-5:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [Errno 9] Bad file descriptor
>>
>> Exception in thread Thread-6:
>> Traceback (most recent call last):
>>   File "/usr/lib/python3.7/thre

[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-25 Thread icodk
Now I tried both another Windows 10 machine and ubuntu with similar errors
As you can see bellow I used port 8000 on liniux because using port 443 
gave the following error:

ERROR:Rocket.Errors.Port443:Socket 0.0.0.0:443 in use by other process and 
it won't share.
WARNING:Rocket.Errors.Port443:Listener started when not ready.

However, netstat didn't revile any process using 443 and nc could listen on 
this port 
$ sudo nc -l  -p 443


and receive connections from another machine (telnet 192.168.1.223 443)



The error from the server on linux
$ python3 web2py.py -c cert/ca.crt -k cert/ca.key -a "password" -i 
192.168.1.223 -p 8000
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2019
Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
Database drivers available: sqlite3, imaplib, pymysql

please visit:
https://192.168.1.223:8000/
use "kill -SIGTERM 7818" to shutdown the web2py server


Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-5:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-6:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-7:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-9:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-10:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-11:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*conn)
  File "/home/ico/web2py/gluon/rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [Errno 9] Bad file descriptor

Exception in thread Thread-8:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
  File "/home/ico/web2py/gluon/rocket.py", line 1268, in run
conn = Connection(*co

[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-25 Thread icodk
yes and it is python.exe that own the prort. Also the server serves the 
index.html page but then it hangs


On Tuesday, June 25, 2019 at 5:14:50 AM UTC+2, Dave S wrote:
>
>
>
> On Monday, June 24, 2019 at 2:37:32 PM UTC-7, icodk wrote:
>>
>> yes. I run it in  Administrator Command prompt. 
>> What else could I be missing ?
>> Will try on another Windows 10  machine  and linux.
>>
>>
> Did you check if port 443 was already in use?  Try
> netstat -ab
> (note the dash)
>
> /dps
>  
>
>> On Monday, June 24, 2019 at 10:27:05 PM UTC+2, Dave S wrote:
>>>
>>>
>>>
>>> On Sunday, June 23, 2019 at 4:19:41 AM UTC-7, icodk wrote:
>>>>
>>>> plan web2py 2.18.5 installation on windows from source on Windows 10 
>>>> running the welcome application without errors.
>>>> However trying to run it with SSL gives the following errors:
>>>> Command :
>>>> C:\Python37\python.exe C:\temp\web2py\web2py.py -c C:\temp\web2py\cert\
>>>> ca.crt -k C:\temp\web2py\cert\ca.key -a "password" -i 192.168.1.100 -p 
>>>> 443
>>>>
>>>>
>>> Are you running with elevated privilege (i.e., opening cmd.exe with "Run 
>>> as Administrator") ?
>>>
>>> Port 443  requires privilege on Linux, and it wouldn't be a surprise if 
>>> that was the case on Windows.
>>>
>>>
>>> Errors:
>>>>
>>>> C:\Temp\web2py>C:\Python37\python.exe C:\temp\web2py\web2py.py -c 
>>>> C:\temp\web2py\cert\ca.crt -k C:\temp\web2py\cert\ca.key -a "password" -i 
>>>> 192.168.1.100 -p 443
>>>> web2py Web Framework
>>>> Created by Massimo Di Pierro, Copyright 2007-2019
>>>> Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
>>>> Database drivers available: sqlite3, psycopg2, imaplib, pymysql, pyodbc
>>>>
>>>> please visit:
>>>> https://192.168.1.100:443/
>>>> use "taskkill /f /pid 13408" to shutdown the web2py server
>>>>
>>>>
>>>> Exception in thread Thread-2:
>>>> Traceback (most recent call last):
>>>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>>>> self.run()
>>>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>>>> conn = Connection(*conn)
>>>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>>>> self.socket.settimeout(SOCKET_TIMEOUT)
>>>> OSError: [WinError 10038] An operation was attempted on something that 
>>>> is not a socket
>>>>
>>>> Exception in thread Thread-3:
>>>> Traceback (most recent call last):
>>>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>>>> self.run()
>>>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>>>> conn = Connection(*conn)
>>>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>>>> self.socket.settimeout(SOCKET_TIMEOUT)
>>>> OSError: [WinError 10038] An operation was attempted on something that 
>>>> is not a socket
>>>>
>>>> Exception in thread Thread-5:
>>>> Traceback (most recent call last):
>>>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>>>> self.run()
>>>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>>>> conn = Connection(*conn)
>>>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>>>> self.socket.settimeout(SOCKET_TIMEOUT)
>>>> OSError: [WinError 10038] An operation was attempted on something that 
>>>> is not a socket
>>>>
>>>> Exception in thread Thread-6:
>>>> Traceback (most recent call last):
>>>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>>>> self.run()
>>>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>>>> conn = Connection(*conn)
>>>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>>>> self.socket.settimeout(SOCKET_TIMEOUT)
>>>> OSError: [WinError 10038] An operation was attempted on something that 
>>>> is not a socket
>>>>
>>>> Exception in thread Thread-7:
>>>> Traceback (most recent call last):
>&

[web2py] Re: Errors using web2py 2.18.5 , python3 and ssl

2019-06-24 Thread icodk
yes. I run it in  Administrator Command prompt. 
What else could I be missing ?
Will try on another Windows 10  machine  and linux.

On Monday, June 24, 2019 at 10:27:05 PM UTC+2, Dave S wrote:
>
>
>
> On Sunday, June 23, 2019 at 4:19:41 AM UTC-7, icodk wrote:
>>
>> plan web2py 2.18.5 installation on windows from source on Windows 10 
>> running the welcome application without errors.
>> However trying to run it with SSL gives the following errors:
>> Command :
>> C:\Python37\python.exe C:\temp\web2py\web2py.py -c C:\temp\web2py\cert\ca
>> .crt -k C:\temp\web2py\cert\ca.key -a "password" -i 192.168.1.100 -p 443
>>
>>
> Are you running with elevated privilege (i.e., opening cmd.exe with "Run 
> as Administrator") ?
>
> Port 443  requires privilege on Linux, and it wouldn't be a surprise if 
> that was the case on Windows.
>
>
> Errors:
>>
>> C:\Temp\web2py>C:\Python37\python.exe C:\temp\web2py\web2py.py -c 
>> C:\temp\web2py\cert\ca.crt -k C:\temp\web2py\cert\ca.key -a "password" -i 
>> 192.168.1.100 -p 443
>> web2py Web Framework
>> Created by Massimo Di Pierro, Copyright 2007-2019
>> Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
>> Database drivers available: sqlite3, psycopg2, imaplib, pymysql, pyodbc
>>
>> please visit:
>> https://192.168.1.100:443/
>> use "taskkill /f /pid 13408" to shutdown the web2py server
>>
>>
>> Exception in thread Thread-2:
>> Traceback (most recent call last):
>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [WinError 10038] An operation was attempted on something that is 
>> not a socket
>>
>> Exception in thread Thread-3:
>> Traceback (most recent call last):
>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [WinError 10038] An operation was attempted on something that is 
>> not a socket
>>
>> Exception in thread Thread-5:
>> Traceback (most recent call last):
>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [WinError 10038] An operation was attempted on something that is 
>> not a socket
>>
>> Exception in thread Thread-6:
>> Traceback (most recent call last):
>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [WinError 10038] An operation was attempted on something that is 
>> not a socket
>>
>> Exception in thread Thread-7:
>> Traceback (most recent call last):
>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [WinError 10038] An operation was attempted on something that is 
>> not a socket
>>
>> Exception in thread Thread-8:
>> Traceback (most recent call last):
>>   File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
>> self.run()
>>   File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
>> conn = Connection(*conn)
>>   File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
>> self.socket.settimeout(SOCKET_TIMEOUT)
>> OSError: [WinError 10038] An operation was attempted on something that is 
>> not a socket
>>
>> Exception in thread Thread-9:
>> Traceback

Re: [web2py] Re: Web2py binaries

2019-06-23 Thread icodk
The reason I ask is because I got errors running from source with ssl

On Sunday, June 23, 2019 at 11:32:26 AM UTC+2, Nico Zanferrari wrote:
>
> Hi all,
>
> I've just released a new set of the 2.18.5 Web2py frozen binaries, for 
> Windows and MacOs, with Python 2.7.16 and 3.7.3; grab them from my 
> repository  .
>
> The only update is that now the interactive shell is working fine ;-) This 
> was obtained by hacking the fake site.py module provided by PyInstaller 
> with the missing functions from the official cPython. The Mac APP which is 
> still not working at all (probably for Tcl/Tk wrong inclusion, see this 
> bug ), but the 
> Mac CMD program is working fine.
>
> Please, help with testing and report any difference with running from 
> sources.
>
> Cheers,
> Nico
>
> Il giorno gio 13 giu 2019 alle ore 19:33 Dave S  > ha scritto:
>
>>
>>
>> On Thursday, June 13, 2019 at 1:41:53 AM UTC-7, Dave S wrote:
>>>
>>>
>>>
>>> On Friday, April 19, 2019 at 1:16:29 AM UTC-7, Nico Zanferrari wrote:

 Thanks for testing, Dave, I'm happy to hear that it's working fine!

 I think that the Welcome app with latest web2py versions don't look so 
 fine in Windows and python 3, but I cannot see any difference from running 
 it from sources. Let me know if I'm wrong or there are anything else.

 Nico


>>> Still haven't tried running it from sources, but I finally brought over 
>>> another app (just one print to turn to print(), and it looked just fine 
>>> with my old static directory, but I decided I needed try the new static, 
>>> which I copied from the welcome app.  The banner again looked horrible, so 
>>> I did an inspect and clicked here and there and after a brief cloud of 
>>> dust  actually got the black band to show up.
>>>
>>> Looking more into the inspect window, there's a reference to 
>>> shockwave-flash, and I think Chrome doesn't like that (deprecated flash 
>>> years ago).  I don't think this is your problem, but I'm not sure why it's 
>>> in there.  I'm not going to hunt anything more down tonight, either.
>>>
>>> Here's a clue:  clicking on the web2py logo, which is an anchor to the 
>> web2py site, takes me to ... the web2py site, with the black band on top 
>> (for the navbar).  When I click back, my page displays the black band on 
>> top.  Does this indicate a missing resource?
>>
>> /dps
>>
>> -- 
>> 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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/3ac332e6-3c4b-4ed4-83ff-196f9947894a%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e9fe90e2-8b61-4b5d-8a67-63df808daa4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: Web2py binaries

2019-06-23 Thread icodk
Does it run with SSL (  -c ca.crt -k ca.key -p 443 ) ?


On Sunday, June 23, 2019 at 11:32:26 AM UTC+2, Nico Zanferrari wrote:
>
> Hi all,
>
> I've just released a new set of the 2.18.5 Web2py frozen binaries, for 
> Windows and MacOs, with Python 2.7.16 and 3.7.3; grab them from my 
> repository  .
>
> The only update is that now the interactive shell is working fine ;-) This 
> was obtained by hacking the fake site.py module provided by PyInstaller 
> with the missing functions from the official cPython. The Mac APP which is 
> still not working at all (probably for Tcl/Tk wrong inclusion, see this 
> bug ), but the 
> Mac CMD program is working fine.
>
> Please, help with testing and report any difference with running from 
> sources.
>
> Cheers,
> Nico
>
> Il giorno gio 13 giu 2019 alle ore 19:33 Dave S  > ha scritto:
>
>>
>>
>> On Thursday, June 13, 2019 at 1:41:53 AM UTC-7, Dave S wrote:
>>>
>>>
>>>
>>> On Friday, April 19, 2019 at 1:16:29 AM UTC-7, Nico Zanferrari wrote:

 Thanks for testing, Dave, I'm happy to hear that it's working fine!

 I think that the Welcome app with latest web2py versions don't look so 
 fine in Windows and python 3, but I cannot see any difference from running 
 it from sources. Let me know if I'm wrong or there are anything else.

 Nico


>>> Still haven't tried running it from sources, but I finally brought over 
>>> another app (just one print to turn to print(), and it looked just fine 
>>> with my old static directory, but I decided I needed try the new static, 
>>> which I copied from the welcome app.  The banner again looked horrible, so 
>>> I did an inspect and clicked here and there and after a brief cloud of 
>>> dust  actually got the black band to show up.
>>>
>>> Looking more into the inspect window, there's a reference to 
>>> shockwave-flash, and I think Chrome doesn't like that (deprecated flash 
>>> years ago).  I don't think this is your problem, but I'm not sure why it's 
>>> in there.  I'm not going to hunt anything more down tonight, either.
>>>
>>> Here's a clue:  clicking on the web2py logo, which is an anchor to the 
>> web2py site, takes me to ... the web2py site, with the black band on top 
>> (for the navbar).  When I click back, my page displays the black band on 
>> top.  Does this indicate a missing resource?
>>
>> /dps
>>
>> -- 
>> 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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/3ac332e6-3c4b-4ed4-83ff-196f9947894a%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/26244e75-ea40-44ed-8de7-6f6fae8c7e34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Errors using web2py 2.18.5 , python3 and ssl

2019-06-23 Thread icodk
plan web2py 2.18.5 installation on windows from source on Windows 10 
running the welcome application without errors.
However trying to run it with SSL gives the following errors:
Command :
C:\Python37\python.exe C:\temp\web2py\web2py.py -c C:\temp\web2py\cert\ca.crt 
-k C:\temp\web2py\cert\ca.key -a "password" -i 192.168.1.100 -p 443

Errors:

C:\Temp\web2py>C:\Python37\python.exe C:\temp\web2py\web2py.py -c 
C:\temp\web2py\cert\ca.crt -k C:\temp\web2py\cert\ca.key -a "password" -i 
192.168.1.100 -p 443
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2019
Version 2.18.5-stable+timestamp.2019.04.07.21.13.59
Database drivers available: sqlite3, psycopg2, imaplib, pymysql, pyodbc

please visit:
https://192.168.1.100:443/
use "taskkill /f /pid 13408" to shutdown the web2py server


Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
  File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
conn = Connection(*conn)
  File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [WinError 10038] An operation was attempted on something that is 
not a socket

Exception in thread Thread-3:
Traceback (most recent call last):
  File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
  File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
conn = Connection(*conn)
  File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [WinError 10038] An operation was attempted on something that is 
not a socket

Exception in thread Thread-5:
Traceback (most recent call last):
  File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
  File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
conn = Connection(*conn)
  File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [WinError 10038] An operation was attempted on something that is 
not a socket

Exception in thread Thread-6:
Traceback (most recent call last):
  File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
  File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
conn = Connection(*conn)
  File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [WinError 10038] An operation was attempted on something that is 
not a socket

Exception in thread Thread-7:
Traceback (most recent call last):
  File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
  File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
conn = Connection(*conn)
  File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [WinError 10038] An operation was attempted on something that is 
not a socket

Exception in thread Thread-8:
Traceback (most recent call last):
  File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
  File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
conn = Connection(*conn)
  File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [WinError 10038] An operation was attempted on something that is 
not a socket

Exception in thread Thread-9:
Traceback (most recent call last):
  File "C:\Python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
  File "C:\temp\web2py\gluon\rocket.py", line 1268, in run
conn = Connection(*conn)
  File "C:\temp\web2py\gluon\rocket.py", line 105, in __init__
self.socket.settimeout(SOCKET_TIMEOUT)
OSError: [WinError 10038] An operation was attempted on something that is 
not a socket

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e66d8c64-0115-44a4-8ee1-6289496c9538%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] recaptcha language settings How ?

2019-06-09 Thread icodk
How to set  reCaptcha2 language ?
I tried with the options parameter but got an error that the nl parameter 
is not recognized
form.element('table').insert(-1, TR('' ,Recaptcha2(request, 'PUBLIC_KEY', 
'PRIVATE_KEY',options={nl:'da'})))

Looking into the reCaptcha2 class definition  I can see referance to nl but 
can't figure out how to implement it so it works

google reference :
https://developers.google.com/recaptcha/docs/display#config

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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fda7f21d-2249-4dfd-8f93-a62b3c0f9f45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] ignore_common filters not applied to left join table

2019-06-03 Thread icodk
Not sure if it is a bug, feature or inconsistancy but ignore_common filters 
not applied to left join table in query with left join.
I would expect that ignore is for all.
Not a big issue because you can set the commonfilter on the respected 
tables to None just before query execution.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/612be6ea-f83b-4e18-89b4-2678a70c889c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.smartgrid selectable return string or list

2019-04-21 Thread icodk
You both are righ:
What's work now (also should worke before):
selectable=[('change price 100', lambda ids: modify_price(ids,100) ), ]

and the function in the same controller:
def modify_price(ids,inc):

print request.vars.records
print ids
print inc 


Both request.vars.records and ids are lists also with only one selected

Thanks for help  

 








On Sunday, April 21, 2019 at 1:56:09 AM UTC+2, Anthony wrote:
>
> On Saturday, April 20, 2019 at 8:52:01 AM UTC-4, icodk wrote:
>>
>> Hi Antony
>>
>> My selectable looks like :
>>
>> selectable = [('Add 100 to price',lambda ids: redirect(URL('product', 
>> 'modify_price', args=request.args, vars=dict(id=ids, inc=100,
>>
>>
> Why do a redirect rather than simply doing the work in the same function? 
> Also, this redirect puts the ids in the URL query string, resulting in the 
> ultimate update being a GET request rather than a POST -- this is 
> undesirable because a refresh of that page will result in the entire 
> operation being repeated, which you don't want.
>  
>
>>
>> and my function in the product controller looks like this:
>>
>> def modify_price():
>>
>> if type(request.vars.id) is str:
>>
>> id_list = request.vars.id.split(',') #convertint to list
>>
>> else:
>>
>> id_list = request.vars.id
>>
>> db(db.product.id.belongs(id_list)).update(product_price=db.product.product_price+request.vars.inc)
>>
>>
>>  Simply following the documentation in the book
>>
>> I also tried:
>>
>> selectable=  lambda ids: modify_price
>>
>>
>> But the function neve called
>>
>
> It's not that the function never gets called but that the function is not 
> written to work this way. The function expects to find ids in 
> request.vars.id, but that is actually None in the case where you call it 
> this way (the real values are in request.vars.records). Is modify_price a 
> controller action that needs to be accessible separately from this 
> particular operation? If not, just make it a helper function that accepts 
> an "ids" argument, and set selectable=modify_price.
>
> 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 because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.smartgrid selectable return string or list

2019-04-20 Thread icodk


Hi Antony

My selectable looks like :

selectable = [('Add 100 to price',lambda ids: redirect(URL('product', 
'modify_price', args=request.args, vars=dict(id=ids, inc=100,


and my function in the product controller looks like this:

def modify_price():

if type(request.vars.id) is str:

id_list = request.vars.id.split(',') #convertint to list

else:

id_list = request.vars.id

db(db.product.id.belongs(id_list)).update(product_price=db.product.product_price+request.vars.inc)


 Simply following the documentation in the book

I also tried:

selectable=  lambda ids: modify_price


But the function neve called

It should be request.vars.records, not request.vars.id.


Also tried with 

def modify_rule_end_time():

print request.vars.records 


and 

def modify_rule_end_time(ids):

print ids

But again no error and the function was not called

On Friday, April 19, 2019 at 9:39:51 PM UTC+2, Anthony wrote:
>
> It should be request.vars.records, not request.vars.id.
>
> Note, request.vars is processed by the core framework, not by 
> SQLFORM.smartgrid, so it will be a single value if the browser sends only 
> one "records" field in the form data and a list otherwise. The core code 
> that populates request.vars has no way of knowing that a given field 
> containing a single value is supposed to be a list -- that has to be 
> handled elsewhere. SQLFORM.smartgrid itself handles this properly, but if 
> you are going to intercept request.vars and run some custom code outside of 
> the grid, then it is up to you to do the check and convert to a list.
>
> Keep in mind, the "selectable" argument to the grid should be a function 
> that takes the list of ids -- presumably you can move your code into that 
> function, in which case, you won't have to worry about this, as the grid 
> will handle the conversion to a list.
>
> Anthony
>
> On Friday, April 19, 2019 at 9:28:21 AM UTC-4, icodk wrote:
>>
>> SQLFORM.smartgrid selectable  return string if only one checkbox was 
>> slected and returns a list if 2 or more was selected.
>> This  inconsitancy force me to check for type before processing can 
>> continue
>> For example, If I have a button that update selected records in the 
>> database call a function that do:
>>
>>
>> db(db.product.id.belongs(request.vars.id)).update(price=db.product.price+request.vars.inc_price)
>>
>>
>> However if only one line selected in the grid request.vars.id is a string 
>> and not a list, which cause an error
>>
>>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SQLFORM.smartgrid selectable return string or list

2019-04-19 Thread icodk
SQLFORM.smartgrid selectable  return string if only one checkbox was 
slected and returns a list if 2 or more was selected.
This  inconsitancy force me to check for type before processing can continue
For example, If I have a button that update selected records in the 
database call a function that do:


db(db.product.id.belongs(request.vars.id)).update(price=db.product.price+request.vars.inc_price)


However if only one line selected in the grid request.vars.id is a string and 
not a list, which cause an error

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] update a table with data from another table or criteria based on a linked table

2019-04-14 Thread icodk
Is it possible to use DAL syntax to update a table based on a join to 
another table ?

Resulting something like :
UPDATE employees
SET employees.first_name = contacts.first_name
FROM employees
INNER JOIN contacts
ON (employees.contact_id = contacts.id)
WHERE contact.id = 101;

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Open a new page in the browser from redirect or URL

2019-03-08 Thread icodk
My be it is an idea for improving the grid by add (yet another)  option  
 to have radio buttons instead of checkboxes

On Saturday, March 9, 2019 at 12:08:50 AM UTC+1, icodk wrote:
>
> I would do it in javascript in the view and simulate radio buttons, which 
> means that every time the user is selecting a checkbox the script will 
> clear the former selected checkbox. This way you don't have to deal with 
> informing the user, about multiple selections.
>
> On Friday, March 8, 2019 at 9:07:55 PM UTC+1, João Matos wrote:
>>
>> The problem is that my origin page has a grid with extra buttons, using 
>> the selectable option.
>> And that option does not allow using _target or anything similar. It can 
>> only call a function (which is the function on the 1st message).
>> That function checks if there is only 1 record selected in the grid and 
>> if so calls the button action (add, edit, ...)
>> What I would like is for this action to open a new page.
>>
>> Do you see some solution?
>>
>> sexta-feira, 8 de Março de 2019 às 19:39:06 UTC, Leonel Câmara escreveu:
>>>
>>> It's sort of possible using response.js = "window.open(url, '_blank')" 
>>> however any modern browser will consider this a popup and block it because 
>>> it's a window.open that's not coming as a direct result of a click, you can 
>>> then move a step forward fighting with the user's browser preferences and 
>>> instead of using window.open you send javascript that creates an A element 
>>> and clicks it, or even a form that submits to another page.  
>>>   
>>> Don't do this, it won't work reliably. Depending on what you're trying 
>>> to do a good alternative can be to use a modal, or putting a 
>>> _target="_blank" in your form so it submits to a new window.
>>>
>>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Open a new page in the browser from redirect or URL

2019-03-08 Thread icodk
I would do it in javascript in the view and simulate radio buttons, which 
means that every time the user is selecting a checkbox the script will 
clear the former selected checkbox. This way you don't have to deal with 
informing the user, about multiple selections.

On Friday, March 8, 2019 at 9:07:55 PM UTC+1, João Matos wrote:
>
> The problem is that my origin page has a grid with extra buttons, using 
> the selectable option.
> And that option does not allow using _target or anything similar. It can 
> only call a function (which is the function on the 1st message).
> That function checks if there is only 1 record selected in the grid and if 
> so calls the button action (add, edit, ...)
> What I would like is for this action to open a new page.
>
> Do you see some solution?
>
> sexta-feira, 8 de Março de 2019 às 19:39:06 UTC, Leonel Câmara escreveu:
>>
>> It's sort of possible using response.js = "window.open(url, '_blank')" 
>> however any modern browser will consider this a popup and block it because 
>> it's a window.open that's not coming as a direct result of a click, you can 
>> then move a step forward fighting with the user's browser preferences and 
>> instead of using window.open you send javascript that creates an A element 
>> and clicks it, or even a form that submits to another page.  
>>   
>> Don't do this, it won't work reliably. Depending on what you're trying to 
>> do a good alternative can be to use a modal, or putting a _target="_blank" 
>> in your form so it submits to a new window.
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: compiled files location

2019-03-08 Thread icodk
Thanks

On Friday, March 8, 2019 at 2:49:58 PM UTC+1, Anthony wrote:
>
> On Friday, March 8, 2019 at 4:55:02 AM UTC-5, icodk wrote:
>>
>> So if I understand it right, web2py caches  compiled application files 
>> and do it on the first demand or a source change and never write back to 
>> storage/disk. If so, Is there any advantage for compiled web2py 
>> application (except the one time load and compile after web server reset)?
>>
>
> For model files, as you suggest, aside from the initial load, I don't 
> think the compiled files offer an advantage. There is a small advantage for 
> controller files, as in the non-compiled case, web2py still parses the 
> (cached) non-compiled code to identify all the function names. The biggest 
> advantage of compiling is with the views, as web2py does not internally 
> cache compiled view code in memory.
>
> 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 because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: compiled files location

2019-03-08 Thread icodk
So if I understand it right, web2py caches  compiled application files and 
do it on the first demand or a source change and never write back to 
storage/disk. If so, Is there any advantage for compiled web2py 
application (except the one time load and compile after web server reset)?

On Friday, March 8, 2019 at 6:43:32 AM UTC+1, Massimo Di Pierro wrote:
>
>  the web2py files gluon/*.py are compiled as you would expect and are in 
> gluon/*.pyc but, unlike flask or django where the user code imports the 
> framework, in web2py it is the framework that executes the user code (this 
> allows running multiple apps under one web2py). When web2py executes the 
> models, it compiles them and caches the compiled versions in 
> memory. Because of this design, if a file changes, it recompiles them on 
> the fly even when running under nginx. 
> If your app imports any modules in site-packages or app/modules/ they 
> produce *.pyc files as you would expect.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] compiled files location

2019-03-07 Thread icodk
I would expect a python application  like web2py running with nginx, to 
generate compiled files like  any other python application. 
However I can't see any byte compiled files under my application. Where are 
they ?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: DAL's fake_migrat and fake_migrate_all and migration problem with auth tables

2019-01-06 Thread icodk
Thanks Antony.
I already have the line
auth.define_tables(username=False, signature=False)
and the book mentions: migrate=False as a parameter to auth.define_tables
However it was not obvious for me that it can be used this way
This topic certainly increased my understanding of web2py
Thanks


On Monday, January 7, 2019 at 2:07:03 AM UTC+1, Anthony wrote:
>
> On Sunday, January 6, 2019 at 2:41:53 PM UTC-5, icodk wrote:
>>
>> Thanks to all of you 
>> How do I add migrate to the auth tables ?
>> I use 
>> auth.settings.extra_fields for extra fields but  entering 
>> migrate='db1_auth_user.table'  does not fits in this structure
>>
>
> You can do:
>
> auth.define_tables(..., migrate="db1_")
>
> and the *.table files will end up like db1_auth_user.table, 
> db1_auth_group.table, etc.
>
> 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 because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: DAL's fake_migrat and fake_migrate_all and migration problem with auth tables

2019-01-06 Thread icodk
Thanks to all of you 
How do I add migrate to the auth tables ?
I use 
auth.settings.extra_fields for extra fields but  entering 
migrate='db1_auth_user.table'  does not fits in this structure
I also tried:
db.auth_user._migrate='db1_auth_user'
just after the  auth.settings.extra_fields  but get an error 
'DAL' object has no attribute 'auth_user'


On Sunday, January 6, 2019 at 2:57:15 PM UTC+1, Anthony wrote:
>
> I also attempted to use the fake_migrate_all=True ,migrate=False but none 
>> of the auth files was created. Only my own tables files
>> 1. deleted all the databases folder files and set DAL's  
>> fake_migrate_all=True ,migrate=False
>> 2. Only my tables files (in databases folder), and scheduler files (with 
>> the new hex prefix) was created.
>>
>
> With migrate=False, fake_migrate and fake_migrate_all will do nothing -- 
> the above process would not create the *.table files for *any* of your 
> tables. Probably you already had the *.table files for your other tables at 
> that point, so it only *appeared* that the Auth files were skipped. If 
> you set fake_migrate_all=True, all tables defined during the subsequent 
> request (including Auth tables) will have their *.table files created, 
> unless migrate or fake_migrate is explicitly set to False for an individual 
> table. Note, auth.define_tables() itself takes migrate and fake_migrate 
> arguments -- if you have either of those arguments set to False, then the 
> Auth tables will not be fake migrated with fake_migrate_all=True.
>
> I suggest you read 
> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#markmin_table_migrations,
>  
> as it explains how everything works. In particular, look at the "Migration 
> Control Summary" section.
>  
>
>> Why the auth tables migration file names  need a hex prefix and  why it 
>> is different for each web2py installation ?
>> If the hex prefix can be changed and everything is working ? why need it 
>> in the first place ?
>>
>
> The prefix is simply a default generated by the DAL, and it is a hash of 
> the database URI (as noted in the documentation linked above). This allows 
> you to have multiple DAL instances linked to different databases without 
> worrying about clashes among the *.table file names. Alternatively, you can 
> specify your own prefix via the "migrate" argument, which the book actually 
> recommends:
>
> db.define_table('mytable', ..., migrate='db1_mytable.table')
>  
>
>> Shouldn't  a complete copy of application and database just work out of 
>> the box ?
>>
>
> It does if you (a) keep the database URI the same or (b) explicitly set 
> the *.table file names via each table's "migrate" argument. Otherwise, as 
> noted above, the URI hash is needed to allow multiple DAL instances within 
> a single app.
>
> 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 because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] DAL's fake_migrat and fake_migrate_all and migration problem with auth tables

2019-01-04 Thread icodk
First both fake_migrate and fake_migrate_all  are part of the DAL signature 
in the book,  However fake_migrate is only explained when it is used in a 
table definition, not in DAL.


Second issue that might be related:
I try to move web2py application to another server, including a pg database 
in the following order:
1. took a backup of the database on the old server
2. restored the database on the new server
3. Copy the web2py application to the new server include the databases files
4. my first attempt to run the app resulted in  error: relation "auth_user" 
already exists
6. I verified that a file  
 63e111e1d2096351b383c8ebce6b217f_auth_user.table EXIST so why the error?
7. Deleted the auth_user table from the database and file 
63e111e1d2096351b383c8ebce6b217f_auth_user.table
8. a new table was created and a new auth_user.table file but with another 
hex prefix: c8b669d15150d7109e5f7ab36744a5b7_auth_user.table
9. But now I got the same error on auth_group.
10.I solved it by just changing all the files with the old hex prefix to 
the new prefix and everything was working.
There are only hex prefix to the auth tables because I Can't/didn't set the 
migrate table settings 

I also attempted to use the fake_migrate_all=True ,migrate=False but none 
of the auth files was created. Only my own tables files
1. deleted all the databases folder files and set DAL's  
fake_migrate_all=True ,migrate=False
2. Only my tables files (in databases folder), and scheduler files (with 
the new hex prefix) was created.

Why not all tables files was created on fake migration?
Why the auth tables migration file names  need a hex prefix and  why it is 
different for each web2py installation ?
If the hex prefix can be changed and everything is working ? why need it in 
the first place ?
Shouldn't  a complete copy of application and database just work out of the 
box ?

(2.17.1-stable+timestamp.2018.08.05.17.57.00
(Running on nginx/1.12.1, Python 2.7.14)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Is there a way to stop updating language file?

2018-12-11 Thread icodk
Thanks

On Tuesday, December 11, 2018 at 12:17:22 PM UTC+1, Leonel Câmara wrote:
>
> Just put:
>
> T.is_writable = False
>
> In your models, if you want to go even further, get the T writable 
> attribute using appconfig.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Is there a way to stop updating language file?

2018-12-09 Thread icodk
I have a test installation to which I first git pull the latest   changes 
and then I test it as a user.
When testing the application the language file is changed automatically  as 
it should. However I am not interested in these changes
and forced to discard the changes just before the next git pull.
Could be nice to be able to put the language file in read only  state

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: common filter error on many to many table

2018-11-28 Thread icodk
PROBLEM SOLVED
I might be wrong but common filter can be an expression that refers ONLY to 
the filtered   table so it is not a general  DAL query.
(please correct me if I am wrong).
Solution:
Create a function that returns an expression  with only the filtered table 
and assign this function name to the common filter
The function:
def filter_person(query):

avail_groups=db((db.person_group.id==auth_user_person_group.person_group)&( 
db.auth_user_person_group.auth_user==auth.user.id))._select(db.person_group.id)
return db.person.person_group.belongs(avail_groups)


Now assign it to the common filter:


db.person._common_filter = filter_person





On Wednesday, November 28, 2018 at 5:54:31 PM UTC+1, icodk wrote:
>
> Getting the following error when setting a common filter on a table:
>
> *Query Not Supported: current transaction is aborted, commands ignored 
>> until end of transaction block*
>
>
> Looking in the database log  i can see an error on a missing table name in 
> a query:
>
> *ERROR:  missing FROM-clause entry for table "auth_user_person_group" at 
>> character ...*
>
>
> Table definitions:
> db.define_table('person_group',
> Field('name'))
>
> db.define_table('person',
> Field('name'),
> Field('group', 'reference person_group'),
>
>
>  The following table is the standard auth_user table and is not part of 
> the issue. Mentioned here  just for completeness
> db.define_table('auth_user',
> ...
> )
>
> The following table is a many to many that connects personal groups to 
> auth_user:
> db.define_table('auth_user_person_group',
> Field('auth_user', 'reference auth_user'),
> Field('group', 'reference person_group'),
> )
>
> ..And this is the common filter I try to use (that gives the above 
> mentioned error)
> It's propose is to limit the persons from the person table  to those 
> belongs to groups that the current auth.user is connected through the many 
> to m many table above (auth_user_person_group)
> db.person._common_filter = lambda query: (db.person.person_group == 
> db.auth_user_person_group.person_group)& 
> (db.auth_user_person_group.auth_user == auth.user.id)
>
> The query that reaches the database is missing the auth_user_person_group 
> table in the FROM part
>
> Help will be greatly appreciated
>
>
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: common filter error on many to many table

2018-11-28 Thread icodk
Correction to the common filter 
It is  :
db.person._common_filter = lambda query: (db.person.group == db.
auth_user_person_group.person_group)& (db.auth_user_person_group.auth_user 
== auth.user.id)

This error is only in the issue description here. So I still get the error 
in my code


On Wednesday, November 28, 2018 at 5:54:31 PM UTC+1, icodk wrote:
>
> Getting the following error when setting a common filter on a table:
>
> *Query Not Supported: current transaction is aborted, commands ignored 
>> until end of transaction block*
>
>
> Looking in the database log  i can see an error on a missing table name in 
> a query:
>
> *ERROR:  missing FROM-clause entry for table "auth_user_person_group" at 
>> character ...*
>
>
> Table definitions:
> db.define_table('person_group',
> Field('name'))
>
> db.define_table('person',
> Field('name'),
> Field('group', 'reference person_group'),
>
>
>  The following table is the standard auth_user table and is not part of 
> the issue. Mentioned here  just for completeness
> db.define_table('auth_user',
> ...
> )
>
> The following table is a many to many that connects personal groups to 
> auth_user:
> db.define_table('auth_user_person_group',
> Field('auth_user', 'reference auth_user'),
> Field('group', 'reference person_group'),
> )
>
> ..And this is the common filter I try to use (that gives the above 
> mentioned error)
> It's propose is to limit the persons from the person table  to those 
> belongs to groups that the current auth.user is connected through the many 
> to m many table above (auth_user_person_group)
> db.person._common_filter = lambda query: (db.person.person_group == 
> db.auth_user_person_group.person_group)& 
> (db.auth_user_person_group.auth_user == auth.user.id)
>
> The query that reaches the database is missing the auth_user_person_group 
> table in the FROM part
>
> Help will be greatly appreciated
>
>
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] common filter error on many to many table

2018-11-28 Thread icodk
Getting the following error when setting a common filter on a table:

*Query Not Supported: current transaction is aborted, commands ignored 
> until end of transaction block*


Looking in the database log  i can see an error on a missing table name in 
a query:

*ERROR:  missing FROM-clause entry for table "auth_user_person_group" at 
> character ...*


Table definitions:
db.define_table('person_group',
Field('name'))

db.define_table('person',
Field('name'),
Field('group', 'reference person_group'),
   

 The following table is the standard auth_user table and is not part of the 
issue. Mentioned here  just for completeness
db.define_table('auth_user',
...
)

The following table is a many to many that connects personal groups to 
auth_user:
db.define_table('auth_user_person_group',
Field('auth_user', 'reference auth_user'),
Field('group', 'reference person_group'),
)

..And this is the common filter I try to use (that gives the above 
mentioned error)
It's propose is to limit the persons from the person table  to those 
belongs to groups that the current auth.user is connected through the many 
to m many table above (auth_user_person_group)
db.person._common_filter = lambda query: (db.person.person_group == 
db.auth_user_person_group.person_group)& 
(db.auth_user_person_group.auth_user == auth.user.id)

The query that reaches the database is missing the auth_user_person_group 
table in the FROM part

Help will be greatly appreciated




-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web server with support for chunked transfer encoding

2018-11-18 Thread icodk
Hi
 I Trier
data = request.body.read()
But it returned nothing
You can easily test it with curl and Chunked transfer encoding header
If it works for you let me know
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Web server with support for chunked transfer encoding

2018-11-09 Thread icodk
Printing the  request object shows something like:
< gluon.rocket.ChunkedReader object at 0x00AFFB10 > ,

So there are signes that it is actually supported
Also :
'wsgi_input':  < gluon.rocket.ChunkedReader object at 0x00AFFB10 > ,
can be found in the request
I am using source with pg8000 installed.
The reason I use chunked tranfer  is because my device is small so I can't 
buffer all the data to see how long it is, and POST it with Content lenght
header. Of cours I could use enginx. Rocket is nice for development.




On Thursday, November 8, 2018 at 5:18:41 PM UTC+1, icodk wrote:
>
> Tried with Rocket  No error but request.args and request.vars are empty
> The client sends:
>
> POST /controller/statdata HTTP/1.1
> Host: myserver.com:8082
> Content-Type:application/json
> Transfer-Encoding: chunked
>
> and then sends the chunked data
>
> Rokets log shows:
> 192.168.1.3, 2018-11-08 16:46:57, POST, /controller/statdata, HTTP/1.1, 
> 200, 0.017997
>
> Any idea on the subject are welcome
>
>
>
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Web server with support for chunked transfer encoding

2018-11-08 Thread icodk
Tried with Rocket  No error but request.args and request.vars are empty
The client sends:

POST /controller/statdata HTTP/1.1
Host: myserver.com:8082
Content-Type:application/json
Transfer-Encoding: chunked

and then sends the chunked data

Rokets log shows:
192.168.1.3, 2018-11-08 16:46:57, POST, /controller/statdata, HTTP/1.1, 
200, 0.017997

Any idea on the subject are welcome





-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Can I do INSERT INTO statement with DAL syntax ?

2018-10-16 Thread icodk
Thanks Carlos.
I am going to loop through it

On Tuesday, October 16, 2018 at 9:43:13 PM UTC+2, Carlos Costa wrote:
>
> I think it is not possible yet.
> If you don't care about performance, in this case you can do it by code.
> But if you care, use db.executesql...
>
> Em sex, 12 de out de 2018 às 12:44, icodk > 
> escreveu:
>
>> something like :
>>
>> INSERT INTO Customers (CustomerName, City, Country)
>> SELECT SupplierName, City, Country FROM Suppliers
>> WHERE Country=1;
>>
>>
>> -- 
>> 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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> At.
>
> Carlos J. Costa
> --
> Cientista da Computação - Esp. Gestão em Telecom
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Can I do INSERT INTO statement with DAL syntax ?

2018-10-12 Thread icodk
something like :

INSERT INTO Customers (CustomerName, City, Country)
SELECT SupplierName, City, Country FROM Suppliers
WHERE Country=1;


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Setting writable and readable=True on all fields

2018-09-27 Thread icodk
At a certain point, I need to allow read and write on all fields of a 
specific table

How can I iterate through all fields in a table and set the writable, 
readable =true

This does not work:
for f in my_table.fields():
   f.writable=f.readable=True



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: session data type changed after upgrade to 2.17.1

2018-08-22 Thread icodk
Yes Antony, You got it right 
The issue is that both
 form.vars.start_date and  form.vars.end_date
returns a str type. 
Exactly the same code under 2.14.6 returns a 'date' type

On Thursday, August 23, 2018 at 6:02:49 AM UTC+2, Anthony wrote:
>
> On Wednesday, August 22, 2018 at 6:41:06 PM UTC-4, Joe Barnhart wrote:
>>
>> So "session" stuff gets pickled and unpicked which makes sense that dates 
>> might come back as strings.
>>
>
> Pickling preserves the data type. That is not the issue here. The problem 
> is the values in form.vars used to be dates and are now strings. Those 
> values are being stored in the session, but the problem happens before 
> anything gets to the session.
>
> 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 because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: session data type changed after upgrade to 2.17.1

2018-08-21 Thread icodk
Turned out that after the upgrade  the   form.vars.end_date and 
form.vars.end_date(both 
defined as type 'date') returns a data type str instead of a 'date' type

The form definition is:

form = SQLFORM.factory(
Field('start_date', 'date', label=T('Date range: '))
,Field('end_date', 'date', label=T(''))
,Field('amount',label=T('Total'),default=def_amount, widget=lambda f, v: 
SQLFORM.widgets.string.widget(f, v, _disabled=True))
,Field('online_order','boolean',label=T('Online 
orders'),default=session.online_order)
,Field('manual_order','boolean',label=T('Manual 
orders'),default=session.manual_order)


And then later the session vars gets 'infected'  as  str by the form.vars 
that should return 'date'

if form.process().accepted:
session.start_date=*form.vars.start_date *# here the form.vars.start_date 
is of type str
session.end_date = *form.vars.end_date   *# here the form.vars.end_date is 
of type str
session.online_order=form.vars.online_order
session.manual_order = form.vars.manual_order







On Tuesday, August 21, 2018 at 12:56:34 PM UTC+2, icodk wrote:
>
> Have:
>
> session.end_date=request.now.date()
>
> and then retrieve it as:
>
> datetimeEnd=datetime.datetime.combine(session.end_date, datetime.time.max)
>
> this all worked fine in 2.14.6
>
> but after upgrade to 2.17.1 I get:
>
> datetimeEnd=datetime.datetime.combine(session.end_date, datetime.time.max)
>
> TypeError: combine() argument 1 must be datetime.date, not str
>
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] session data type changed after upgrade to 2.17.1

2018-08-21 Thread icodk


Have:

session.end_date=request.now.date()

and then retrieve it as:

datetimeEnd=datetime.datetime.combine(session.end_date, datetime.time.max)

this all worked fine in 2.14.6

but after upgrade to 2.17.1 I get:

datetimeEnd=datetime.datetime.combine(session.end_date, datetime.time.max)

TypeError: combine() argument 1 must be datetime.date, not str



-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: error connecting to postgrsql when running web2py from source on windows

2018-08-18 Thread icodk
Problem solved !
Thanks Stifaan

On Saturday, August 18, 2018 at 12:49:48 PM UTC+2, 黄祥 wrote:
>
> pls install psycopg2 first, whether you use virtualenv or not to run 
> web2py, then restart your web2py server
> *e.g. in command prompt*
> pip install psycopg2
>
> 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 received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] error connecting to postgrsql when running web2py from source on windows

2018-08-18 Thread icodk
I get the following error when try  running from source (git clone 2.17.1 ) 
on windows.
RuntimeError: No driver of supported ones ('psycopg2',) is available

The welcome application runs fine.
works fine also (connecting to pg) on 2.14.6 source
used commandline:

C:\Python27\python.exe C:\Dev\web\web2py_win\web2py_2_17_1\web2py.py -c cert
/ca.crt -k cert/ca.key -p 443


Full error message :
 Failure to connect, tried 5 times: 
Traceback (most recent call last): File 
"C:\Dev\web\web2py_win\web2py_2_17_1\gluon\packages\dal\pydal\base.py", 
line 455, in __init__ self._adapter = adapter(**kwargs) File 
"C:\Dev\web\web2py_win\web2py_2_17_1\gluon\packages\dal\pydal\adapters\postgres.py",
 
line 25, in __call__ return AdapterMeta.__call__(cls, *args, **kwargs) File 
"C:\Dev\web\web2py_win\web2py_2_17_1\gluon\packages\dal\pydal\adapters\__init__.py",
 
line 40, in __call__ obj = super(AdapterMeta, cls).__call__(*args, 
**kwargs) File 
"C:\Dev\web\web2py_win\web2py_2_17_1\gluon\packages\dal\pydal\adapters\postgres.py",
 
line 48, in __init__ driver_args, adapter_args, do_connect, 
after_connection) File 
"C:\Dev\web\web2py_win\web2py_2_17_1\gluon\packages\dal\pydal\adapters\base.py",
 
line 369, in __init__ super(SQLAdapter, self).__init__(*args, **kwargs) 
File 
"C:\Dev\web\web2py_win\web2py_2_17_1\gluon\packages\dal\pydal\adapters\base.py",
 
line 50, in __init__ self.find_driver() File 
"C:\Dev\web\web2py_win\web2py_2_17_1\gluon\packages\dal\pydal\adapters\base.py",
 
line 101, in find_driver str(self.drivers)) RuntimeError: No driver of 
supported ones ('psycopg2',) is available


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] admin disabled because unable to access password file

2018-08-17 Thread icodk
upgraded to Version 2.17.1-stable+timestamp.2018.08.05.17.57.00 from the 
trunk 
I copied the old password file (parameters_443_.py ) but get
admin disabled because unable to access password file
when trying to activate the admin interface
Any idea how to solve it ?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] maker.js and web2py

2018-08-03 Thread icodk
Anybody with experience integrating Maker.js with web2py ?

https://maker.js.org/playground/?script=dogbone-polygon

I am looking for a simple example how to emit svg to specific element
All the examples on the official site emit it by calling document.write(svg)
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] ToolTip feature in HTML Table

2018-07-27 Thread icodk



Hi Gaurav Shet
Here is a rather complex example for a tooltip on a field in a grid that 
shows a warning if an email is missing and explanation as in the attached 
image. It also has a link that takes you to an edit form where you can edit 
the customer and enter an email. 
hope it can get you started
attrib_no_email= {'_alt': '0', '_class': 'std-tooltip', '_data-placement': 
'right', '_data-toggle': 'tooltip', '_title': T('mail address 
missing\nClick to add mail address')}

db.customer.email1.represent=lambda val,row: val if val else 
A(IMG(_src=URL('static', 'images/warning.png'), 
**attrib_no_email),_href=URL('shop', 'customer_list', args=['customer', 
'edit', 'customer', row.id], user_signature=True))
...


Css in the vew:

.std-tooltip + .tooltip > .tooltip-inner {
background-color: #00 ; 
color: #FF; 
border: 2px solid green; 
padding: 10px;
border-radius: 8px;
font-size: 12px;
}




On Friday, July 27, 2018 at 4:33:45 PM UTC+2, GS wrote:
>
> Hi Guys,
>
> I am looking to implement a tool tip feature to display content from the 
> .DB on mouse hover(pointing to each of the cells) 
>
> On Mousehover, I want to pull the unique data from the database for each 
> of the cells.
> I am not sure how can I achieve that for Web2py code.
>
> Please refer to the attached screenshot.
>
> Kindly suggest.
>
>
> --
> Thanks & Regards
> Gaurav Shet
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: empty field saved as NULL or ' '

2018-07-18 Thread icodk
Thanks
Where did you get it from ?

On Wednesday, July 18, 2018 at 2:57:41 PM UTC+2, icodk wrote:
>
> I have the flowing two field definitions:
> Field('code_1', default='', label=T("Code 1"), 
> requires=[IS_EMPTY_OR(IS_NOT_IN_DB(db, 
> 'product.code_1',error_message=T('Code 1 already in 
> use'),ignore_common_filters=False)),IS_LENGTH(maxsize=15)]),
> Field('code_2', default='',label=T("Code 2")),
>
> However when both are empty on a form , code_1 is saved as null but code_2 
> saved as ' '  in the database (PostgreSQL)
> So
> db(db.product.code_1==' ')
>
> gives different results then
>
> db(db.product.code_2==' ')
>
> How do I get an empty string ' ' also for code_1  in db ?
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] empty field saved as NULL or ' '

2018-07-18 Thread icodk
I have the flowing two field definitions:
Field('code_1', default='', label=T("Code 1"), 
requires=[IS_EMPTY_OR(IS_NOT_IN_DB(db, 
'product.code_1',error_message=T('Code 1 already in 
use'),ignore_common_filters=False)),IS_LENGTH(maxsize=15)]),
Field('code_2', default='',label=T("Code 2")),

However when both are empty on a form , code_1 is saved as null but code_2 
saved as ' '  in the database (PostgreSQL)
So
db(db.product.code_1==' ')

gives different results then

db(db.product.code_2==' ')

How do I get an empty string ' ' also for code_1  in db ?


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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"),
> Field.Virtual("ff", lambda r:r.tt.f)
> )
>
>
> And a grid:
>
> def t():
> form = SQLFORM.grid(
> db.tt,
> )
> return dict(form=form)
>
>
> Works fine.
> But with the *field argument* I get an error:
>
> def t():
> form = SQLFORM.grid(
> db.tt,
> *fields=[**db.tt.ff]*
> )
> return dict(form=form)
>
>
> Error ticket for "gridtest"
> Ticket ID
>
> 194.118.190.134.2018-04-14.22-40-01.bc6da3b6-bd21-4dbe-8c78-f50c4a349fec
> Version
> web2py™ Version 2.15.4-stable+timestamp.2017.09.02.04.02.22
> Python Python 2.7.12: /usr/local/bin/uwsgi (prefix: /usr/local)Traceback
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
>
> Traceback (most recent call last):
>   File "/home/www-data/web2py/gluon/restricted.py", line 219, in restricted
> exec(ccode, environment)
>   File "/home/www-data/web2py/applications/gridtest/controllers/default.py" 
> , 
> line 105, in 
>   File "/home/www-data/web2py/gluon/globals.py", line 414, in 
> self._caller = lambda f: f()
>   File "/home/www-data/web2py/applications/gridtest/controllers/default.py" 
> , 
> line 16, in t
> db.tt.ff,
>   File "/home/www-data/web2py/gluon/sqlhtml.py", line 2886, in grid
> value = row[str(field)]
>   File "/home/www-data/web2py/gluon/packages/dal/pydal/objects.py", line 84, 
> in __getitem__
> raise KeyError
> KeyError
>
> What is wrong?
>
>
> Regards Martin
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to update script deployment with the latest master commit ?

2018-04-05 Thread icodk
Yes this will probably work. Thanks
What I did was to delete web2py after script installation and clone it fro 
master.
Because only after the installation I discovered that there are some errors 
in the release that are fixed in the master.
( the error I found is in definition of fieldVirtual)

On Thursday, April 5, 2018 at 1:20:40 PM UTC+2, 黄祥 wrote:
>
> perhaps you can change this part
> wget http://web2py.com/examples/static/web2py_src.zip
> unzip web2py_src.zip
>
> with (untested and assuming git already installed on your machine)
> git clone --recursive https://github.com/web2py/web2py.git
>
> 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 received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to update script deployment with the latest master commit ?

2018-04-05 Thread icodk
Script  deployment ( ex. setup-web2py-nginx-uwsgi-ubuntu.sh) installs the 
latest release. 
how to update it to the latest master commit ?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: 'FieldVirtual' object has no attribute 'listable'

2018-03-12 Thread icodk
Try to make the virtual field writable=False


On Monday, March 12, 2018 at 9:04:07 PM UTC+1, Andrea Fae' wrote:
>
> I don't know because I'm sure mounths ago it was working...
>
>
> form = SQLFORM.grid(query, args=[studente], fields=[db.evento.titolo, 
> db.evento.ricorrenza, db.evento.giorno_inizio, db.evento.inizio, 
> db.evento.fine, db.evento.risorsa, db.evento.materia, 
> db.evento.docente],headers=headers,create=False, details=False, 
> editable=False, deletable=False, searchable=False, maxtextlength=60, 
> exportclasses = exportcls)
>
>
> this is the table...
>
> db.define_table('evento',
> Field('titolo', requires=[IS_NOT_EMPTY()]),
> Field('inizio', type='datetime'),
> Field('fine', type='datetime'),
> Field('uniqueid', type='string'),
> Field('ricorrenza', requires = IS_IN_SET(['0', '1', '2', 
> '3', '4', '5', '6', '7', '8', '9', '10'], error_message='deve essere un 
> numero da 0 a 10'), default= '0'),
> Field.Virtual('giorno_inizio', lambda 
> row:calendar.day_name[row.evento.inizio.weekday()]),
> Field('risorsa', 'reference risorsa'),
> Field('docente', 'reference auth_user'),
> Field('materia', 'reference materia'),
> Field('studenti', 'list:reference auth_user'),
> Field('colore', default = '#8080ff'),
> Field('controllato', type='boolean', default=False),
> Field('note'),
> 
> auth.signature,singular="Evento",plural="Eventi",migrate='evento.table',
> format='%(titolo)s')
> # questa impostazione serve per rappresentare inizio senza i secondi
> db.evento.inizio.represent = lambda value, row: value.strftime("%d/%m/%Y 
> %H:%M")
> db.evento.fine.represent = lambda value, row: value.strftime("%d/%m/%Y 
> %H:%M")
> db.evento.giorno_inizio.represent = lambda giorno_inizio, row: 
> T(giorno_inizio)
>
>
> I think it's a problem about the last version of web2py..
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: using the auth. infrastructure to manage another user list

2018-02-15 Thread icodk
It is getting muddy...
What about the different messages I want to show depending on the type of 
user ?

On Thursday, February 15, 2018 at 12:00:44 AM UTC+1, Jim S wrote:
>
> So, then maybe you just add users and they all get departmental access and 
> then have a button on the site where they can request admin access?
>
> Then you can add them to an admin group that would give access to all 
> features.
>
> Would that help?
>
> Jim
>
>
> On Feb 14, 2018 4:38 PM, "icodk" <i...@alpiron.com > wrote:
>
>> That was fast response
>> Thanks.
>> Not sure it is an issue but for the departmental user registration, i 
>> want to use different messages, and handling. For example, departmental 
>> user should be approved automatically, while main users manually.
>>
>> --
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/J7xDgqtJTvE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: using the auth. infrastructure to manage another user list

2018-02-14 Thread icodk
That was fast response
Thanks.
Not sure it is an issue but for the departmental user registration, i want to 
use different messages, and handling. For example, departmental user should be 
approved automatically, while main users manually.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] using the auth. infrastructure to manage another user list

2018-02-14 Thread icodk
I have a "standard"  web2py application that uses the built in 
authentication system with sign in, login/out , forgot/change password etc.
In addition, I need to  manage "departmental" users that should not have 
access to the main application but only to a subset of services.
Is there a way to leverage the authentication system but  to use a 
different user table. In other words I would like to run two parallel  but 
separated authentication system 
Any idea  how to do it ? 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Ajax encoding problem

2018-02-07 Thread icodk
probably not a web2py issue but may be someone can help:
I have a string field containing the string 'TØM', all works fine in pure 
web2py.
When I try to read it dynamically with ajax I get the string 'T\xc3\x98ST'

The ajax call is as following:

$.ajax({

   type: "POST",
   url: "/shop/ajax_get_products/"+$('#cust_type').val(),

 success: function (msg) {
//console.log(msg)
/* Remove all options from the select list */
$("#product_list").empty();
 if(msg=="[]"){
 $("#product_price").text({{=T("'Selected customer type has no 
products'")}});
return;
}
$("#product_list").html(msg); 

return;
},
error: function(jqXHR, exception){
console.log(exception)

}e...

The web2py function that returns the data :

products=db((db.shop_price.cust_type==request.args[0])&(db.shop_product.id==db.shop_price.product)&(db.shop_product.enable==True)).select()

opts=[OPTION(prod.shop_product.name,_value=str(prod.shop_product.id)).xml() for 
prod in products]

return XML(opts)



I get a fine list of names in the browser except the string  'TØM' that is 
shown as   'T\xc3\x98ST'
I tried encoding/decoding the name in the option generator above but got a 
python error.
I tried:

opts=[OPTION(prod.shop_product.name.encod('utf-8'),_value=str(prod.shop_product.id)).xml()
 for prod in products]


Also tried adding  to the ajax call:

dataType : "html",
contentType: "application/json; charset=utf-8",


same results

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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: grid column names do not print nicely

2017-12-20 Thread icodk
Thanks Anthony

Eliminating buttons:


.btn{
 display: none !important;
}



Eliminating breadcrumb: 

  .w2p_grid_breadcrumb_elem{
 display: none !important;
}

All inside @media print {

}

The magic continue:-)


On Wednesday, December 20, 2017 at 8:13:18 PM UTC+1, Anthony wrote:
>
> Bootstrap includes CSS to print the href values for any links. To disable 
> this just for links within a web2py grid, you can add the following CSS 
> somewhere:
>
> @media print {
> .web2py_table a[href]:after {
> content: none !important;
> }
> }
>
> If you only want to eliminate the URLs from the column headings but leave 
> other URLs within the table, you can use the selector ".web2py_table th 
> a[href]:after". If you want to eliminate more URLs, you can use a more 
> general selector (e.g, "a[href]:after" will get rid of all link URLs 
> anywhere on the page).
>
> Probably we should add some code to web2py-bootstrap3.css to remove some 
> of the URLs from the grid when printing (e.g., headings, pagination links, 
> etc.). If you'd like, open a github issue and link to this thread.
>
> Anthony
>
> On Wednesday, December 20, 2017 at 6:17:13 AM UTC-5, icodk wrote:
>>
>> When in grid or smartgrid trying to print the page with browser's own 
>> print function, columns name comes out as URLS of the page instead of the 
>> text of the name of the column name. 
>> Could be nice to be able to print with browser own print function.
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] grid column names do not print nicely

2017-12-20 Thread icodk
When in grid or smartgrid trying to print the page with browser's own print 
function, columns name comes out as URLS of the page instead of the text of 
the name of the column name. 
Could be nice to be able to print with browser own print function.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Virtual field error :'FieldVirtual' object has no attribute 'listable' in 2.16.1

2017-12-03 Thread icodk
Still get the same error (only replaced the objects.py file)
As before the error  shows up if I list the virtual field in the fields 
parameter. If fields=None then no error, but all fields are shown.

Another isue (might be related) is  if you have a compute field, and edit a 
record you can't save it. For example directly from the book.:
Field('full_name',compute=lambda r: r['first_name']+' '+r['last_name']),



This also worked before (2.14.06)
Thanks 

On Sunday, December 3, 2017 at 6:31:06 PM UTC+1, Massimo Di Pierro wrote:
>
> I just fixed this in the master branch of pydal. Can you please confirm it 
> is fixed for you?
>
> On Saturday, 2 December 2017 18:26:12 UTC-6, icodk wrote:
>>
>> Virtual field definition generate error in 
>> 2.16.1-stable+timestamp.2017.11.14.05.54.25
>> Works  fine in  2.14.06
>> my field definition is:
>>
>> db.zone.inside = Field.Virtual('inside', lambda row: 1)
>>
>> I get the following error:
>>
>> 'FieldVirtual' object has no attribute 'listable'
>>
>> The field is defined just before a call to grid = 
>> SQLFORM.smartgrid(db.zone,...
>>
>> Thanks for any help
>>
>>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Virtual field error :'FieldVirtual' object has no attribute 'listable' in 2.16.1

2017-12-02 Thread icodk
Virtual field definition generate error in 
2.16.1-stable+timestamp.2017.11.14.05.54.25
Works  fine in  2.14.06
my field definition is:

db.zone.inside = Field.Virtual('inside', lambda row: 1)

I get the following error:

'FieldVirtual' object has no attribute 'listable'

The field is defined just before a call to grid = 
SQLFORM.smartgrid(db.zone,...

Thanks for any help

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Cannot import module 'applications.welcome.modules.pytz

2017-11-30 Thread icodk
SOLVED !
use:
sudo pip install pytz

and not
pip install pytz


if you install pytz using pip without sudo , it will be installed for the 
login user and will be inaccessible from uwsgi/nginx
Example:
yourname@yourserver:~$pip install pytz

will install it in

 /home/yourname/.local/lib/python2.7/site-packages/pytz/

you can check it by starting python, importing pytz and then typing pytz. 
This will show the complete path of the library.

>>>import pytz
>>> pytz

>>>
while installing it with
sudo pip install pytz

will install it in :





On Thursday, November 30, 2017 at 8:18:35 PM UTC+1, icodk wrote:
>
> What I did:
>
> added
> import pytz
>
> in db.py in the welcome application 
>
> The error:
>  (ImportError("Cannot import module 
> 'applications.welcome.modules.pytz'",),  x7fc194275bd8>)
>
> Environment:
> 2.16.1-stable+timestamp.2017.11.14.05.54.25
> (Running on nginx/1.12.1, Python 2.7.14)
>
> fresh web2py installation on Ubuntu 17.10 using the 
> script: setup-web2py-nginx-uwsgi-ubuntu.sh
>
> python version in terminal:
>
> Python 2.7.14 (default, Sep 23 2017, 22:06:14)
> [GCC 7.2.0] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>>
>
>
> Any idea ?
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Cannot import module 'applications.welcome.modules.pytz

2017-11-30 Thread icodk
What I did:

added
import pytz

in db.py in the welcome application 

The error:
 (ImportError("Cannot import module 
'applications.welcome.modules.pytz'",), 
)

Environment:
2.16.1-stable+timestamp.2017.11.14.05.54.25
(Running on nginx/1.12.1, Python 2.7.14)

fresh web2py installation on Ubuntu 17.10 using the 
script: setup-web2py-nginx-uwsgi-ubuntu.sh

python version in terminal:

Python 2.7.14 (default, Sep 23 2017, 22:06:14)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>


Any idea ?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.16.1 is OUT

2017-11-26 Thread icodk
I have a compute field (from the web2py book):

Field('full_name',compute=lambda r: r['first_name']+' '+r['last_name']),


as an extra field in the 
auth.settings.extra_fields['auth_user']

This worked fine in 2.14.06 but in version  2.16.1 it prevents the profile 
form to be submitted
Any idea 
(linux nginx etc)

On Tuesday, November 14, 2017 at 6:59:52 AM UTC+1, Massimo Di Pierro wrote:
>
> web2py 2.16.1 is OUT
>
> Lots of bugs fixes contributed by the community. Thanks Leonel, Paolo, 
> Giovanni, and all those who contributed.
>
> the most visible changes are:
>
> - welcome now defaults to bootstrap 4
> - lots of cleanup in the welcome app and new examples in default.py
> - simplified layout.html
>
> Massimo 
>
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: limiting the SSL max fragment size on development server (Rocket)

2017-10-31 Thread icodk
Thanks mcm for your suggestion.
I added this line in rocket.py
self.socket.settimeout(SOCKET_TIMEOUT)
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 4096)
self.shutdown = self.socket.shutdown
 

starting around line 133 but I keep getting the same error on my IoT 
platform, which I thing is related to this fragment buffer size.
So bottom line I have no idea if this works. Thanks for your time. 



On Tuesday, October 31, 2017 at 6:38:36 PM UTC+1, mcm wrote:
>
> I think this is not exposed at python level
> you may try to hack the size on the lower level on the socket object using 
> the setsocktopt function) ... untested ;-)
>
> socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 4096)
>
>
>
> 2017-10-25 20:42 GMT+02:00 Dave S <snide...@gmail.com >:
>
>>
>>
>> On Wednesday, October 25, 2017 at 6:18:08 AM UTC-7, icodk wrote:
>>>
>>> Some small IoT units can't  afford the standard 16K fragment size 
>>> required by default for SSl negotiation.
>>> On some servers it is possible to set such limit, ex 
>>> nginx: ssl_buffer_size 4k;
>>>
>>> Is it possible to do the same on web2py development server ? 
>>>
>>
>> A quick look at rocket.py doesn't make it obvious how to do it.  I don't 
>> know if the ssl.wrap_socket() call has optional parameters for this; if it 
>> does, it's not obvious [to me] in the Python docs at 17.3.
>>
>> /dps
>>
>>
>>
>>
>> -- 
>> 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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] limiting the SSL max fragment size on development server (Rocket)

2017-10-25 Thread icodk
Some small IoT units can't  afford the standard 16K fragment size required 
by default for SSl negotiation.
On some servers it is possible to set such limit, ex nginx: ssl_buffer_size 
4k;

Is it possible to do the same on web2py development server ? 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Export dates in local time to CSV or TSV

2017-09-09 Thread icodk
When exporting from smartgrid to CSV/TSV datetime fields are exported in 
server time zone (UTC). How can I export it in client local time ?
I already use the plugin_timezone that works perfectly in user browser.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Link to 2.15.3 downloads 2.15.2

2017-08-31 Thread icodk
On http://www.web2py.com/ there is a link to the download area:
2.15.3-stable+timestamp.2017.08.07.12.51.45 ( 
LGPLv3 License 
)
However, clicking on the   For Windows button under the For normal users , 
downloads 2.15.2

(https://mdipierro.pythonanywhere.com/examples/static/web2py_win.zip)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to create formstyle with tabs for smartgrid edit, new, view forms

2017-07-20 Thread icodk
Not sure this is the right place. Hope it can be useful for others.

Editing tables with many fields in a new, edit forms of a SQLFORM.smartgrid 
can be difficult  because all fields comes in a long list in the same order 
  as in the table definition. The attached simple application is a demo 
showing how  to subdivide the fields into tabs with meaningful names and 
user defined order.
Notes:
1. To add new lines to the grid you should register
2. All fields with writable =True should be included in the tab structure. 
Otherwise Edit/new forms will not submit
3. You can add a submit button to several tabs if you want.
4. Any improvements are welcome

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: show form errors in html form

2017-07-06 Thread icodk
Thanks Antony

You have to include code in the view to conditionally show the error 
> messages when they are present


If I use the alternative you mentioned I will have to manipulate the inputs 
classes because I am using  query.payment.js to validate and format some of 
the fields. 
If the code is simple I will go with the first option if I can find that 
code
 

On Thursday, July 6, 2017 at 4:38:09 PM UTC+2, Anthony wrote:
>
> You have to include code in the view to conditionally show the error 
> messages when they are present. Alternatively, you can use this approach to 
> creating custom form markup: 
> http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms.
>  
> Using the form.custom.widget.fieldname widgets will include the default 
> error messages automatically when they are present.
>
> Anthony
>
> On Thursday, July 6, 2017 at 8:33:06 AM UTC-4, icodk wrote:
>>
>> I build a form like explained in :
>>
>> http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML
>> which man that I build an html form in the view and doesn't  pass the 
>> form to the view
>>
>> The form has a name field
>>
>> In my onvalidation function I set
>>  form.errors.name="Name is not valid"
>>
>> The form is not submitted as expected but the standard web2py error 
>> message that usually shows up just under the field in error  does not shows 
>> up.
>> How can I show the error?
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] show form errors in html form

2017-07-06 Thread icodk
I build a form like explained in :
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-in-HTML
which man that I build an html form in the view and doesn't  pass the form 
to the view

The form has a name field

In my onvalidation function I set
 form.errors.name="Name is not valid"

The form is not submitted as expected but the standard web2py error message 
that usually shows up just under the field in error  does not shows up.
How can I show the error?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] detecting changes to edit/new forms

2017-06-18 Thread icodk
I am using the standard new/edit forms generated by SQLFORM.smartgrid.
These forms has a Back button, that discards any change to the form when 
pressed. 
Is there a way to detect that a user edited any of the fields, and show an 
alert where user can choose to submit the form instead of discarding 
 changes ?

Thanks in advance

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SSL Error with Sparkpost api with web2py.exe

2017-06-15 Thread icodk
With web2py.exe more complete screenshot
C:\Dev\web\web2py_win\web2py_2_14_06>web2py.exe -S welcome
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2017
Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Database drivers available: psycopg2, pymysql, imaplib, MySQLdb, sqlite3, 
pyodbc
WARNING:web2py:import IPython error; use default python shell
Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel)] 
on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> execfile( "/temp/mailtest.py", variables )
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'variables' is not defined
>>> variables= {}
>>> execfile( "/temp/mailtest.py", variables )
Traceback (most recent call last):
  File "", line 1, in 
  File "/temp/mailtest.py", line 10, in 
subject='Hello from python-sparkpost'
  File "C:\Python27\lib\site-packages\sparkpost\transmissions.py", line 
254, in send
results = self.request('POST', self.uri, data=json.dumps(payload))
  File "C:\Python27\lib\site-packages\sparkpost\base.py", line 41, in 
request
**kwargs)
  File "C:\Python27\lib\site-packages\sparkpost\base.py", line 12, in 
request
response = self.sess.request(method, uri, headers=headers, **kwargs)
  File "C:\Python27\lib\site-packages\requests\sessions.py", line 513, in 
request
resp = self.send(prep, **send_kwargs)
  File "C:\Python27\lib\site-packages\requests\sessions.py", line 623, in 
send
r = adapter.send(request, **kwargs)
  File "C:\Python27\lib\site-packages\requests\adapters.py", line 514, in 
send
raise SSLError(e, request=request)
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
(_ssl.c:581)
>>>

On Friday, June 9, 2017 at 9:48:55 AM UTC+2, icodk wrote:
>
> Sparkpost has simple python api:
>
> from sparkpost import SparkPost
> sp = SparkPost('YOUR API KEY')
>
> response = sp.transmissions.send(
> use_sandbox=True,
> recipients=['some...@somedomain.com'],
> html='Hello world',
> from_email='t...@sparkpostbox.com',
> subject='Hello from python-sparkpost'
> )
>
> print(response)
>
>
> However I get the following error:
> SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl
> .c:581)
>
> Could be something with the python version  in web2py.exe (I am useing 
>  web2py_2_14_06)
> Any idea
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SSL Error with Sparkpost api with web2py.exe

2017-06-15 Thread icodk
Sorry for the late response
There is definitly a different if I use web2py  shell source  to send mail 
or web2py.exe
It works fine with source and failes with web2py.exe
My python installation is 2.7.13
here is my source execution :
C:\Temp\web2py_src\web2py>python web2py.py -S welcome
No handlers could be found for logger "web2py"
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2017
Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000, 
pyodbc
WARNING:web2py:import IPython error; use default python shell
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> variables= {}
>>> execfile( "/temp/mailtest.py", variables )
{u'total_accepted_recipients': 1, u'id': u'48590550571575300', 
u'total_rejected_recipients': 0}
>>>

and here is with web2py.exe
Enter code here...>>> variables= {}
>>> execfile( "/temp/mailtest.py", variables )
Traceback (most recent call last):
  File "", line 1, in 
  File "/temp/mailtest.py", line 10, in 
subject='Hello from python-sparkpost'
  File "C:\Python27\lib\site-packages\sparkpost\transmissions.py", line 
254, in send
results = self.request('POST', self.uri, data=json.dumps(payload))
  File "C:\Python27\lib\site-packages\sparkpost\base.py", line 41, in 
request
**kwargs)
  File "C:\Python27\lib\site-packages\sparkpost\base.py", line 12, in 
request
response = self.sess.request(method, uri, headers=headers, **kwargs)
  File "C:\Python27\lib\site-packages\requests\sessions.py", line 513, in 
request
resp = self.send(prep, **send_kwargs)
  File "C:\Python27\lib\site-packages\requests\sessions.py", line 623, in 
send
r = adapter.send(request, **kwargs)
  File "C:\Python27\lib\site-packages\requests\adapters.py", line 514, in 
send
raise SSLError(e, request=request)
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed 
(_ssl.c:581)
>>>




On Sunday, June 11, 2017 at 10:08:58 AM UTC+2, Massimo Di Pierro wrote:
>
> First of all I recommend you configure sparkpost using web2py auth.mailer 
> SMTP else you do not get the benefit of auth email logic.
>
> Also, I recommend you run web2py from source, not the windows binary. I 
> will give you more control. If you find that running from source makes the 
> problem go away, please let us know.
>
> Massimo
>
> On Friday, 9 June 2017 02:48:55 UTC-5, icodk wrote:
>>
>> Sparkpost has simple python api:
>>
>> from sparkpost import SparkPost
>> sp = SparkPost('YOUR API KEY')
>>
>> response = sp.transmissions.send(
>> use_sandbox=True,
>> recipients=['som...@somedomain.com '],
>> html='Hello world',
>> from_email='te...@sparkpostbox.com ',
>> subject='Hello from python-sparkpost'
>> )
>>
>> print(response)
>>
>>
>> However I get the following error:
>> SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (
>> _ssl.c:581)
>>
>> Could be something with the python version  in web2py.exe (I am useing 
>>  web2py_2_14_06)
>> Any idea
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] SSL Error with Sparkpost api with web2py.exe

2017-06-09 Thread icodk
Sparkpost has simple python api:

from sparkpost import SparkPost
sp = SparkPost('YOUR API KEY')

response = sp.transmissions.send(
use_sandbox=True,
recipients=['some...@somedomain.com'],
html='Hello world',
from_email='t...@sparkpostbox.com',
subject='Hello from python-sparkpost'
)

print(response)


However I get the following error:
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c
:581)

Could be something with the python version  in web2py.exe (I am useing 
 web2py_2_14_06)
Any idea

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: grid add/edit form label

2017-06-06 Thread icodk
Sorry in your case it is
form[1][0][2][0]="Som text"

This will replace the text in the DOM element of the serialized form 
returned by the call to SQLFORM.smartgrid
Please note that the indexes (1,0,2,0) I used above can be different in 
your case. To find out start by printing the element to the console, then 
you can change the  indexes to get the button text.
For more info please see:
http://web2py.com/books/default/chapter/29/05/the-views#Server-side-DOM-and-parsing

On Tuesday, June 6, 2017 at 6:20:29 AM UTC+2, T.R.Rajkumar wrote:
>
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: grid add/edit form label

2017-06-05 Thread icodk
Code example:
else: #person grid
personRow = db(db.person.id == request.args[-1]).select()[0]
title = T("cars owned by :") + personRow.name
addBtn = T("Add new car for: ") + carRow.name
if toCreate:
grid[1][0][2][0] =addBtn



On Monday, June 5, 2017 at 11:47:15 AM UTC+2, T.R.Rajkumar wrote:
>
> Thanks icodk. You  said The last part is after the call to 
> SQLFORM.smartgrid. Here you can manipulate the serialized HTML data by for 
> example changing the "+Add record" text to "+Add person" in the  auto 
> generated button 
>
> I would like to know how you manipulate the html in controller as above 
> for changing the button text. 
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: grid add/edit form label

2017-06-03 Thread icodk
In a controller that shows a grid/smartgrid, I have three parts.The first 
part is before the call to the SQLFORM.smartgrid, then next is the call to 
SQLFORM.smartgrid and the third part is after the call to SQLFORM.smartgrid.
In the first part I inspect the request.args to figure out what the grid is 
going to do. For example:
if 'edit' in request.args:
   db.person.email.writable=False
   db.person.street_address.label="where is your house"

This will prevent the user from editing the email in the edit form
If there are linked tables I can also detect it and prepare a title like:
"This is a list of cars owned by John Smith"
In general request.args is your friend. Print it out and see what 
information is there

The last part is after the call to SQLFORM.smartgrid. Here you can 
manipulate the serialized HTML data by for example changing the "+Add 
record" text to "+Add person" in the  auto generated button 

On Saturday, June 3, 2017 at 6:32:15 AM UTC+2, T.R.Rajkumar wrote:
>
> As said I did this in controller but there is no effect in either create 
> or edit forms of amc_master or amc_details. I added the closing parenthesis 
> for the first dict. Anything I miss?
>
> form = SQLFORM.smartgrid(db.amc_master,
>  linked_tables=['amc_details'],
>  user_signature=False,
>  fields=dict(amc_master=list_of_fields),
>  formstyle='table3cols',
>  headers=headers,
>  formargs={'amc_master': 
> dict(labels=[{'lrrflg': 'Rate Revision'}]),
>'amc_details': dict(labels=[{'qty': 
> 'Quantity'}])}
> )
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] problem submitting a form

2017-06-02 Thread icodk
I created a formstyle that can show fields on different tabs (booustrap) in 
an sqlform.grid or smartgrid. edit/create/vew forms
based on bootstrap3_inline.
However now the edit /create forms do not submit
I have a demo app that I can mail to anybody interested. I could not attach 
it to this post (?)
You must register for some reason, I have no @auth.requires_login() decoration 
on any function
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid change form vars

2017-06-02 Thread icodk
Thanks
I am a bit slow but I think I got it.


On Friday, June 2, 2017 at 4:41:39 AM UTC+2, Anthony wrote:
>
> On Thursday, June 1, 2017 at 5:52:08 PM UTC-4, icodk wrote:
>>
>> Thanks, That explain why it didn't work in smartgrid (because I haven't 
>> specify the table name)
>> I still do not understand how my arguments will effect the auto generated 
>> SQLFORM or what kind of argument will effect the form and in what way.
>>
>
> You can pass any arguments that you would normally pass to SQLFORM(), so 
> they will have whatever effect they would normally have.
>
> 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 because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid change form vars

2017-06-02 Thread icodk
Dave S.
I appreciate  your responsiveness and alertness and the ever willingness to 
help others.
Thanks

On Friday, June 2, 2017 at 6:37:03 AM UTC+2, Dave S wrote:
>
>
>
> On Thursday, June 1, 2017 at 6:19:02 PM UTC-7, Dave S wrote:
>>
>>
>>
>> On Thursday, June 1, 2017 at 2:52:08 PM UTC-7, icodk wrote:
>>>
>>> Thanks, That explain why it didn't work in smartgrid (because I haven't 
>>> specify the table name)
>>> I still do not understand how my arguments will effect the auto 
>>> generated SQLFORM or what kind of argument will effect the form and in what 
>>> way.
>>> Is Niphlod's example is the only thing  you can do with it (reorder 
>>> fields)?
>>> Thanks
>>>
>>
>> Perhaps you could add a link to Niphlod's post, so that we can see what 
>> context he was addressing.
>>
>
>
> Whoops, sorry!  You already did this, and I just plain missed it.[...]
> On Wednesday, May 31, 2017 at 6:37:53 PM UTC-4, icodk wrote:
> [...]
>>
>> In another post 
>> <https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J>
>>  
>>
>
>> https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J
>>
>> Niphlod get a bit closer to a use example by specifying  editargs to 
>> reorder fields on an edit form. For the first it works  on grid but not on 
>> smartgrid, why ?
>>
>
>  
>
>>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid change form vars

2017-06-01 Thread icodk
Thanks, That explain why it didn't work in smartgrid (because I haven't 
specify the table name)
I still do not understand how my arguments will effect the auto generated 
SQLFORM or what kind of argument will effect the form and in what way.
Is Niphlod's example is the only thing  you can do with it (reorder fields)?
Thanks

On Thursday, June 1, 2017 at 7:06:13 PM UTC+2, Anthony wrote:
>
> On Wednesday, May 31, 2017 at 6:37:53 PM UTC-4, icodk wrote:
>>
>> Antony
>> could you elaborate or give an example of how to use formargs,editargs 
>> etc. ?
>>
>
> When viewing/creating/updating individual records, the grid creates a 
> SQLFORM. You can use formargs, etc. to pass arguments directly to the 
> SQLFORM instance generated by the grid -- just put the relevant arguments 
> in a dictionary.
>  
>
>> You write that it can be used by passing it to SQLFORM but what could be 
>> the actual use of it?
>> In another post 
>>
>> https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J
>>
>> Niphlod get a bit closer to a use example by specifying  editargs to 
>> reorder fields on an edit form. For the first it works  on grid but not on 
>> smartgrid, why ?
>>
>
> The smartgrid can display forms for multiple tables, so many of its 
> arguments should actually be dictionaries with individual table names as 
> the keys, and then the arguments for each table as the values. So, for 
> smartgrid, you would have something like:
>
> SQLFORM.smartgrid(..., formargs={'table1': dict(...), 'table2': dict(...), 
> ...})
>
> 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 because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: SQLFORM.grid change form vars

2017-05-31 Thread icodk
Antony
could you elaborate or give an example of how to use formargs,editargs etc. 
?
You write that it can be used by passing it to SQLFORM but what could be 
the actual use of it?
In another post 
https://groups.google.com/forum/#!searchin/web2py/formargs$20field$20order%7Csort:relevance/web2py/cxaHVL__3rc/lP6pGH_u614J

Niphlod get a bit closer to a use example by specifying  editargs to 
reorder fields on an edit form. For the first it works  on grid but not on 
smartgrid, why ?
Secondly, where can I read about what is valid and how it will effect the 
edit/create form ?  Could I use it to pass data to formstyle ? if yes then 
how to use it in the formstyle function ?

Thanks in advance


On Tuesday, March 15, 2016 at 6:22:27 AM UTC+1, Anthony wrote:
>
> You can use formargs, editargs, createargs, and viewargs to pass arguments 
> to the SQLFORM calls for create/edit/view forms. You can also set the 
> readable/writable attributes of individual fields to prevent them from 
> being displayed in the forms.
>
> Anthony
>
> On Tuesday, March 15, 2016 at 1:10:48 AM UTC-4, Vinyl 
> Darkscratch-Kazotetsu wrote:
>>
>> It doesn't seem like anyone else has run into this particular issue 
>> before.  I have an SQLFORM grid that is allowing my staff members on our 
>> website to add links to their profile upon the crew page.  An example is 
>> mine at https://www.nightwave.me/crew?member=VinylDarkscratch
>> However, I found out that SQLFORM.grid does not take a *fields* parameter 
>> like normal SQLFORM does, and as such staff members have access to edit 
>> fields they should not be able to, such as the user ID.  So, I attempted to 
>> set a default for the fields, in the controller function, to be the value 
>> that I'd like it to be, however I had gotten the following error:
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> 13.
>> 14.
>> 15.
>> 16.
>> 17.
>> 18.
>> 19.
>> 20.
>> 21.
>> 22.
>> 23.
>> 24.
>>
>> Traceback (most recent call last):
>>   File "/home/vinyldarkscratch/nightwave/gluon/restricted.py", line 227, in 
>> restricted
>> exec ccode in environment
>>   File 
>> "/home/vinyldarkscratch/nightwave/applications/nightwave/controllers/default.py"
>>  , 
>> line 294, in 
>>   File "/home/vinyldarkscratch/nightwave/gluon/globals.py", line 412, in 
>> 
>> self._caller = lambda f: f()
>>   File "/home/vinyldarkscratch/nightwave/gluon/tools.py", line 3774, in f
>> return action(*a, **b)
>>   File 
>> "/home/vinyldarkscratch/nightwave/applications/nightwave/controllers/default.py"
>>  , 
>> line 68, in submit_bio_links
>> linkform = SQLFORM.grid((db.user_links.user_id == auth.user.id))
>>   File "/home/vinyldarkscratch/nightwave/gluon/sqlhtml.py", line 2264, in 
>> grid
>> onsuccess=oncreate)
>>   File "/home/vinyldarkscratch/nightwave/gluon/html.py", line 2301, in 
>> process
>> self.validate(**kwargs)
>>   File "/home/vinyldarkscratch/nightwave/gluon/html.py", line 2238, in 
>> validate
>> if self.accepts(**kwargs):
>>   File "/home/vinyldarkscratch/nightwave/gluon/sqlhtml.py", line 1711, in 
>> accepts
>> self.vars.id = self.table.insert(**fields)
>>   File 
>> "/home/vinyldarkscratch/nightwave/gluon/packages/dal/pydal/objects.py", line 
>> 712, in insert
>> ret = self._db._adapter.insert(self, self._listify(fields))
>>   File 
>> "/home/vinyldarkscratch/nightwave/gluon/packages/dal/pydal/objects.py", line 
>> 658, in _listify
>> 'Table: missing required field: %s' % name)
>> RuntimeError: Table: missing required field: user_id
>>
>>
>> Any suggestions on how to set a field's value in an SQLFORM.grid after 
>> submission?
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py support

2017-05-31 Thread icodk
Thanks T.R.Rajkumar

On Wednesday, May 31, 2017 at 11:57:09 AM UTC+2, T.R.Rajkumar wrote:
>
> Could be interesting to hear what are the arguments for the porting 
>
> The points are
> 1. The application business logic has changed and the workflow has also 
> changed. So I have to do the app fresh. 
> 2. Since I like web2py I thought of porting it to web2py. Why I like 
> web2py? The answer is
>a. The neat and clean MVC design.
>b. SQLFORM, grid which are great time savers as told in the book itself 
>c. The HTML helpers, the DAL which almost reduces my views to {{=form}}
>d. In jsp for crud we have different pages for creating and editing. 
> The grid saves all the code for edit pages.
>e. If I concentrate on model then my controller and views are a breeze. 
> Thanks for all the validators.
>f. This group which is very friendly and I get answers to problems 
> almost always.
>g. jsp is doing things in a very roundabout way atleast in the app I 
> have. The pages have <%@ taglib prefix="app" uri="
> http://localhost:8080/cms/jstl/cms-custom-taglib; %> I have to go to tag 
> lib see the function siganture go the bean find the function and locate the 
> stored procedure which does the job. A
>In web2py it is so straight. 
>h. So comes the ease of maintenance. 
> Thank you web2py for all this and the nice people over here.
>
>
>
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py support

2017-05-30 Thread icodk
Could be interesting to hear what are the arguments for the porting 

On Tuesday, May 30, 2017 at 8:41:38 AM UTC+2, T.R.Rajkumar wrote:
>
> I am now porting a jsp application to web2py. Should I stay with web2py or 
> wait for web3py? Will there be web2py group support like now after web3py. 
> Pl guide. 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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Problem executing function from web2py shell

2017-05-28 Thread icodk
SOLVED !!
The table I try to select()  has a common filter property and this requires 
an extra parameter that I do not supply in my dummy function.
The very simple solution is to add ignore_common_filters=True to the query
Sorry for the disruption



On Saturday, May 27, 2017 at 9:23:04 PM UTC+2, icodk wrote:
>
> I have a simple function in a controller that I try to execute from 
> command line but gets a strange error:
> I start the shell with this command:
> web2py -S myapp/test/ -M
>
> I then call the function with the following command:
> >>>dummy_task()
>
>
> Dummy_taks () is defined as:
>  def dummy_task():
> rows=db(db.shop_product).select()
> print rows
>
>
> ... and I get the following error:
> >>> dummy_task()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "applications\myapp\controllers\test.py", line 4, in dummy_task
> rows=db(db.shop_product).select()
>   File 
> "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\objects.py", 
> line 2020, in select
> return adapter.select(self.query, fields, attributes)
>   File 
> "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\adapters\base.py",
>  
> line 1283, in select
> sql = self._select(query, fields, attributes)
>   File 
> "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\adapters\base.py",
>  
> line 1170, in _select
> sql_w = ' WHERE ' + self.expand(query) if query else ''
>   File 
> "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\adapters\base.py",
>  
> line 954, in expand
> rv = op(first, **optional_args)
> TypeError: AND() takes exactly 3 arguments (2 given)
> >>>
>
> Whats  wrong  here ?
> Thanks in advance
>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Problem executing function from web2py shell

2017-05-27 Thread icodk
I have a simple function in a controller that I try to execute from command 
line but gets a strange error:
I start the shell with this command:
web2py -S myapp/test/ -M

I then call the function with the following command:
>>>dummy_task()


Dummy_taks () is defined as:
 def dummy_task():
rows=db(db.shop_product).select()
print rows


... and I get the following error:
>>> dummy_task()
Traceback (most recent call last):
  File "", line 1, in 
  File "applications\myapp\controllers\test.py", line 4, in dummy_task
rows=db(db.shop_product).select()
  File 
"C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\objects.py", 
line 2020, in select
return adapter.select(self.query, fields, attributes)
  File 
"C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\adapters\base.py",
 
line 1283, in select
sql = self._select(query, fields, attributes)
  File 
"C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\adapters\base.py",
 
line 1170, in _select
sql_w = ' WHERE ' + self.expand(query) if query else ''
  File 
"C:\Dev\web\web2py_win\web2py_2_14_06\gluon\packages\dal\pydal\adapters\base.py",
 
line 954, in expand
rv = op(first, **optional_args)
TypeError: AND() takes exactly 3 arguments (2 given)
>>>

Whats  wrong  here ?
Thanks in advance

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: styling smartgrid New/Edit/View forms

2017-05-26 Thread icodk
Tried to create  a custom formstyle by copying existing one from sqlhtml.py 
(formstyle_table3cols) to my_formstyle in my controller
and set the grid formstyle=my_formstyle 
but got an error :
 formstyle not found
I can see that there is a formstyles  Storage in sqlhtml.py  so itryed to 
add 

formstyles['my_formstyle']='my_formstyle'

just before the call to grid = SQLFORM.smartgrid()
but got:
 global name 'formstyles' is not defined
Can you please point me to simple example of how to add a custom forstyle ?
Thanks in advance



On Thursday, May 25, 2017 at 4:02:08 PM UTC+2, Anthony wrote:
>
> You could create a custom formstyle function and then pass it to the grid 
> via the "formargs" argument or set response.formstyle.
>
> Anthony
>
> On Thursday, May 25, 2017 at 4:50:58 AM UTC-4, icodk wrote:
>>
>> Background
>> My model has a table with many fields (62). When using smartgrid to edit 
>> or add a record, all fields are shown in a long vertical list in the same 
>> order as defined in the model. So log so good.
>> This can be overwhelming to user that might need to see some of the 
>> fields very often and some others less frequently.
>> One way to solve this could be to show the fields in separate tabs that 
>> groups the fields according to some designation. Here is an example
>> Model:
>>
>> db.define_table('person',
>> Field('first_name',tab='General', label=T('First name'), 
>> default='',length=50),
>>
>> Field('last_name',tab='General', label=T('Last name'), 
>> default='',length=50),
>>
>>Field('phone',tab='Advance',label=T('phone'), default=''),
>>
>> Field('visits',tab='Statistics','integer' label=T('Visits'), 
>> default=0))
>>
>>
>> In the above model I added an imaginary tab property (which will cause en 
>> error in real application)  to group  fields with the same tab property 
>> under the same tab in a detail smartgrid form.
>> To solve the order of the tabs, the call to the smartgrid will include a 
>> 'tab' property which will be a list with tabs.
>>
>> Another more flexible solution  could be to add a 'tab ' property to 
>>  smartgrid which will be a dictionary with tab names as keys and a lists of 
>>  field names as values. This will allow also to order the fields on each 
>> tab and will not require any change to the existing define_table structure.
>>
>> Example:
>> tabs={'General':['first_name','last_name'],'Advance':['phone'],
>> 'Statistics':['visits']}
>>
>> I have this strange filling that this is already possible, may be 
>> something to do with formstyle.
>> Any help will be appreciated
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] styling smartgrid New/Edit/View forms

2017-05-25 Thread icodk
Background
My model has a table with many fields (62). When using smartgrid to edit or 
add a record, all fields are shown in a long vertical list in the same 
order as defined in the model. So log so good.
This can be overwhelming to user that might need to see some of the fields 
very often and some others less frequently.
One way to solve this could be to show the fields in separate tabs that 
groups the fields according to some designation. Here is an example
Model:

db.define_table('person',
Field('first_name',tab='General', label=T('First name'), 
default='',length=50),

Field('last_name',tab='General', label=T('Last name'), 
default='',length=50),

   Field('phone',tab='Advance',label=T('phone'), default=''),

Field('visits',tab='Statistics','integer' label=T('Visits'), 
default=0))


In the above model I added an imaginary tab property (which will cause en 
error in real application)  to group  fields with the same tab property 
under the same tab in a detail smartgrid form.
To solve the order of the tabs, the call to the smartgrid will include a 
'tab' property which will be a list with tabs.

Another more flexible solution  could be to add a 'tab ' property to 
 smartgrid which will be a dictionary with tab names as keys and a lists of 
 field names as values. This will allow also to order the fields on each 
tab and will not require any change to the existing define_table structure.

Example:
tabs={'General':['first_name','last_name'],'Advance':['phone'],'Statistics'
:['visits']}

I have this strange filling that this is already possible, may be something 
to do with formstyle.
Any help will be appreciated

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to execute a function in scheduler.py using command line

2017-05-18 Thread icodk
As I understand( might be wrong) what you suggest is to execute a function 
in a controller but  scheduler.py is not a controller and it is in the 
models folder
I could QUEUE the function and run the scheduler but it is cumbersome  to 
wait for the scheduler and debugging is  not the same 
I could  also  copy the function to a controller and  back to the 
scheduler.py.hope there is a better way


On Thursday, May 18, 2017 at 3:19:06 PM UTC+2, icodk wrote:
>
> For testing purposes I would like to execute a function in scheduler.py 
> using command line (better ideas are welcome)
> I tried:
> web2py.exe  -S myapp/scheduler/dummy_task  -M
>
> But got the following error
> web2py Web Framework
> Created by Massimo Di Pierro, Copyright 2007-2017
> Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
> Database drivers available: psycopg2, pymysql, imaplib, MySQLdb, sqlite3, 
> pyodbc
> Traceback (most recent call last):
>   File "", line 6, in 
>   File "__main__.py", line 128, in 
>   File "__main__web2py__.py", line 33, in 
>   File "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\widget.py", line 1146, 
> in start
> cronjob=options.cronjob)
>   File "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\shell.py", line 245, in 
> run
> exec read_pyc(pycfile) in _env
>   File "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\compileapp.py", line 
> 461, in read_pyc
> data = read_file(filename, 'rb')
>   File "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\fileutils.py", line 
> 103, in read_file
> f = open(filename, mode)
> IOError: [Errno 2] No such file or directory: 
> 'applications\\myapp\\compiled\\controllers_scheduler_dummy_task.pyc'
>
>
>
> Thanks for any help
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] How to execute a function in scheduler.py using command line

2017-05-18 Thread icodk
For testing purposes I would like to execute a function in scheduler.py 
using command line (better ideas are welcome)
I tried:
web2py.exe  -S myapp/scheduler/dummy_task  -M

But got the following error
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2017
Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Database drivers available: psycopg2, pymysql, imaplib, MySQLdb, sqlite3, 
pyodbc
Traceback (most recent call last):
  File "", line 6, in 
  File "__main__.py", line 128, in 
  File "__main__web2py__.py", line 33, in 
  File "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\widget.py", line 1146, 
in start
cronjob=options.cronjob)
  File "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\shell.py", line 245, in 
run
exec read_pyc(pycfile) in _env
  File "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\compileapp.py", line 
461, in read_pyc
data = read_file(filename, 'rb')
  File "C:\Dev\web\web2py_win\web2py_2_14_06\gluon\fileutils.py", line 103, 
in read_file
f = open(filename, mode)
IOError: [Errno 2] No such file or directory: 
'applications\\myapp\\compiled\\controllers_scheduler_dummy_task.pyc'



Thanks for any help

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] WARNING:root:Unable to write to file /home/www-data/web2py/applications/myapp/languages/da.py

2017-03-16 Thread icodk
On some devices I get this error:
WARNING:root:Unable to write to file 
/home/www-data/web2py/applications/myapp/languages/da.py

This error is from the server log and the page that generate it only cause 
it on some devices (phones)  but not on others.
I checked the permissions  on both /languages/defaults.py and   
/languages/da.py and it is set to owner:root and group:root, with read to 
any and write to owner
Should I set it to www-data instead of root ?
 

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] global name 'T' is not defined

2017-01-25 Thread icodk
Thank you both
it works

On Wednesday, January 25, 2017 at 5:04:42 PM UTC+1, Anthony wrote:
>
> On Wednesday, January 25, 2017 at 4:40:40 AM UTC-5, mweissen wrote:
>>
>> Try in the module:
>>
>> from gluon import current
>> T = current.T
>>
>
> Don't do T=current.T at the top level of the module (or as a class 
> property) -- instead, that should go inside a function or method.
>
> 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 because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] global name 'T' is not defined

2017-01-25 Thread icodk
I have a controller that imports a module
In the controller I can use T('some text'). However trying to use it in a 
function in  an imported module gives:  global name 'T' is not defined
exception

The controller function is called from an ajax request

I also tried to 
from gluon import T

and got:

cannot import name T

Any idea  how to do it ?


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Cannot resolve reference error if reading (select()) a table in menue.py...

2017-01-19 Thread icodk
Yes you are right.
I renamed the second file so it will be pared before menu.py so now it works
Thanks

On Thursday, January 19, 2017 at 7:51:25 PM UTC+1, Anthony wrote:
>
> On Thursday, January 19, 2017 at 9:42:29 AM UTC-5, icodk wrote:
>>
>> Anthony
>> Attached a complete welcome application that demonstrate the problem
>> Just register and you should get the error
>> There are two tables of interest org table in db.py and  shop table in 
>> tables.py
>> the org table has a reference to the shop table  and there is a select() 
>> on the org table in menu.py that I think triggers the error
>>
>
> Well, without looking at the code, I assume the problem is that you are 
> attempting a query in menu.py that involves a table definition in 
> tables.py. Note that model files are executed in alphabetical order, so 
> when menu.py is executed, tables.py has not yet executed.
>
> 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 because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Cannot resolve reference error if reading (select()) a table in menue.py...

2017-01-18 Thread icodk
In general I can have a reference in table *child* to table *parent  
*disregarding 
the definition order. 
However, If I read from  table *child* (that reference table *parent*)  in 
menu.py, I get a Cannot resolve reference error 
Any idea how to solve it ?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Advice on structuring my app

2017-01-17 Thread icodk
Can a user be a member of several organizations ?
Who  is managing organizations?
How somebody get to be a member of an organization ?
With very little information available I would have an organization table 
and each newly registered user will get his own organization and will be 
his organization's admin. Each organization will have an invitation table 
 in which the admin can invite other users by sending them an invitation 
mail.
Invited user will get a mail with a link to join the organization. Clicking 
the link will activate a controller that add the user to a organization 
membership table.
In the invitation table the admin can also set permissions for each invited 
user. This way the admin can also revoke an invited user. All 
organization's data will be protected by common filter but shared data will 
not.
Hope it is helpful to some



If yes then you should have 

On Tuesday, January 17, 2017 at 8:21:08 PM UTC+1, Jim S wrote:
>
> I think you could accomplish that with the _common_filter.  That is what I 
> did on the app where I used it and it worked well.
>
> -Jim
>
> On Tuesday, January 17, 2017 at 11:33:02 AM UTC-6, Leonel Câmara wrote:
>>
>> I'm not sure I want to restrict each organization to a single domain yet. 
>> But yes it's a possibility, I don't need to necessarily use the domain name 
>> to do the filtering. Although I would also like them to be able to 
>> optionally share some data among them so I would also need to solve that 
>> problem.  
>>   
>> So basically, be able to do multitenancy within a single domain or with 
>> organizations being able to have more than one domain and sharing.
>>
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Grid search disregards time zone

2017-01-12 Thread icodk
My server is in UTC, my client is in Europe (time zones) .When client 
searches on a date time field the datetime string is sent in local time. 
The grid is showing datetime in local time as it should,using the great 
timezone plugin
(didn't work also before Breksit:-)

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Formatting decimal in SQLFORM.smartgrid edit form

2017-01-04 Thread icodk
I have the following field definition:

Field('unit_price', 'decimal(8,4)',  label=T('Price'),represent=lambda val,row: 
'{:8.2f}'.format(val),requires=IS_DECIMAL_IN_RANGE(0, 1, 
dot=","),default=0, writable=True,readable=True),

This field shows as it should (with only 2 decimals) in the grid display. 
However when editing a grid row, this field shows with 4 decimal digits.
Any idea ? 
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" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to show a writable=False field as a disabled input

2017-01-04 Thread icodk
It works
Thanks again for helping me

On Wednesday, January 4, 2017 at 5:33:32 PM UTC+1, Anthony wrote:
>
> Field('tag_id', widget=lambda f, v: SQLFORM.widgets.string.widget(f, v, 
> _disabled=True))
>
> Anthony
>
> On Wednesday, January 4, 2017 at 11:22:35 AM UTC-5, icodk wrote:
>>
>> .. other then setting it to writable=True  so it get's an id and name and 
>> then manipulate it with javascript on $(document).ready(function(...
>>
>> On Wednesday, January 4, 2017 at 5:19:02 PM UTC+1, icodk wrote:
>>>
>>> Thanks. You are right . Still, is it possible to show a disabled input 
>>> element instead of the standard div shown for writable=False fields ?
>>>
>>> On Wednesday, January 4, 2017 at 5:11:23 PM UTC+1, Anthony wrote:
>>>>
>>>> The "represent" attribute should be a function that takes the value and 
>>>> outputs some transformation of it.
>>>>
>>>> Anthony
>>>>
>>>> On Wednesday, January 4, 2017 at 10:44:59 AM UTC-5, icodk wrote:
>>>>>
>>>>> In SQLFORM.factory, when a field is writable=False, the field is only 
>>>>> shown with it's default value as an html div.
>>>>> Is it possible to represent it as a disabled INPUT (it both looks 
>>>>> better and is accessible for java script ) ?
>>>>> I tried: 
>>>>>
>>>>> Field('tag_id',writable=True,represent=INPUT(_disable=True,_type="text") 
>>>>> ))
>>>>>
>>>>>
>>>>> However  with both ,writable=True and writable= False the represent 
>>>>> is ignored.
>>>>>
>>>>>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to show a writable=False field as a disabled input

2017-01-04 Thread icodk
.. other then setting it to writable=True  so it get's an id and name and 
then manipulate it with javascript on $(document).ready(function(...

On Wednesday, January 4, 2017 at 5:19:02 PM UTC+1, icodk wrote:
>
> Thanks. You are right . Still, is it possible to show a disabled input 
> element instead of the standard div shown for writable=False fields ?
>
> On Wednesday, January 4, 2017 at 5:11:23 PM UTC+1, Anthony wrote:
>>
>> The "represent" attribute should be a function that takes the value and 
>> outputs some transformation of it.
>>
>> Anthony
>>
>> On Wednesday, January 4, 2017 at 10:44:59 AM UTC-5, icodk wrote:
>>>
>>> In SQLFORM.factory, when a field is writable=False, the field is only 
>>> shown with it's default value as an html div.
>>> Is it possible to represent it as a disabled INPUT (it both looks better 
>>> and is accessible for java script ) ?
>>> I tried: 
>>>
>>> Field('tag_id',writable=True,represent=INPUT(_disable=True,_type="text") ))
>>>
>>>
>>> However  with both ,writable=True and writable= False the represent is 
>>> ignored.
>>>
>>>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: How to show a writable=False field as a disabled input

2017-01-04 Thread icodk
Thanks. You are right . Still, is it possible to show a disabled input 
element instead of the standard div shown for writable=False fields ?

On Wednesday, January 4, 2017 at 5:11:23 PM UTC+1, Anthony wrote:
>
> The "represent" attribute should be a function that takes the value and 
> outputs some transformation of it.
>
> Anthony
>
> On Wednesday, January 4, 2017 at 10:44:59 AM UTC-5, icodk wrote:
>>
>> In SQLFORM.factory, when a field is writable=False, the field is only 
>> shown with it's default value as an html div.
>> Is it possible to represent it as a disabled INPUT (it both looks better 
>> and is accessible for java script ) ?
>> I tried: 
>>
>> Field('tag_id',writable=True,represent=INPUT(_disable=True,_type="text") ))
>>
>>
>> However  with both ,writable=True and writable= False the represent is 
>> ignored.
>>
>>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   >