Re: [web2py] Re: Application Issues After MySQL Database Update

2024-06-01 Thread sandeep patel
Thank you @villas for guidance. I'm pleased to inform you that I have
identified and fixed the problem. The application is now running smoothly.


Many Thanks
SP~


On Thu, May 30, 2024 at 5:25 PM villas  wrote:

> As this error seems to indicate a mismatch in the expected char set of the
> data.
> You can either connect with the correct char set,  or convert your data
> for example to unicode.  There are DB tools to help,  if you search online.
> In my experience, char set problems can be tricky,  especially if, heaven
> forbid, you end up mixing them in the same DB.
> BTW I am not very conversant with MySql and I only replied because you
> have been waiting for 3 days. Hopefully, others will also make suggestions,
> if they have any.
> Best wishes
>
> On Monday 27 May 2024 at 15:39:04 UTC+1 patelsa...@gmail.com wrote:
>
>> Dear Web2py Community,
>>
>> I hope this message finds you well.
>>
>> I am reaching out to seek your assistance regarding an issue I am
>> experiencing with my application. After updating the database version from
>> MySQL 5.7 to MySQL 8.0.35, my application has encountered problems and is
>> no longer functioning as expected.
>>
>> Here are the details of my setup:
>>
>> Python Version: 3.8.10
>> Web2py Version: 2.27.1
>>
>>
>> Thank you in advance for your support and assistance. I look forward to
>> your suggestions and advice.
>>
>> Here is the issue I am getting:
>>
>> Traceback (most recent call last):
>>   File "/home/ubuntu/api_server/web2py/gluon/restricted.py", line 219, in
>> restricted
>> exec(ccode, environment)
>>   File
>> "/home/ubuntu/api_server/web2py/applications/warehouse/controllers/default.py",
>> line 1910, in 
>>   File "/home/ubuntu/api_server/web2py/gluon/globals.py", line 463, in
>> 
>> self._caller = lambda f: f()
>>   File
>> "/home/ubuntu/api_server/web2py/applications/warehouse/controllers/default.py",
>> line 208, in user
>> form=auth()
>>   File "/home/ubuntu/api_server/web2py/gluon/tools.py", line 2047, in
>> __call__
>> return getattr(self, args[0])()
>>   File "/home/ubuntu/api_server/web2py/gluon/tools.py", line 3008, in
>> login
>> user = table_user(**{username: entered_username})
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/packages/dal/pydal/objects.py", line
>> 683, in __call__
>> self._db(query)
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/packages/dal/pydal/objects.py", line
>> 2686, in select
>> return adapter.select(self.query, fields, attributes)
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/packages/dal/pydal/adapters/base.py",
>> line 885, in select
>> return self._select_aux(sql, fields, attributes, colnames)
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/packages/dal/pydal/adapters/base.py",
>> line 842, in _select_aux
>> rows = self._select_aux_execute(sql)
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/packages/dal/pydal/adapters/base.py",
>> line 836, in _select_aux_execute
>> self.execute(sql)
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/packages/dal/pydal/adapters/__init__.py",
>> line 66, in wrap
>> if not args[0].connection:
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/packages/dal/pydal/connection.py",
>> line 33, in connection
>> return self.get_connection()
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/packages/dal/pydal/connection.py",
>> line 66, in get_connection
>> connection = self.connector()
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/packages/dal/pydal/adapters/mysql.py",
>> line 65, in connector
>> conn = self.driver.connect(**self.driver_args)
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/contrib/pymysql/__init__.py", line
>> 90, in Connect
>> return Connection(*args, **kwargs)
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/contrib/pymysql/connections.py", line
>> 688, in __init__
>> self.connect()
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/contrib/pymysql/connections.py", line
>> 905, in connect
>> self._get_server_information()
>>   File
>> "/home/ubuntu/api_server/web2py/gluon/contrib/pymysql/connections.py", line
>> 1231, in _get_server_information
>> self.server_charset = charset_by_id(lang).name
>>   File "/home/ubuntu/api_server/web2py/gluon/contrib/pymysql/charset.py",
>> line 38, in by_id
>> return self._by_id[id]
>> KeyError: 255
>>
>> Best regards,
>> Sandeep
>>
> --
> 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/901b6a08-70dd-47b4-bc65-e85f4c570369n%40googlegroups.com
> 

Re: [web2py] Re: web2py 2.26.1 released

2023-10-30 Thread Jim S
I highly recommend moving to py4web.  These days I dread working on web2py 
apps we haven't yet converted to py4web.  py4web is so much faster for 
execution and development.  Much more flexibility in form and grid 
layouts.  If there is something missing, let us know, we'd love to get more 
people switched over.

On Monday, October 30, 2023 at 10:48:47 AM UTC-5 Ramos wrote:

> I´m so comfortable with web2py, the admin dashboard and the scheduler are 
> blocking me from moving to py4web...
> Regards 
>
> Em seg., 30 de out. de 2023 às 04:48, Raul Monares  
> escreveu:
>
>> Great news. I appreatiate your work on both platforms
>>
>> On Sunday, October 29, 2023 at 3:13:31 PM UTC-6 Massimo Di Pierro wrote:
>>
>>> Changelog:
>>> - adds support of python up to version 3.11
>>> - fixes a bug with serialization of headers introduced in version 2.25.1
>>> - improves handling of unstable db connections in the scheduler
>>>
>>> I remind you that py4web has been out for 5 years now as successor of 
>>> web2py.
>>> It has the same template language and dal as web2py but it is a lot 
>>> faster.
>>> It has a better grid, form handling, and auth integrations.
>>>
>>> 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+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/22e4071c-f4e6-4b67-b63b-087db6fd2645n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/0a1d1bfc-0520-4d6b-943e-ca87ff344133n%40googlegroups.com.


Re: [web2py] Re: web2py 2.26.1 released

2023-10-30 Thread Christian Varas
In my opinion Web2py is really comfortable but I strongly recommend to move
to py4web.
The scheduler in web2py is replaced with celery which is more powerful and
py4web framework is really fast, light and is easy to code like in web2py.
I’ve moved all my apps from web2py to py4web and I can’t complain of the
results.
I totally recommend to move from web2py to py4web.

Greetings.
Chris

El El lun, 30 oct 2023 a la(s) 12:48, António Ramos 
escribió:

> I´m so comfortable with web2py, the admin dashboard and the scheduler are
> blocking me from moving to py4web...
> Regards
>
> Em seg., 30 de out. de 2023 às 04:48, Raul Monares 
> escreveu:
>
>> Great news. I appreatiate your work on both platforms
>>
>> On Sunday, October 29, 2023 at 3:13:31 PM UTC-6 Massimo Di Pierro wrote:
>>
>>> Changelog:
>>> - adds support of python up to version 3.11
>>> - fixes a bug with serialization of headers introduced in version 2.25.1
>>> - improves handling of unstable db connections in the scheduler
>>>
>>> I remind you that py4web has been out for 5 years now as successor of
>>> web2py.
>>> It has the same template language and dal as web2py but it is a lot
>>> faster.
>>> It has a better grid, form handling, and auth integrations.
>>>
>>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/22e4071c-f4e6-4b67-b63b-087db6fd2645n%40googlegroups.com
>> 
>> .
>>
> --
> 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/CAEM0BxO5q87Ec9AxmPkpjUxpMdA0xcDk0xAjnzdXCMVLgFb5vQ%40mail.gmail.com
> 
> .
>

-- 
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/CA%2Bs%2BuJsg8T5-4QuP1wbwS4U9h6KKL8vTDm22zxJaXMSn5tCzeA%40mail.gmail.com.


Re: [web2py] Re: web2py 2.26.1 released

2023-10-30 Thread António Ramos
I´m so comfortable with web2py, the admin dashboard and the scheduler are
blocking me from moving to py4web...
Regards

Em seg., 30 de out. de 2023 às 04:48, Raul Monares 
escreveu:

> Great news. I appreatiate your work on both platforms
>
> On Sunday, October 29, 2023 at 3:13:31 PM UTC-6 Massimo Di Pierro wrote:
>
>> Changelog:
>> - adds support of python up to version 3.11
>> - fixes a bug with serialization of headers introduced in version 2.25.1
>> - improves handling of unstable db connections in the scheduler
>>
>> I remind you that py4web has been out for 5 years now as successor of
>> web2py.
>> It has the same template language and dal as web2py but it is a lot
>> faster.
>> It has a better grid, form handling, and auth integrations.
>>
>> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/22e4071c-f4e6-4b67-b63b-087db6fd2645n%40googlegroups.com
> 
> .
>

-- 
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/CAEM0BxO5q87Ec9AxmPkpjUxpMdA0xcDk0xAjnzdXCMVLgFb5vQ%40mail.gmail.com.


Re: [web2py] Re: app not loading external python library

2023-10-27 Thread Al Ex
pip install urllib3_secure_extra

in my virtual env solved the problem.

Thank you Tom for pointing to the solution, I had missed that thread.


On October 27, 2023 at 16:59:18, Tom Clerckx (tcler...@gmail.com) wrote:

I think this is the same issue as was discussed a few months ago:
See this thread:
https://groups.google.com/g/web2py/c/xYVWpDGLuzY/m/t9sBabWOAgAJ

Seems some issue between the custom importer and the urllib3 module.
Can you  try once more, but also explicitly pip install *urllib3_secure_extra
*in your virtual env?




On Thursday, October 26, 2023 at 7:33:25 AM UTC+2 Massimo Di Pierro wrote:

> Hello Alex,
>
> thank for reporting this problem. Is it only occurring with web2py 2.25.1?
>
> On Monday, 23 October 2023 at 14:05:15 UTC-7 alex wrote:
>
>> Hi,
>>
>> I am running web2py Version 2.25.1-stable in virtualenv (python 3.9.5, it
>> happens also in python 3.10.10)
>>
>> After activating the virtualenv, I installed requests
>>
>> $ pip install request
>> $ pip show requests
>> Name: requests
>> Version: 2.31.0
>> Summary: Python HTTP for Humans.
>> Home-page: https://requests.readthedocs.io
>> Author: Kenneth Reitz
>> Author-email: m...@kennethreitz.org
>> License: Apache 2.0
>> Location:
>> /Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages
>> Requires: certifi, charset-normalizer, idna, urllib3
>> Required-by:
>>
>> Importing requests from bpython gives no errors.
>>
>> Importing requests in myapp gives an error.
>> I also tried with other external libraries, some of them do work, some
>> others cannot be imported.
>>
>> About this case, I have tried the following:
>>
>> In "web2py/applications/myapp/models/0.py":
>>
>> # - - - - - - - - - - - - - - -
>>
>> # added the virtualenv path to sys.path
>>
>> site_package_path =
>> "/Users/z/dev/web2py/.direnv/python-3.9/lib/python3.9/site-packages"
>>
>> if site_package_path not in sys.path:
>> sys.path.append(site_package_path)
>>
>> try:
>> import requests
>> except:
>> raise Exception('import error: "requests" not found')
>>
>>
>> # - - - - - - - - - - - - - - -
>>
>> I am running web2py with:
>>
>> $python web2py.py -a 'pwd'
>>
>> Error log:
>>
>> # - - - - - - - - - - - - - - -
>> Ticket ID
>> 127.0.0.1.2023-10-24.05-48-51.a557dcfb-55a3-4063-ac27-879cad8fe799
>>
>>  import error: "requests" not found
>> Version
>> web2py™ Version 2.25.1-stable+timestamp.2023.10.08.18.44.43
>> Python Python 3.9.5: /Users/z/dev/web2py/.direnv/python-3.9/bin/python
>> (prefix: /Users/z/dev/web2py/.direnv/python-3.9)
>>
>> ...
>>
>> Traceback (most recent call last):
>>   File "/Users/z/dev/web2py/gluon/custom_import.py", line 78, in
>> custom_importer
>> result = sys.modules[modules_prefix]
>> KeyError: 'applications.wh.modules.requests'
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "/Users/z/dev/web2py/applications/wh/models/0.py", line 29, in
>> 
>> import requests
>>   File "/Users/z/dev/web2py/gluon/custom_import.py", line 80, in
>> custom_importer
>> raise ImportError("No module named %s" % modules_prefix)
>> ImportError: No module named applications.wh.modules.requests
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "/Users/z/dev/web2py/gluon/restricted.py", line 219, in restricted
>> exec(ccode, environment)
>>   File "/Users/z/dev/web2py/applications/wh/models/0.py", line 31, in
>> 
>> raise Exception('import error: "requests" not found')
>> Exception: import error: "requests" not found
>> Error snapshot help
>> Exception(import error: "requests" not found)
>>
>> inspect attributes
>>
>> Exception instance attributes
>> __cause__ None
>> __class__ 
>> __context__ ImportError('No module named
>> applications.wh.modules.requests')
>> __delattr__ 
>> __dict__ {}
>> __dir__ 
>> __doc__ 'Common base class for all non-exit exceptions.'
>> __eq__ 
>> __format__ 
>> __ge__ 
>> __getattribute__ 
>> __gt__ 
>> __hash__ 
>> __init__ 
>> __init_subclass__ 
>> __le__ 
>> __lt__ 
>> __ne__ 
>> __new__ 
>> __reduce__ 
>> __reduce_ex__ 
>> __repr__ 
>> __setattr__ 
>> __setstate__ 
>> __sizeof__ 
>> __str__ 
>> __subclasshook__ 
>> __suppress_context__ False
>> __traceback__ 
>> args ('import error: "requests" not found',)
>> with_traceback 
>> Frames
>> File /Users/z/dev/web2py/gluon/restricted.py in restricted at line 219
>> code arguments variables
>>
>> File /Users/z/dev/web2py/applications/wh/models/0.py in  at line
>> 31 code arguments variables
>>
>> Function argument list
>> ()
>>
>> Context locals
>>
>> ...
>>
>>
>> 
>> iteritems :
>> >
>> local_import :
>> .>
>> myconf :
>> {'app': {'name': 'WH', 'author': 'Your Name > 'bootstrap3_inline', 'separator': ''}}
>> redirect :
>> 
>> reduce :
>> 
>> request :
>> ,
>> '_custom_import_track_changes': True}>
>> response :
>> > 'view': 'default/index.html'}>
>> session :
>> 
>> site_package_path :
>> 

Re: [web2py] Re: AssertionError: Header names/values must be of type str

2023-10-26 Thread Massimo DiPierro
Can you try once more?

On Wed, 25 Oct 2023 at 23:03, Al Ex  wrote:

> I tried with a new installation of web2py
>
> $ git clone --recursive https://github.com/web2py/web2py.git
>
>
> It gives the same error
>
> *
> ERROR:Rocket.Errors.Thread-11:Traceback (most recent call last):
>
>   File "/Users/z/Documents/web2py/gluon/rocket.py", line 1347, in run
> self.run_app(conn)
>
>   File "/Users/z/Documents/web2py/gluon/rocket.py", line 1865, in run_app
> output = self.app(environ, self.start_response)
>
>   File "/Users/z/Documents/web2py/gluon/main.py", line 688, in
> app_with_logging
> ret[0] = wsgiapp(environ, responder2)
>
>   File "/Users/z/Documents/web2py/gluon/main.py", line 600, in wsgibase
> return http_response.to(responder, env=env)
>
>   File "/Users/z/Documents/web2py/gluon/http.py", line 127, in to
> responder(status, rheaders)
>
>   File "/Users/z/Documents/web2py/gluon/main.py", line 683, in responder2
> return responder(s, h)
>
>   File "/Users/z/Documents/web2py/gluon/rocket.py", line 1827, in
> start_response
> self.header_set = Headers(response_headers)
>
>   File
> "/Users/z/.pyenv/versions/3.10.2/lib/python3.10/wsgiref/headers.py", line
> 39, in __init__
> self._convert_string_type(v)
>
>   File
> "/Users/z/.pyenv/versions/3.10.2/lib/python3.10/wsgiref/headers.py", line
> 45, in _convert_string_type
> raise AssertionError("Header names/values must be"
>
> AssertionError: Header names/values must be of type str (got 50)
>
> On October 26, 2023 at 14:43:28, Massimo Di Pierro (
> massimo.dipie...@gmail.com) wrote:
>
> I believe this is now fixed in master, thanks to Carlos' suggestion. Can
> you please give it a try?
>
> On Monday, 23 October 2023 at 13:30:34 UTC-7 alex wrote:
>
>> Hi, Running web2py in virtualenviroment (python 3.9.5, it happens also in
>> python 3.10.10)
>>
>> 
>>
>> ERROR:Rocket.Errors.Thread-3:Traceback (most recent call last):
>>
>>   File "/Users/z/dev/web2py/gluon/rocket.py", line 1294, in run
>> self.run_app(conn)
>>
>>   File "/Users/z/dev/web2py/gluon/rocket.py", line 1796, in run_app
>> output = self.app(environ, self.start_response)
>>
>>   File "/Users/z/dev/web2py/gluon/main.py", line 648, in app_with_logging
>> ret[0] = wsgiapp(environ, responder2)
>>
>>   File "/Users/z/dev/web2py/gluon/main.py", line 562, in wsgibase
>> return http_response.to(responder, env=env)
>>
>>   File "/Users/z/dev/web2py/gluon/http.py", line 129, in to
>> responder(status, rheaders)
>>
>>   File "/Users/z/dev/web2py/gluon/main.py", line 643, in responder2
>> return responder(s, h)
>>
>>   File "/Users/z/dev/web2py/gluon/rocket.py", line 1759, in start_response
>> self.header_set = Headers(response_headers)
>>
>>   File "/Users/z/.pyenv/versions/3.9.5/lib/python3.9/wsgiref/headers.py",
>> line 39, in __init__
>> self._convert_string_type(v)
>>
>>   File "/Users/z/.pyenv/versions/3.9.5/lib/python3.9/wsgiref/headers.py",
>> line 45, in _convert_string_type
>> raise AssertionError("Header names/values must be"
>>
>> AssertionError: Header names/values must be of type str (got 50)
>>
>> 
>> Any hints?
>> Thank you
>>
> --
> 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/2f971066-7e75-440e-80e0-cc132afacc93n%40googlegroups.com
> 
> .
>
>

-- 
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/CAJYrZrmV7wEAJKRKDQq%3DMwP31%3Dv_W2qg0-zp_tGMq5_OaJdhHA%40mail.gmail.com.


Re: [web2py] Re: uwsgi with web2py hard crash/locking with nginx

2023-10-17 Thread Christian Varas
While I can't provide a specific solution, it might be a better approach to
keep resource-intensive tasks separate from web2py, using a tool like
Celery. This way, these tasks can run in the background without impacting
the web server.

This is a small docx about how to put it together:
https://docs.google.com/document/d/1JXToOdSSeDlxV_ev2NYYPeVKtY8eJS2v/edit?usp=sharing=107281473670459955205=true=true

Greetings

El mar, 17 oct 2023 a las 4:43, Tom Clerckx () escribió:

> Maybe you should review the 'high calculation/high plotly' pages for
> memory usage?
> As the 'OOM killer' kicked in, it looks like the process is using too much
> memory.
>
> One thing to verify this is to monitor the VmRSS of the processes involved
> (VmRSS is one of the fields in the output when you do 'cat
> /proc//status')
> VmRSS gives you an idea about the amount of RAM memory your process is
> using.
>
> If it's growing out of proportion, you're claiming too much memory and the
> process will be killed by the OOM-killer.
>
>
> On Monday, October 16, 2023 at 8:15:20 PM UTC+2 lucas wrote:
>
>> hello one and all,
>>
>> i'm using web2py 2.25.1 with uwsgi 2.0.22 which was downloaded and
>> compiled using pip3 under python 3.10.12 under ubuntu 22.04.  the nginx is
>> apt installed version 1.18.
>>
>> with that being said, if i install and run my high calculation / high
>> plotly plot pages about 6 to 12 times, the whole damn system comes to a
>> crash.  hard crash.  this also seems to be the case under redhat / amazon
>> linux 2023 similar setup and config.
>>
>> so i tried crashing the system under just "python3 web2py.py -i 0.0.0.0
>> -p 80 --no_gui" and also under "uwsgi --http :80 --chdir
>> /opt/web2py_apps/web2py -w wsgihandler:application" but i could NOT get
>> either to crash.  it is only when i nginx daemon it with uwsgi and web2py
>> layered/socketed under nginx that it DOES crash hard.  i think i found
>> under the systemctl logs for uwsgi a logging of the crash, or:
>>
>> Oct 16 13:48:30 iquanta.info systemd[1]: uwsgi.service: A process of
>> this unit has been killed by the OOM killer.
>> Oct 16 13:48:30 iquanta.info uwsgi[1264]: [emperor] *** RAGNAROK EVOKED
>> ***
>> Oct 16 13:48:30 iquanta.info uwsgi[1265]: SIGINT/SIGTERM
>> received...killing workers...
>> Oct 16 13:48:30 iquanta.info uwsgi[1264]: Mon Oct 16 13:48:30 2023 -
>> [emperor] stop the uwsgi instance web2py.ini
>> Oct 16 13:48:30 iquanta.info uwsgi[1265]: Mon Oct 16 13:48:30 2023 -
>> received message 0 from emperor
>> Oct 16 13:48:31 iquanta.info uwsgi[1265]: worker 5 buried after 1 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 1 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 2 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 3 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: worker 4 buried after 2 seconds
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: goodbye to uWSGI.
>> Oct 16 13:48:32 iquanta.info uwsgi[1265]: VACUUM: unix socket
>> /run/uwsgi/web2py.sock removed.
>> Oct 16 13:48:33 iquanta.info uwsgi[1264]: Mon Oct 16 13:48:33 2023 -
>> [emperor] removed uwsgi instance web2py.ini
>> Oct 16 13:48:34 iquanta.info uwsgi[1264]: Mon Oct 16 13:48:34 2023 - The
>> Emperor is buried.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Failed with
>> result 'oom-kill'.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Consumed 10.241s
>> CPU time.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Scheduled
>> restart job, restart counter is at 1.
>> Oct 16 13:48:34 iquanta.info systemd[1]: Stopped uWSGI Emperor service.
>> Oct 16 13:48:34 iquanta.info systemd[1]: uwsgi.service: Consumed 10.241s
>> CPU time.
>>
>> with not much to say under the nginx logs.  so, does anyone know what i
>> can be dealing with?  thank you in advance, lucas
>>
> --
> 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/af50af3f-2764-4cbf-8bfd-06c802d0ff93n%40googlegroups.com
> 
> .
>

-- 
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 

Re: [web2py] Re: How do I query and display Authors and their respective books

2023-10-11 Thread Sh. Moiz Sh. Husain Bhai Nagpurwala
Thanks for the reply.

It addresses my question.
Thanks and Regards.

On Wed, 11 Oct 2023, 12:27 Clemens, 
wrote:

> Hello,
>
> all you need to know (including examples) is described here:
>
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#One-to-many-relation
>
> On Wednesday, October 11, 2023 at 6:11:38 AM UTC+2 Moiz Nagpurwala wrote:
>
>> Hello,
>>
>> I have 2 tables in my database, one for Author and another for Book.
>>
>> I want to display all Author names as H2 and below each Author I want to
>> display the books for that Author.
>> Please suggest the query and html view code for above scenario.
>>
>> Thanks and regards.
>>
> --
> 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/-cmZSHG2vMM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/130043d0-2147-45ca-8e4f-39b276026e8bn%40googlegroups.com
> 
> .
>

-- 
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/CALw6JRnffDsr9pBS7e%2B%3DVwdyc6EHUcR408dt9zLr6ciECMfoqg%40mail.gmail.com.


Re: [web2py] Re: administrator login with 2fa

2023-09-03 Thread Clemens
Well, having a method reporting problems is great. My solution is primarily 
pragmatic: In case move the controllers in and analyse otherwise having 
them out of access.

After migrating to py4web I will think of such error mailing controller, 
sounds interesting.

On Friday, September 1, 2023 at 8:07:11 PM UTC+2 Jim S wrote:

> And to second your comment, I too have a controller method that allows 
> users with the proper access, the ability to add additional users.
>
> The only other reason I would want to access admin is to look at error 
> messages/tickets.  But, I have some method in place to read the error 
> messages and forward them to me in an email.
>
>
> -Jim
>
>
>
> On Friday, September 1, 2023 at 1:04:47 PM UTC-5 Jim S wrote:
>
>> If I try to go to admin/appadmin web2py returns:
>>
>> Admin is disabled because insecure channel
>>
>> Isn't that just the default behavior?
>>
>> -Jim
>>
>> On Friday, September 1, 2023 at 1:00:08 PM UTC-5 Clemens wrote:
>>
>>> I don't and I that's why I (re)move these to a hidden folder on system 
>>> level :-) What I need is to give customers the option to add new users by 
>>> themselves. For that I've written a small controller under the control of 
>>> 2FA and so on.
>>>
>>> Regards
>>> Clemens
>>>
>>>
>>> On Friday, September 1, 2023 at 7:40:19 PM UTC+2 Jim S wrote:
>>>
 I'm just curious

 Why do you need access to the admin/appadmin apps in a production 
 environment?

 I've never used them there.  I use in development, but never production

 -Jim


 On Friday, September 1, 2023 at 11:54:02 AM UTC-5 Clemens wrote:

> Removing the admin app as well as the appadmin controllers should kill 
> all options of administration. Move these to two to a folder away from 
> web2py. And then you can still call https://.../admin/site or 
> https://.../appadmin?
>
> On Friday, September 1, 2023 at 6:44:31 PM UTC+2 Ramos wrote:
>
>> yes i tried it on the admin app and it just does not work.
>> :)
>>
>>
>> Em sex., 1 de set. de 2023 às 16:53, Jim S  
>> escreveu:
>>
>>> So, are you trying to protect the 'admin' application with 2fa?
>>>
>>> If so, can you add the 2fa code to the admin app?
>>>
>>> I haven't tried this before
>>>
>>> On Friday, September 1, 2023 at 10:24:29 AM UTC-5 Ramos wrote:
>>>
 this admin

 https://mysite.com/admin

 Em sex., 1 de set. de 2023 às 16:08, Jim S  
 escreveu:

> What does 'administrator password' mean to you?
>
> I'm not sure what you're referring to
>
> -Jim
>
> On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:
>
>> Hello Jim 
>> this line of code 
>> *auth.settings.auth_two_factor_enabled = True*
>> *does not protect the administrator password. Only created users.*
>> *That is my question, how to force administrator to use 2fa ?*
>> *regards*
>> *António*
>>
>> Em sex., 1 de set. de 2023 às 15:00, Jim S  
>> escreveu:
>>
>>> Here is the code I wrote that only enforced 2fa for users 
>>> outside our local networks.
>>>
>>> There is some commented out code there that additionally allowed 
>>> me to specify users in a group so only that group was force to 2fa
>>>
>>> def _two_factor_required(auth_user):
>>> """
>>> check whether we need to enforce MFA on this login
>>>
>>>We enforce MFA only on logins external to our network.
>>>
>>> Returns
>>> ---
>>> bool - enforce MFA
>>> - True means this login requires MFA
>>> - False means we will not enforce MFA for this login
>>> """
>>> import ipaddress
>>>
>>> return False  #  temp use to disable mfa
>>>
>>> if len(request.args) > 0 and request.args[0] == "login":
>>> if auth_user.mfa_override and datetime.datetime.now() <= 
>>> auth_user.mfa_override:
>>> #  no mfa required if the user override is set   - 
>>> we added a field in auth_user to allow us to override if a user was 
>>> having 
>>> trouble or lost their phone or something
>>> return False
>>>
>>> qlf_networks = [
>>> "9.9.9.9/22",
>>> "9.9.9.0/24",
>>> "9.9.9.101/24",
>>> ]
>>>
>>> ip_list = []
>>> for range in qlf_networks:
>>> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>>>
>>> if ipaddress.IPv4Address(unicode(request.client)) in 
>>> ip_list:
>>> 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread Jim S
And to second your comment, I too have a controller method that allows 
users with the proper access, the ability to add additional users.

The only other reason I would want to access admin is to look at error 
messages/tickets.  But, I have some method in place to read the error 
messages and forward them to me in an email.


-Jim



On Friday, September 1, 2023 at 1:04:47 PM UTC-5 Jim S wrote:

> If I try to go to admin/appadmin web2py returns:
>
> Admin is disabled because insecure channel
>
> Isn't that just the default behavior?
>
> -Jim
>
> On Friday, September 1, 2023 at 1:00:08 PM UTC-5 Clemens wrote:
>
>> I don't and I that's why I (re)move these to a hidden folder on system 
>> level :-) What I need is to give customers the option to add new users by 
>> themselves. For that I've written a small controller under the control of 
>> 2FA and so on.
>>
>> Regards
>> Clemens
>>
>>
>> On Friday, September 1, 2023 at 7:40:19 PM UTC+2 Jim S wrote:
>>
>>> I'm just curious
>>>
>>> Why do you need access to the admin/appadmin apps in a production 
>>> environment?
>>>
>>> I've never used them there.  I use in development, but never production
>>>
>>> -Jim
>>>
>>>
>>> On Friday, September 1, 2023 at 11:54:02 AM UTC-5 Clemens wrote:
>>>
 Removing the admin app as well as the appadmin controllers should kill 
 all options of administration. Move these to two to a folder away from 
 web2py. And then you can still call https://.../admin/site or 
 https://.../appadmin?

 On Friday, September 1, 2023 at 6:44:31 PM UTC+2 Ramos wrote:

> yes i tried it on the admin app and it just does not work.
> :)
>
>
> Em sex., 1 de set. de 2023 às 16:53, Jim S  
> escreveu:
>
>> So, are you trying to protect the 'admin' application with 2fa?
>>
>> If so, can you add the 2fa code to the admin app?
>>
>> I haven't tried this before
>>
>> On Friday, September 1, 2023 at 10:24:29 AM UTC-5 Ramos wrote:
>>
>>> this admin
>>>
>>> https://mysite.com/admin
>>>
>>> Em sex., 1 de set. de 2023 às 16:08, Jim S  
>>> escreveu:
>>>
 What does 'administrator password' mean to you?

 I'm not sure what you're referring to

 -Jim

 On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:

> Hello Jim 
> this line of code 
> *auth.settings.auth_two_factor_enabled = True*
> *does not protect the administrator password. Only created users.*
> *That is my question, how to force administrator to use 2fa ?*
> *regards*
> *António*
>
> Em sex., 1 de set. de 2023 às 15:00, Jim S  
> escreveu:
>
>> Here is the code I wrote that only enforced 2fa for users outside 
>> our local networks.
>>
>> There is some commented out code there that additionally allowed 
>> me to specify users in a group so only that group was force to 2fa
>>
>> def _two_factor_required(auth_user):
>> """
>> check whether we need to enforce MFA on this login
>>
>>We enforce MFA only on logins external to our network.
>>
>> Returns
>> ---
>> bool - enforce MFA
>> - True means this login requires MFA
>> - False means we will not enforce MFA for this login
>> """
>> import ipaddress
>>
>> return False  #  temp use to disable mfa
>>
>> if len(request.args) > 0 and request.args[0] == "login":
>> if auth_user.mfa_override and datetime.datetime.now() <= 
>> auth_user.mfa_override:
>> #  no mfa required if the user override is set   - we 
>> added a field in auth_user to allow us to override if a user was 
>> having 
>> trouble or lost their phone or something
>> return False
>>
>> qlf_networks = [
>> "9.9.9.9/22",
>> "9.9.9.0/24",
>> "9.9.9.101/24",
>> ]
>>
>> ip_list = []
>> for range in qlf_networks:
>> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>>
>> if ipaddress.IPv4Address(unicode(request.client)) in 
>> ip_list:
>> #  if the client address is in the local address 
>> list, then do NOT require MFA so set to False
>> return_value = False
>>
>> #  build the MFA Required group members
>> # if return_value:
>> # print(datetime.datetime.now())
>> # ag = db(db.auth_group.role == "MFA Required 
>> (web2py)").select().first()
>> # if not ag:

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread Jim S
If I try to go to admin/appadmin web2py returns:

Admin is disabled because insecure channel

Isn't that just the default behavior?

-Jim

On Friday, September 1, 2023 at 1:00:08 PM UTC-5 Clemens wrote:

> I don't and I that's why I (re)move these to a hidden folder on system 
> level :-) What I need is to give customers the option to add new users by 
> themselves. For that I've written a small controller under the control of 
> 2FA and so on.
>
> Regards
> Clemens
>
>
> On Friday, September 1, 2023 at 7:40:19 PM UTC+2 Jim S wrote:
>
>> I'm just curious
>>
>> Why do you need access to the admin/appadmin apps in a production 
>> environment?
>>
>> I've never used them there.  I use in development, but never production
>>
>> -Jim
>>
>>
>> On Friday, September 1, 2023 at 11:54:02 AM UTC-5 Clemens wrote:
>>
>>> Removing the admin app as well as the appadmin controllers should kill 
>>> all options of administration. Move these to two to a folder away from 
>>> web2py. And then you can still call https://.../admin/site or 
>>> https://.../appadmin?
>>>
>>> On Friday, September 1, 2023 at 6:44:31 PM UTC+2 Ramos wrote:
>>>
 yes i tried it on the admin app and it just does not work.
 :)


 Em sex., 1 de set. de 2023 às 16:53, Jim S  
 escreveu:

> So, are you trying to protect the 'admin' application with 2fa?
>
> If so, can you add the 2fa code to the admin app?
>
> I haven't tried this before
>
> On Friday, September 1, 2023 at 10:24:29 AM UTC-5 Ramos wrote:
>
>> this admin
>>
>> https://mysite.com/admin
>>
>> Em sex., 1 de set. de 2023 às 16:08, Jim S  
>> escreveu:
>>
>>> What does 'administrator password' mean to you?
>>>
>>> I'm not sure what you're referring to
>>>
>>> -Jim
>>>
>>> On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:
>>>
 Hello Jim 
 this line of code 
 *auth.settings.auth_two_factor_enabled = True*
 *does not protect the administrator password. Only created users.*
 *That is my question, how to force administrator to use 2fa ?*
 *regards*
 *António*

 Em sex., 1 de set. de 2023 às 15:00, Jim S  
 escreveu:

> Here is the code I wrote that only enforced 2fa for users outside 
> our local networks.
>
> There is some commented out code there that additionally allowed 
> me to specify users in a group so only that group was force to 2fa
>
> def _two_factor_required(auth_user):
> """
> check whether we need to enforce MFA on this login
>
>We enforce MFA only on logins external to our network.
>
> Returns
> ---
> bool - enforce MFA
> - True means this login requires MFA
> - False means we will not enforce MFA for this login
> """
> import ipaddress
>
> return False  #  temp use to disable mfa
>
> if len(request.args) > 0 and request.args[0] == "login":
> if auth_user.mfa_override and datetime.datetime.now() <= 
> auth_user.mfa_override:
> #  no mfa required if the user override is set   - we 
> added a field in auth_user to allow us to override if a user was 
> having 
> trouble or lost their phone or something
> return False
>
> qlf_networks = [
> "9.9.9.9/22",
> "9.9.9.0/24",
> "9.9.9.101/24",
> ]
>
> ip_list = []
> for range in qlf_networks:
> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>
> if ipaddress.IPv4Address(unicode(request.client)) in 
> ip_list:
> #  if the client address is in the local address list, 
> then do NOT require MFA so set to False
> return_value = False
>
> #  build the MFA Required group members
> # if return_value:
> # print(datetime.datetime.now())
> # ag = db(db.auth_group.role == "MFA Required 
> (web2py)").select().first()
> # if not ag:
> # ag = db.auth_group.insert("MFA Required 
> (web2py)")
> # for ou in db(
> # (db.auth_user.active == True)
> # | (
> # (db.auth_user.mfa_override == None)
> # & (db.auth_user.mfa_override <= 
> datetime.datetime.now())
> # )
> # ).select():
> # db.auth_membership.update_or_insert(user_id=
> ou.id, 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread Clemens
I don't and I that's why I (re)move these to a hidden folder on system 
level :-) What I need is to give customers the option to add new users by 
themselves. For that I've written a small controller under the control of 
2FA and so on.

Regards
Clemens


On Friday, September 1, 2023 at 7:40:19 PM UTC+2 Jim S wrote:

> I'm just curious
>
> Why do you need access to the admin/appadmin apps in a production 
> environment?
>
> I've never used them there.  I use in development, but never production
>
> -Jim
>
>
> On Friday, September 1, 2023 at 11:54:02 AM UTC-5 Clemens wrote:
>
>> Removing the admin app as well as the appadmin controllers should kill 
>> all options of administration. Move these to two to a folder away from 
>> web2py. And then you can still call https://.../admin/site or 
>> https://.../appadmin?
>>
>> On Friday, September 1, 2023 at 6:44:31 PM UTC+2 Ramos wrote:
>>
>>> yes i tried it on the admin app and it just does not work.
>>> :)
>>>
>>>
>>> Em sex., 1 de set. de 2023 às 16:53, Jim S  escreveu:
>>>
 So, are you trying to protect the 'admin' application with 2fa?

 If so, can you add the 2fa code to the admin app?

 I haven't tried this before

 On Friday, September 1, 2023 at 10:24:29 AM UTC-5 Ramos wrote:

> this admin
>
> https://mysite.com/admin
>
> Em sex., 1 de set. de 2023 às 16:08, Jim S  
> escreveu:
>
>> What does 'administrator password' mean to you?
>>
>> I'm not sure what you're referring to
>>
>> -Jim
>>
>> On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:
>>
>>> Hello Jim 
>>> this line of code 
>>> *auth.settings.auth_two_factor_enabled = True*
>>> *does not protect the administrator password. Only created users.*
>>> *That is my question, how to force administrator to use 2fa ?*
>>> *regards*
>>> *António*
>>>
>>> Em sex., 1 de set. de 2023 às 15:00, Jim S  
>>> escreveu:
>>>
 Here is the code I wrote that only enforced 2fa for users outside 
 our local networks.

 There is some commented out code there that additionally allowed me 
 to specify users in a group so only that group was force to 2fa

 def _two_factor_required(auth_user):
 """
 check whether we need to enforce MFA on this login

We enforce MFA only on logins external to our network.

 Returns
 ---
 bool - enforce MFA
 - True means this login requires MFA
 - False means we will not enforce MFA for this login
 """
 import ipaddress

 return False  #  temp use to disable mfa

 if len(request.args) > 0 and request.args[0] == "login":
 if auth_user.mfa_override and datetime.datetime.now() <= 
 auth_user.mfa_override:
 #  no mfa required if the user override is set   - we 
 added a field in auth_user to allow us to override if a user was 
 having 
 trouble or lost their phone or something
 return False

 qlf_networks = [
 "9.9.9.9/22",
 "9.9.9.0/24",
 "9.9.9.101/24",
 ]

 ip_list = []
 for range in qlf_networks:
 ip_list.extend(ipaddress.IPv4Network(unicode(range)))

 if ipaddress.IPv4Address(unicode(request.client)) in 
 ip_list:
 #  if the client address is in the local address list, 
 then do NOT require MFA so set to False
 return_value = False

 #  build the MFA Required group members
 # if return_value:
 # print(datetime.datetime.now())
 # ag = db(db.auth_group.role == "MFA Required 
 (web2py)").select().first()
 # if not ag:
 # ag = db.auth_group.insert("MFA Required (web2py)")
 # for ou in db(
 # (db.auth_user.active == True)
 # | (
 # (db.auth_user.mfa_override == None)
 # & (db.auth_user.mfa_override <= 
 datetime.datetime.now())
 # )
 # ).select():
 # db.auth_membership.update_or_insert(user_id=ou.id, 
 group_id=ag)
 #
 # #  clear out any members that are currently exempt 
 from MFA
 # if ag:
 # for exempt_user in db(
 # (db.auth_user.mfa_override >= 
 datetime.datetime.now())
 # & (db.auth_user.active == True)

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread Jim S
I'm just curious

Why do you need access to the admin/appadmin apps in a production 
environment?

I've never used them there.  I use in development, but never production

-Jim


On Friday, September 1, 2023 at 11:54:02 AM UTC-5 Clemens wrote:

> Removing the admin app as well as the appadmin controllers should kill all 
> options of administration. Move these to two to a folder away from web2py. 
> And then you can still call https://.../admin/site or https://.../appadmin?
>
> On Friday, September 1, 2023 at 6:44:31 PM UTC+2 Ramos wrote:
>
>> yes i tried it on the admin app and it just does not work.
>> :)
>>
>>
>> Em sex., 1 de set. de 2023 às 16:53, Jim S  escreveu:
>>
>>> So, are you trying to protect the 'admin' application with 2fa?
>>>
>>> If so, can you add the 2fa code to the admin app?
>>>
>>> I haven't tried this before
>>>
>>> On Friday, September 1, 2023 at 10:24:29 AM UTC-5 Ramos wrote:
>>>
 this admin

 https://mysite.com/admin

 Em sex., 1 de set. de 2023 às 16:08, Jim S  
 escreveu:

> What does 'administrator password' mean to you?
>
> I'm not sure what you're referring to
>
> -Jim
>
> On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:
>
>> Hello Jim 
>> this line of code 
>> *auth.settings.auth_two_factor_enabled = True*
>> *does not protect the administrator password. Only created users.*
>> *That is my question, how to force administrator to use 2fa ?*
>> *regards*
>> *António*
>>
>> Em sex., 1 de set. de 2023 às 15:00, Jim S  
>> escreveu:
>>
>>> Here is the code I wrote that only enforced 2fa for users outside 
>>> our local networks.
>>>
>>> There is some commented out code there that additionally allowed me 
>>> to specify users in a group so only that group was force to 2fa
>>>
>>> def _two_factor_required(auth_user):
>>> """
>>> check whether we need to enforce MFA on this login
>>>
>>>We enforce MFA only on logins external to our network.
>>>
>>> Returns
>>> ---
>>> bool - enforce MFA
>>> - True means this login requires MFA
>>> - False means we will not enforce MFA for this login
>>> """
>>> import ipaddress
>>>
>>> return False  #  temp use to disable mfa
>>>
>>> if len(request.args) > 0 and request.args[0] == "login":
>>> if auth_user.mfa_override and datetime.datetime.now() <= 
>>> auth_user.mfa_override:
>>> #  no mfa required if the user override is set   - we 
>>> added a field in auth_user to allow us to override if a user was having 
>>> trouble or lost their phone or something
>>> return False
>>>
>>> qlf_networks = [
>>> "9.9.9.9/22",
>>> "9.9.9.0/24",
>>> "9.9.9.101/24",
>>> ]
>>>
>>> ip_list = []
>>> for range in qlf_networks:
>>> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>>>
>>> if ipaddress.IPv4Address(unicode(request.client)) in ip_list:
>>> #  if the client address is in the local address list, 
>>> then do NOT require MFA so set to False
>>> return_value = False
>>>
>>> #  build the MFA Required group members
>>> # if return_value:
>>> # print(datetime.datetime.now())
>>> # ag = db(db.auth_group.role == "MFA Required 
>>> (web2py)").select().first()
>>> # if not ag:
>>> # ag = db.auth_group.insert("MFA Required (web2py)")
>>> # for ou in db(
>>> # (db.auth_user.active == True)
>>> # | (
>>> # (db.auth_user.mfa_override == None)
>>> # & (db.auth_user.mfa_override <= 
>>> datetime.datetime.now())
>>> # )
>>> # ).select():
>>> # db.auth_membership.update_or_insert(user_id=ou.id, 
>>> group_id=ag)
>>> #
>>> # #  clear out any members that are currently exempt 
>>> from MFA
>>> # if ag:
>>> # for exempt_user in db(
>>> # (db.auth_user.mfa_override >= 
>>> datetime.datetime.now())
>>> # & (db.auth_user.active == True)
>>> # ).select():
>>> # db(
>>> # (db.auth_membership.group_id == ag.id)
>>> # & (db.auth_membership.user_id == 
>>> exempt_user.id)
>>> # ).delete()
>>> # db.commit()
>>> #
>>> # print(datetime.datetime.now())
>>> #
>>> # #  set to False to force web2py to check the 
>>> 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread Clemens
Removing the admin app as well as the appadmin controllers should kill all 
options of administration. Move these to two to a folder away from web2py. 
And then you can still call https://.../admin/site or https://.../appadmin?

On Friday, September 1, 2023 at 6:44:31 PM UTC+2 Ramos wrote:

> yes i tried it on the admin app and it just does not work.
> :)
>
>
> Em sex., 1 de set. de 2023 às 16:53, Jim S  escreveu:
>
>> So, are you trying to protect the 'admin' application with 2fa?
>>
>> If so, can you add the 2fa code to the admin app?
>>
>> I haven't tried this before
>>
>> On Friday, September 1, 2023 at 10:24:29 AM UTC-5 Ramos wrote:
>>
>>> this admin
>>>
>>> https://mysite.com/admin
>>>
>>> Em sex., 1 de set. de 2023 às 16:08, Jim S  escreveu:
>>>
 What does 'administrator password' mean to you?

 I'm not sure what you're referring to

 -Jim

 On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:

> Hello Jim 
> this line of code 
> *auth.settings.auth_two_factor_enabled = True*
> *does not protect the administrator password. Only created users.*
> *That is my question, how to force administrator to use 2fa ?*
> *regards*
> *António*
>
> Em sex., 1 de set. de 2023 às 15:00, Jim S  
> escreveu:
>
>> Here is the code I wrote that only enforced 2fa for users outside our 
>> local networks.
>>
>> There is some commented out code there that additionally allowed me 
>> to specify users in a group so only that group was force to 2fa
>>
>> def _two_factor_required(auth_user):
>> """
>> check whether we need to enforce MFA on this login
>>
>>We enforce MFA only on logins external to our network.
>>
>> Returns
>> ---
>> bool - enforce MFA
>> - True means this login requires MFA
>> - False means we will not enforce MFA for this login
>> """
>> import ipaddress
>>
>> return False  #  temp use to disable mfa
>>
>> if len(request.args) > 0 and request.args[0] == "login":
>> if auth_user.mfa_override and datetime.datetime.now() <= 
>> auth_user.mfa_override:
>> #  no mfa required if the user override is set   - we 
>> added a field in auth_user to allow us to override if a user was having 
>> trouble or lost their phone or something
>> return False
>>
>> qlf_networks = [
>> "9.9.9.9/22",
>> "9.9.9.0/24",
>> "9.9.9.101/24",
>> ]
>>
>> ip_list = []
>> for range in qlf_networks:
>> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>>
>> if ipaddress.IPv4Address(unicode(request.client)) in ip_list:
>> #  if the client address is in the local address list, 
>> then do NOT require MFA so set to False
>> return_value = False
>>
>> #  build the MFA Required group members
>> # if return_value:
>> # print(datetime.datetime.now())
>> # ag = db(db.auth_group.role == "MFA Required 
>> (web2py)").select().first()
>> # if not ag:
>> # ag = db.auth_group.insert("MFA Required (web2py)")
>> # for ou in db(
>> # (db.auth_user.active == True)
>> # | (
>> # (db.auth_user.mfa_override == None)
>> # & (db.auth_user.mfa_override <= 
>> datetime.datetime.now())
>> # )
>> # ).select():
>> # db.auth_membership.update_or_insert(user_id=ou.id, 
>> group_id=ag)
>> #
>> # #  clear out any members that are currently exempt from 
>> MFA
>> # if ag:
>> # for exempt_user in db(
>> # (db.auth_user.mfa_override >= 
>> datetime.datetime.now())
>> # & (db.auth_user.active == True)
>> # ).select():
>> # db(
>> # (db.auth_membership.group_id == ag.id)
>> # & (db.auth_membership.user_id == 
>> exempt_user.id)
>> # ).delete()
>> # db.commit()
>> #
>> # print(datetime.datetime.now())
>> #
>> # #  set to False to force web2py to check the 
>> two_factor_authentication  group
>> # return_value = False
>>
>> That code is in db.py
>>
>> Then
>>
>> auth.settings.auth_two_factor_enabled = lambda user: 
>> _two_factor_required(user)
>> auth.messages.two_factor_comment = "QLF MFA - you have been sent a 
>> code"
>> auth.settings.two_factor_methods = [
>> 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread António Ramos
yes i tried it on the admin app and it just does not work.
:)


Em sex., 1 de set. de 2023 às 16:53, Jim S  escreveu:

> So, are you trying to protect the 'admin' application with 2fa?
>
> If so, can you add the 2fa code to the admin app?
>
> I haven't tried this before
>
> On Friday, September 1, 2023 at 10:24:29 AM UTC-5 Ramos wrote:
>
>> this admin
>>
>> https://mysite.com/admin
>>
>> Em sex., 1 de set. de 2023 às 16:08, Jim S  escreveu:
>>
>>> What does 'administrator password' mean to you?
>>>
>>> I'm not sure what you're referring to
>>>
>>> -Jim
>>>
>>> On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:
>>>
 Hello Jim
 this line of code
 *auth.settings.auth_two_factor_enabled = True*
 *does not protect the administrator password. Only created users.*
 *That is my question, how to force administrator to use 2fa ?*
 *regards*
 *António*

 Em sex., 1 de set. de 2023 às 15:00, Jim S 
 escreveu:

> Here is the code I wrote that only enforced 2fa for users outside our
> local networks.
>
> There is some commented out code there that additionally allowed me to
> specify users in a group so only that group was force to 2fa
>
> def _two_factor_required(auth_user):
> """
> check whether we need to enforce MFA on this login
>
>We enforce MFA only on logins external to our network.
>
> Returns
> ---
> bool - enforce MFA
> - True means this login requires MFA
> - False means we will not enforce MFA for this login
> """
> import ipaddress
>
> return False  #  temp use to disable mfa
>
> if len(request.args) > 0 and request.args[0] == "login":
> if auth_user.mfa_override and datetime.datetime.now() <=
> auth_user.mfa_override:
> #  no mfa required if the user override is set   - we
> added a field in auth_user to allow us to override if a user was having
> trouble or lost their phone or something
> return False
>
> qlf_networks = [
> "9.9.9.9/22",
> "9.9.9.0/24",
> "9.9.9.101/24",
> ]
>
> ip_list = []
> for range in qlf_networks:
> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>
> if ipaddress.IPv4Address(unicode(request.client)) in ip_list:
> #  if the client address is in the local address list,
> then do NOT require MFA so set to False
> return_value = False
>
> #  build the MFA Required group members
> # if return_value:
> # print(datetime.datetime.now())
> # ag = db(db.auth_group.role == "MFA Required
> (web2py)").select().first()
> # if not ag:
> # ag = db.auth_group.insert("MFA Required (web2py)")
> # for ou in db(
> # (db.auth_user.active == True)
> # | (
> # (db.auth_user.mfa_override == None)
> # & (db.auth_user.mfa_override <=
> datetime.datetime.now())
> # )
> # ).select():
> # db.auth_membership.update_or_insert(user_id=ou.id,
> group_id=ag)
> #
> # #  clear out any members that are currently exempt from
> MFA
> # if ag:
> # for exempt_user in db(
> # (db.auth_user.mfa_override >=
> datetime.datetime.now())
> # & (db.auth_user.active == True)
> # ).select():
> # db(
> # (db.auth_membership.group_id == ag.id)
> # & (db.auth_membership.user_id ==
> exempt_user.id)
> # ).delete()
> # db.commit()
> #
> # print(datetime.datetime.now())
> #
> # #  set to False to force web2py to check the
> two_factor_authentication  group
> # return_value = False
>
> That code is in db.py
>
> Then
>
> auth.settings.auth_two_factor_enabled = lambda user:
> _two_factor_required(user)
> auth.messages.two_factor_comment = "QLF MFA - you have been sent a
> code"
> auth.settings.two_factor_methods = [
> lambda user, auth_two_factor: _send_sms(user, auth_two_factor)
> ]
>
> My _send_sms code built and sms and sent it via Twilio or RingCentral
>
> I wrote this code, but then we ended up not implementing.  The web2py
> code is going away for us.  All the same concepts work in py4web (nudge
> wink wink)
>
> -Jim
>
>
>
> On Friday, September 1, 2023 at 5:24:53 AM UTC-5 Ramos wrote:
>
>> 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread Clemens
Sorry for not answering any earlier - too much work. Well, in my 
application (which is in production) I've solved the problem as follows: 
I've written a controller fully under my control (including 2FA and groups) 
with just the administration functions I need (users, groups and a rights 
system on the business objects of my application). On all productive 
instances (compiled) I've just moved the controllers of appadmin 
(controllers.appadmin.* ) as well as the admin app to a hidden folder - if 
needed I can move them back.

That's how it works for me. If your interested in this solution, just say 
"sounds interesting to me ;-)" and we can have a further conversation on 
the details.

@Jim: Good to see, that your still in. My plan is to move in 2024 to py4web 
and have more contact to the community again. web2py is getting more and 
more a lonely path ;-)

Regards from Germany
Clemens

On Friday, September 1, 2023 at 5:53:34 PM UTC+2 Jim S wrote:

> So, are you trying to protect the 'admin' application with 2fa?
>
> If so, can you add the 2fa code to the admin app?
>
> I haven't tried this before
>
> On Friday, September 1, 2023 at 10:24:29 AM UTC-5 Ramos wrote:
>
>> this admin
>>
>> https://mysite.com/admin
>>
>> Em sex., 1 de set. de 2023 às 16:08, Jim S  escreveu:
>>
>>> What does 'administrator password' mean to you?
>>>
>>> I'm not sure what you're referring to
>>>
>>> -Jim
>>>
>>> On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:
>>>
 Hello Jim 
 this line of code 
 *auth.settings.auth_two_factor_enabled = True*
 *does not protect the administrator password. Only created users.*
 *That is my question, how to force administrator to use 2fa ?*
 *regards*
 *António*

 Em sex., 1 de set. de 2023 às 15:00, Jim S  
 escreveu:

> Here is the code I wrote that only enforced 2fa for users outside our 
> local networks.
>
> There is some commented out code there that additionally allowed me to 
> specify users in a group so only that group was force to 2fa
>
> def _two_factor_required(auth_user):
> """
> check whether we need to enforce MFA on this login
>
>We enforce MFA only on logins external to our network.
>
> Returns
> ---
> bool - enforce MFA
> - True means this login requires MFA
> - False means we will not enforce MFA for this login
> """
> import ipaddress
>
> return False  #  temp use to disable mfa
>
> if len(request.args) > 0 and request.args[0] == "login":
> if auth_user.mfa_override and datetime.datetime.now() <= 
> auth_user.mfa_override:
> #  no mfa required if the user override is set   - we 
> added a field in auth_user to allow us to override if a user was having 
> trouble or lost their phone or something
> return False
>
> qlf_networks = [
> "9.9.9.9/22",
> "9.9.9.0/24",
> "9.9.9.101/24",
> ]
>
> ip_list = []
> for range in qlf_networks:
> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>
> if ipaddress.IPv4Address(unicode(request.client)) in ip_list:
> #  if the client address is in the local address list, 
> then do NOT require MFA so set to False
> return_value = False
>
> #  build the MFA Required group members
> # if return_value:
> # print(datetime.datetime.now())
> # ag = db(db.auth_group.role == "MFA Required 
> (web2py)").select().first()
> # if not ag:
> # ag = db.auth_group.insert("MFA Required (web2py)")
> # for ou in db(
> # (db.auth_user.active == True)
> # | (
> # (db.auth_user.mfa_override == None)
> # & (db.auth_user.mfa_override <= 
> datetime.datetime.now())
> # )
> # ).select():
> # db.auth_membership.update_or_insert(user_id=ou.id, 
> group_id=ag)
> #
> # #  clear out any members that are currently exempt from 
> MFA
> # if ag:
> # for exempt_user in db(
> # (db.auth_user.mfa_override >= 
> datetime.datetime.now())
> # & (db.auth_user.active == True)
> # ).select():
> # db(
> # (db.auth_membership.group_id == ag.id)
> # & (db.auth_membership.user_id == 
> exempt_user.id)
> # ).delete()
> # db.commit()
> #
> # print(datetime.datetime.now())
> #
> # #  set 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread Jim S
So, are you trying to protect the 'admin' application with 2fa?

If so, can you add the 2fa code to the admin app?

I haven't tried this before

On Friday, September 1, 2023 at 10:24:29 AM UTC-5 Ramos wrote:

> this admin
>
> https://mysite.com/admin
>
> Em sex., 1 de set. de 2023 às 16:08, Jim S  escreveu:
>
>> What does 'administrator password' mean to you?
>>
>> I'm not sure what you're referring to
>>
>> -Jim
>>
>> On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:
>>
>>> Hello Jim 
>>> this line of code 
>>> *auth.settings.auth_two_factor_enabled = True*
>>> *does not protect the administrator password. Only created users.*
>>> *That is my question, how to force administrator to use 2fa ?*
>>> *regards*
>>> *António*
>>>
>>> Em sex., 1 de set. de 2023 às 15:00, Jim S  escreveu:
>>>
 Here is the code I wrote that only enforced 2fa for users outside our 
 local networks.

 There is some commented out code there that additionally allowed me to 
 specify users in a group so only that group was force to 2fa

 def _two_factor_required(auth_user):
 """
 check whether we need to enforce MFA on this login

We enforce MFA only on logins external to our network.

 Returns
 ---
 bool - enforce MFA
 - True means this login requires MFA
 - False means we will not enforce MFA for this login
 """
 import ipaddress

 return False  #  temp use to disable mfa

 if len(request.args) > 0 and request.args[0] == "login":
 if auth_user.mfa_override and datetime.datetime.now() <= 
 auth_user.mfa_override:
 #  no mfa required if the user override is set   - we added 
 a field in auth_user to allow us to override if a user was having trouble 
 or lost their phone or something
 return False

 qlf_networks = [
 "9.9.9.9/22",
 "9.9.9.0/24",
 "9.9.9.101/24",
 ]

 ip_list = []
 for range in qlf_networks:
 ip_list.extend(ipaddress.IPv4Network(unicode(range)))

 if ipaddress.IPv4Address(unicode(request.client)) in ip_list:
 #  if the client address is in the local address list, then 
 do NOT require MFA so set to False
 return_value = False

 #  build the MFA Required group members
 # if return_value:
 # print(datetime.datetime.now())
 # ag = db(db.auth_group.role == "MFA Required 
 (web2py)").select().first()
 # if not ag:
 # ag = db.auth_group.insert("MFA Required (web2py)")
 # for ou in db(
 # (db.auth_user.active == True)
 # | (
 # (db.auth_user.mfa_override == None)
 # & (db.auth_user.mfa_override <= 
 datetime.datetime.now())
 # )
 # ).select():
 # db.auth_membership.update_or_insert(user_id=ou.id, 
 group_id=ag)
 #
 # #  clear out any members that are currently exempt from 
 MFA
 # if ag:
 # for exempt_user in db(
 # (db.auth_user.mfa_override >= 
 datetime.datetime.now())
 # & (db.auth_user.active == True)
 # ).select():
 # db(
 # (db.auth_membership.group_id == ag.id)
 # & (db.auth_membership.user_id == 
 exempt_user.id)
 # ).delete()
 # db.commit()
 #
 # print(datetime.datetime.now())
 #
 # #  set to False to force web2py to check the 
 two_factor_authentication  group
 # return_value = False

 That code is in db.py

 Then

 auth.settings.auth_two_factor_enabled = lambda user: 
 _two_factor_required(user)
 auth.messages.two_factor_comment = "QLF MFA - you have been sent a code"
 auth.settings.two_factor_methods = [
 lambda user, auth_two_factor: _send_sms(user, auth_two_factor)
 ]

 My _send_sms code built and sms and sent it via Twilio or RingCentral

 I wrote this code, but then we ended up not implementing.  The web2py 
 code is going away for us.  All the same concepts work in py4web (nudge 
 wink wink)

 -Jim



 On Friday, September 1, 2023 at 5:24:53 AM UTC-5 Ramos wrote:

> Anyone can help me ?
>
> Em qua., 30 de ago. de 2023 às 10:14, António Ramos <
> ramst...@gmail.com> escreveu:
>
>> in other words, how do i protect the administrator password? it does 
>> not have a username , just a password. This is 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread António Ramos
this admin

https://mysite.com/admin

Em sex., 1 de set. de 2023 às 16:08, Jim S  escreveu:

> What does 'administrator password' mean to you?
>
> I'm not sure what you're referring to
>
> -Jim
>
> On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:
>
>> Hello Jim
>> this line of code
>> *auth.settings.auth_two_factor_enabled = True*
>> *does not protect the administrator password. Only created users.*
>> *That is my question, how to force administrator to use 2fa ?*
>> *regards*
>> *António*
>>
>> Em sex., 1 de set. de 2023 às 15:00, Jim S  escreveu:
>>
>>> Here is the code I wrote that only enforced 2fa for users outside our
>>> local networks.
>>>
>>> There is some commented out code there that additionally allowed me to
>>> specify users in a group so only that group was force to 2fa
>>>
>>> def _two_factor_required(auth_user):
>>> """
>>> check whether we need to enforce MFA on this login
>>>
>>>We enforce MFA only on logins external to our network.
>>>
>>> Returns
>>> ---
>>> bool - enforce MFA
>>> - True means this login requires MFA
>>> - False means we will not enforce MFA for this login
>>> """
>>> import ipaddress
>>>
>>> return False  #  temp use to disable mfa
>>>
>>> if len(request.args) > 0 and request.args[0] == "login":
>>> if auth_user.mfa_override and datetime.datetime.now() <=
>>> auth_user.mfa_override:
>>> #  no mfa required if the user override is set   - we added
>>> a field in auth_user to allow us to override if a user was having trouble
>>> or lost their phone or something
>>> return False
>>>
>>> qlf_networks = [
>>> "9.9.9.9/22",
>>> "9.9.9.0/24",
>>> "9.9.9.101/24",
>>> ]
>>>
>>> ip_list = []
>>> for range in qlf_networks:
>>> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>>>
>>> if ipaddress.IPv4Address(unicode(request.client)) in ip_list:
>>> #  if the client address is in the local address list, then
>>> do NOT require MFA so set to False
>>> return_value = False
>>>
>>> #  build the MFA Required group members
>>> # if return_value:
>>> # print(datetime.datetime.now())
>>> # ag = db(db.auth_group.role == "MFA Required
>>> (web2py)").select().first()
>>> # if not ag:
>>> # ag = db.auth_group.insert("MFA Required (web2py)")
>>> # for ou in db(
>>> # (db.auth_user.active == True)
>>> # | (
>>> # (db.auth_user.mfa_override == None)
>>> # & (db.auth_user.mfa_override <=
>>> datetime.datetime.now())
>>> # )
>>> # ).select():
>>> # db.auth_membership.update_or_insert(user_id=ou.id,
>>> group_id=ag)
>>> #
>>> # #  clear out any members that are currently exempt from MFA
>>> # if ag:
>>> # for exempt_user in db(
>>> # (db.auth_user.mfa_override >=
>>> datetime.datetime.now())
>>> # & (db.auth_user.active == True)
>>> # ).select():
>>> # db(
>>> # (db.auth_membership.group_id == ag.id)
>>> # & (db.auth_membership.user_id ==
>>> exempt_user.id)
>>> # ).delete()
>>> # db.commit()
>>> #
>>> # print(datetime.datetime.now())
>>> #
>>> # #  set to False to force web2py to check the
>>> two_factor_authentication  group
>>> # return_value = False
>>>
>>> That code is in db.py
>>>
>>> Then
>>>
>>> auth.settings.auth_two_factor_enabled = lambda user:
>>> _two_factor_required(user)
>>> auth.messages.two_factor_comment = "QLF MFA - you have been sent a code"
>>> auth.settings.two_factor_methods = [
>>> lambda user, auth_two_factor: _send_sms(user, auth_two_factor)
>>> ]
>>>
>>> My _send_sms code built and sms and sent it via Twilio or RingCentral
>>>
>>> I wrote this code, but then we ended up not implementing.  The web2py
>>> code is going away for us.  All the same concepts work in py4web (nudge
>>> wink wink)
>>>
>>> -Jim
>>>
>>>
>>>
>>> On Friday, September 1, 2023 at 5:24:53 AM UTC-5 Ramos wrote:
>>>
 Anyone can help me ?

 Em qua., 30 de ago. de 2023 às 10:14, António Ramos 
 escreveu:

> in other words, how do i protect the administrator password? it does
> not have a username , just a password. This is scary :)
>
>
> Em ter., 29 de ago. de 2023 às 19:44, António Ramos <
> ramst...@gmail.com> escreveu:
>
>> But that is for everyone, i just want to start with users with admin
>> powers
>>
>> Clemens  escreveu em ter., 29/08/2023
>> às 18:25 :
>>
>>> Try enabling 2FA via the following setting, since this is for all
>>> users:
>>> 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread Jim S
What does 'administrator password' mean to you?

I'm not sure what you're referring to

-Jim

On Friday, September 1, 2023 at 9:53:43 AM UTC-5 Ramos wrote:

> Hello Jim 
> this line of code 
> *auth.settings.auth_two_factor_enabled = True*
> *does not protect the administrator password. Only created users.*
> *That is my question, how to force administrator to use 2fa ?*
> *regards*
> *António*
>
> Em sex., 1 de set. de 2023 às 15:00, Jim S  escreveu:
>
>> Here is the code I wrote that only enforced 2fa for users outside our 
>> local networks.
>>
>> There is some commented out code there that additionally allowed me to 
>> specify users in a group so only that group was force to 2fa
>>
>> def _two_factor_required(auth_user):
>> """
>> check whether we need to enforce MFA on this login
>>
>>We enforce MFA only on logins external to our network.
>>
>> Returns
>> ---
>> bool - enforce MFA
>> - True means this login requires MFA
>> - False means we will not enforce MFA for this login
>> """
>> import ipaddress
>>
>> return False  #  temp use to disable mfa
>>
>> if len(request.args) > 0 and request.args[0] == "login":
>> if auth_user.mfa_override and datetime.datetime.now() <= 
>> auth_user.mfa_override:
>> #  no mfa required if the user override is set   - we added a 
>> field in auth_user to allow us to override if a user was having trouble or 
>> lost their phone or something
>> return False
>>
>> qlf_networks = [
>> "9.9.9.9/22",
>> "9.9.9.0/24",
>> "9.9.9.101/24",
>> ]
>>
>> ip_list = []
>> for range in qlf_networks:
>> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>>
>> if ipaddress.IPv4Address(unicode(request.client)) in ip_list:
>> #  if the client address is in the local address list, then 
>> do NOT require MFA so set to False
>> return_value = False
>>
>> #  build the MFA Required group members
>> # if return_value:
>> # print(datetime.datetime.now())
>> # ag = db(db.auth_group.role == "MFA Required 
>> (web2py)").select().first()
>> # if not ag:
>> # ag = db.auth_group.insert("MFA Required (web2py)")
>> # for ou in db(
>> # (db.auth_user.active == True)
>> # | (
>> # (db.auth_user.mfa_override == None)
>> # & (db.auth_user.mfa_override <= 
>> datetime.datetime.now())
>> # )
>> # ).select():
>> # db.auth_membership.update_or_insert(user_id=ou.id, 
>> group_id=ag)
>> #
>> # #  clear out any members that are currently exempt from MFA
>> # if ag:
>> # for exempt_user in db(
>> # (db.auth_user.mfa_override >= 
>> datetime.datetime.now())
>> # & (db.auth_user.active == True)
>> # ).select():
>> # db(
>> # (db.auth_membership.group_id == ag.id)
>> # & (db.auth_membership.user_id == exempt_user.id
>> )
>> # ).delete()
>> # db.commit()
>> #
>> # print(datetime.datetime.now())
>> #
>> # #  set to False to force web2py to check the 
>> two_factor_authentication  group
>> # return_value = False
>>
>> That code is in db.py
>>
>> Then
>>
>> auth.settings.auth_two_factor_enabled = lambda user: 
>> _two_factor_required(user)
>> auth.messages.two_factor_comment = "QLF MFA - you have been sent a code"
>> auth.settings.two_factor_methods = [
>> lambda user, auth_two_factor: _send_sms(user, auth_two_factor)
>> ]
>>
>> My _send_sms code built and sms and sent it via Twilio or RingCentral
>>
>> I wrote this code, but then we ended up not implementing.  The web2py 
>> code is going away for us.  All the same concepts work in py4web (nudge 
>> wink wink)
>>
>> -Jim
>>
>>
>>
>> On Friday, September 1, 2023 at 5:24:53 AM UTC-5 Ramos wrote:
>>
>>> Anyone can help me ?
>>>
>>> Em qua., 30 de ago. de 2023 às 10:14, António Ramos  
>>> escreveu:
>>>
 in other words, how do i protect the administrator password? it does 
 not have a username , just a password. This is scary :)


 Em ter., 29 de ago. de 2023 às 19:44, António Ramos  
 escreveu:

> But that is for everyone, i just want to start with users with admin 
> powers 
>
> Clemens  escreveu em ter., 29/08/2023 
> às 18:25 :
>
>> Try enabling 2FA via the following setting, since this is for all 
>> users:
>> *auth.settings.auth_two_factor_enabled = True*
>>
>> Regards
>> Clemens
>>
>> On Tuesday, August 29, 2023 at 6:09:26 PM UTC+2 Ramos wrote:
>>
>>> i just activated the two step auth with this 
>>>
>>> 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread António Ramos
Hello Jim
this line of code
*auth.settings.auth_two_factor_enabled = True*
*does not protect the administrator password. Only created users.*
*That is my question, how to force administrator to use 2fa ?*
*regards*
*António*

Em sex., 1 de set. de 2023 às 15:00, Jim S  escreveu:

> Here is the code I wrote that only enforced 2fa for users outside our
> local networks.
>
> There is some commented out code there that additionally allowed me to
> specify users in a group so only that group was force to 2fa
>
> def _two_factor_required(auth_user):
> """
> check whether we need to enforce MFA on this login
>
>We enforce MFA only on logins external to our network.
>
> Returns
> ---
> bool - enforce MFA
> - True means this login requires MFA
> - False means we will not enforce MFA for this login
> """
> import ipaddress
>
> return False  #  temp use to disable mfa
>
> if len(request.args) > 0 and request.args[0] == "login":
> if auth_user.mfa_override and datetime.datetime.now() <=
> auth_user.mfa_override:
> #  no mfa required if the user override is set   - we added a
> field in auth_user to allow us to override if a user was having trouble or
> lost their phone or something
> return False
>
> qlf_networks = [
> "9.9.9.9/22",
> "9.9.9.0/24",
> "9.9.9.101/24",
> ]
>
> ip_list = []
> for range in qlf_networks:
> ip_list.extend(ipaddress.IPv4Network(unicode(range)))
>
> if ipaddress.IPv4Address(unicode(request.client)) in ip_list:
> #  if the client address is in the local address list, then do
> NOT require MFA so set to False
> return_value = False
>
> #  build the MFA Required group members
> # if return_value:
> # print(datetime.datetime.now())
> # ag = db(db.auth_group.role == "MFA Required
> (web2py)").select().first()
> # if not ag:
> # ag = db.auth_group.insert("MFA Required (web2py)")
> # for ou in db(
> # (db.auth_user.active == True)
> # | (
> # (db.auth_user.mfa_override == None)
> # & (db.auth_user.mfa_override <=
> datetime.datetime.now())
> # )
> # ).select():
> # db.auth_membership.update_or_insert(user_id=ou.id,
> group_id=ag)
> #
> # #  clear out any members that are currently exempt from MFA
> # if ag:
> # for exempt_user in db(
> # (db.auth_user.mfa_override >=
> datetime.datetime.now())
> # & (db.auth_user.active == True)
> # ).select():
> # db(
> # (db.auth_membership.group_id == ag.id)
> # & (db.auth_membership.user_id == exempt_user.id)
> # ).delete()
> # db.commit()
> #
> # print(datetime.datetime.now())
> #
> # #  set to False to force web2py to check the
> two_factor_authentication  group
> # return_value = False
>
> That code is in db.py
>
> Then
>
> auth.settings.auth_two_factor_enabled = lambda user:
> _two_factor_required(user)
> auth.messages.two_factor_comment = "QLF MFA - you have been sent a code"
> auth.settings.two_factor_methods = [
> lambda user, auth_two_factor: _send_sms(user, auth_two_factor)
> ]
>
> My _send_sms code built and sms and sent it via Twilio or RingCentral
>
> I wrote this code, but then we ended up not implementing.  The web2py code
> is going away for us.  All the same concepts work in py4web (nudge wink
> wink)
>
> -Jim
>
>
>
> On Friday, September 1, 2023 at 5:24:53 AM UTC-5 Ramos wrote:
>
>> Anyone can help me ?
>>
>> Em qua., 30 de ago. de 2023 às 10:14, António Ramos 
>> escreveu:
>>
>>> in other words, how do i protect the administrator password? it does not
>>> have a username , just a password. This is scary :)
>>>
>>>
>>> Em ter., 29 de ago. de 2023 às 19:44, António Ramos 
>>> escreveu:
>>>
 But that is for everyone, i just want to start with users with admin
 powers

 Clemens  escreveu em ter., 29/08/2023 às
 18:25 :

> Try enabling 2FA via the following setting, since this is for all
> users:
> *auth.settings.auth_two_factor_enabled = True*
>
> Regards
> Clemens
>
> On Tuesday, August 29, 2023 at 6:09:26 PM UTC+2 Ramos wrote:
>
>> i just activated the two step auth with this
>>
>> auth.settings.two_factor_authentication_group = "auth2step"
>>
>>
>> but now how do i include the administrator user  ?
>>
>> regards
>> António
>>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread Jim S
Here is the code I wrote that only enforced 2fa for users outside our local 
networks.

There is some commented out code there that additionally allowed me to 
specify users in a group so only that group was force to 2fa

def _two_factor_required(auth_user):
"""
check whether we need to enforce MFA on this login

   We enforce MFA only on logins external to our network.

Returns
---
bool - enforce MFA
- True means this login requires MFA
- False means we will not enforce MFA for this login
"""
import ipaddress

return False  #  temp use to disable mfa

if len(request.args) > 0 and request.args[0] == "login":
if auth_user.mfa_override and datetime.datetime.now() <= 
auth_user.mfa_override:
#  no mfa required if the user override is set   - we added a 
field in auth_user to allow us to override if a user was having trouble or 
lost their phone or something
return False

qlf_networks = [
"9.9.9.9/22",
"9.9.9.0/24",
"9.9.9.101/24",
]

ip_list = []
for range in qlf_networks:
ip_list.extend(ipaddress.IPv4Network(unicode(range)))

if ipaddress.IPv4Address(unicode(request.client)) in ip_list:
#  if the client address is in the local address list, then do 
NOT require MFA so set to False
return_value = False

#  build the MFA Required group members
# if return_value:
# print(datetime.datetime.now())
# ag = db(db.auth_group.role == "MFA Required 
(web2py)").select().first()
# if not ag:
# ag = db.auth_group.insert("MFA Required (web2py)")
# for ou in db(
# (db.auth_user.active == True)
# | (
# (db.auth_user.mfa_override == None)
# & (db.auth_user.mfa_override <= 
datetime.datetime.now())
# )
# ).select():
# db.auth_membership.update_or_insert(user_id=ou.id, 
group_id=ag)
#
# #  clear out any members that are currently exempt from MFA
# if ag:
# for exempt_user in db(
# (db.auth_user.mfa_override >= datetime.datetime.now())
# & (db.auth_user.active == True)
# ).select():
# db(
# (db.auth_membership.group_id == ag.id)
# & (db.auth_membership.user_id == exempt_user.id)
# ).delete()
# db.commit()
#
# print(datetime.datetime.now())
#
# #  set to False to force web2py to check the 
two_factor_authentication  group
# return_value = False

That code is in db.py

Then

auth.settings.auth_two_factor_enabled = lambda user: 
_two_factor_required(user)
auth.messages.two_factor_comment = "QLF MFA - you have been sent a code"
auth.settings.two_factor_methods = [
lambda user, auth_two_factor: _send_sms(user, auth_two_factor)
]

My _send_sms code built and sms and sent it via Twilio or RingCentral

I wrote this code, but then we ended up not implementing.  The web2py code 
is going away for us.  All the same concepts work in py4web (nudge wink 
wink)

-Jim



On Friday, September 1, 2023 at 5:24:53 AM UTC-5 Ramos wrote:

> Anyone can help me ?
>
> Em qua., 30 de ago. de 2023 às 10:14, António Ramos  
> escreveu:
>
>> in other words, how do i protect the administrator password? it does not 
>> have a username , just a password. This is scary :)
>>
>>
>> Em ter., 29 de ago. de 2023 às 19:44, António Ramos  
>> escreveu:
>>
>>> But that is for everyone, i just want to start with users with admin 
>>> powers 
>>>
>>> Clemens  escreveu em ter., 29/08/2023 às 
>>> 18:25 :
>>>
 Try enabling 2FA via the following setting, since this is for all users:
 *auth.settings.auth_two_factor_enabled = True*

 Regards
 Clemens

 On Tuesday, August 29, 2023 at 6:09:26 PM UTC+2 Ramos wrote:

> i just activated the two step auth with this 
>
> auth.settings.two_factor_authentication_group = "auth2step"
>
>
> but now how do i include the administrator user  ?
>
> regards
> António
>
 -- 
 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.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/5fe99103-1d14-4b91-80eb-194402c08453n%40googlegroups.com
  
 

Re: [web2py] Re: administrator login with 2fa

2023-09-01 Thread António Ramos
Anyone can help me ?

Em qua., 30 de ago. de 2023 às 10:14, António Ramos 
escreveu:

> in other words, how do i protect the administrator password? it does not
> have a username , just a password. This is scary :)
>
>
> Em ter., 29 de ago. de 2023 às 19:44, António Ramos 
> escreveu:
>
>> But that is for everyone, i just want to start with users with admin
>> powers
>>
>> Clemens  escreveu em ter., 29/08/2023
>> às 18:25 :
>>
>>> Try enabling 2FA via the following setting, since this is for all users:
>>> *auth.settings.auth_two_factor_enabled = True*
>>>
>>> Regards
>>> Clemens
>>>
>>> On Tuesday, August 29, 2023 at 6:09:26 PM UTC+2 Ramos wrote:
>>>
 i just activated the two step auth with this

 auth.settings.two_factor_authentication_group = "auth2step"


 but now how do i include the administrator user  ?

 regards
 António

>>> --
>>> 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/5fe99103-1d14-4b91-80eb-194402c08453n%40googlegroups.com
>>> 
>>> .
>>>
>>

-- 
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/CAEM0BxPnGmCsiRVSKU8FFfmxpwFfdjb%2BOi-FckKXVEVCq7HWpg%40mail.gmail.com.


Re: [web2py] Re: administrator login with 2fa

2023-08-30 Thread António Ramos
in other words, how do i protect the administrator password? it does not
have a username , just a password. This is scary :)


Em ter., 29 de ago. de 2023 às 19:44, António Ramos 
escreveu:

> But that is for everyone, i just want to start with users with admin
> powers
>
> Clemens  escreveu em ter., 29/08/2023
> às 18:25 :
>
>> Try enabling 2FA via the following setting, since this is for all users:
>> *auth.settings.auth_two_factor_enabled = True*
>>
>> Regards
>> Clemens
>>
>> On Tuesday, August 29, 2023 at 6:09:26 PM UTC+2 Ramos wrote:
>>
>>> i just activated the two step auth with this
>>>
>>> auth.settings.two_factor_authentication_group = "auth2step"
>>>
>>>
>>> but now how do i include the administrator user  ?
>>>
>>> regards
>>> António
>>>
>> --
>> 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/5fe99103-1d14-4b91-80eb-194402c08453n%40googlegroups.com
>> 
>> .
>>
>

-- 
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/CAEM0BxP_Gncp4AUtwB1FVtK-kv2CBpf%2B83yLG2a_dpA%3D8m%2Bf9A%40mail.gmail.com.


Re: [web2py] Re: administrator login with 2fa

2023-08-29 Thread António Ramos
But that is for everyone, i just want to start with users with admin powers

Clemens  escreveu em ter., 29/08/2023 às
18:25 :

> Try enabling 2FA via the following setting, since this is for all users:
> *auth.settings.auth_two_factor_enabled = True*
>
> Regards
> Clemens
>
> On Tuesday, August 29, 2023 at 6:09:26 PM UTC+2 Ramos wrote:
>
>> i just activated the two step auth with this
>>
>> auth.settings.two_factor_authentication_group = "auth2step"
>>
>>
>> but now how do i include the administrator user  ?
>>
>> regards
>> António
>>
> --
> 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/5fe99103-1d14-4b91-80eb-194402c08453n%40googlegroups.com
> 
> .
>

-- 
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/CAEM0BxMe9qqt_4cAhj0HRzC%2BaS6yQ%3DAx3XEksYJGcE%3DFh7wV%3Dg%40mail.gmail.com.


Re: [web2py] Re: Latest version of web2py and python versions

2022-12-30 Thread Davidiam
Thanks !

Sent from Outlook for Android

From: web2py@googlegroups.com  on behalf of Leonel 
Câmara 
Sent: Wednesday, December 28, 2022 5:14:56 PM
To: web2py-users 
Subject: [web2py] Re: Latest version of web2py and python versions

You can use a higher python version it's fine.

A quarta-feira, 21 de dezembro de 2022 à(s) 06:19:40 UTC, david@gmail.com 
escreveu:
Good morning,

Can anyone tell me if the latest version of web2py was specifically developed 
for any specific python version or range of python versions?

After years of using an older version, and being limited to the version 3.6, we 
will be upgrading to the most recent version of web2py, and I will need to 
recommend a version of python to the different development groups.

python 3.7 will be out of support soon, so I would ideally like to move to 
python 3.9 or 3.10.  I did a test with 3.9 yesterday and all my applications 
worked fine, but I just wanted to be sure that the version was meant to be used 
with these higher versions.

Kind Regards,
David

--
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/9bf3ab26-125f-4a6e-81c5-1bb6f206f91fn%40googlegroups.com.

-- 
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/AM8P193MB08020AB4AAEBDC34D2B97014FEF19%40AM8P193MB0802.EURP193.PROD.OUTLOOK.COM.


Re: [web2py] Re: Help on macos

2022-12-23 Thread Ian W. Scott
Logging problem solved! Finally! 

Turns out it was just that web2py is using the file error.log for the wsgi 
output, while apache (httpd) is using error_log. In case this helps anyone 
else, on the homebrew version of httpd the log files are located in 
/opt/homebrew/var/log/httpd

So my local apache/mod_wsgi setup is working as expected now on mac

On Friday, December 23, 2022 at 1:55:04 PM UTC-5 Ian W. Scott wrote:

> Okay, my one remaining problem is logging output. I'm using the default 
> logging settings for web2py, and it usually is output in the apache error 
> log. But nothing appears in the error log for my mac installation of apache 
> (homebrew version of httpd). The apache server notices are showing up there 
> (e.g., for startup and shutdown) but none of the web2py output. Any 
> suggestions?
>
> I've solved the python import issues and web2py is running fine aside from 
> the logging. To fix the issue I had to:
>
> - add the location of my virtual environment to the WSGIDaemonProcess line 
> of my apache virtual host file:   python-home="/path/to/my/virtualenv"
> - install each of the missing python modules in that virtual environment
>
> Since I couldn't see logging output I figured out what was missing by 
> viewing each of the error ticket files in my web2py application's `errors` 
> folder. Time consuming, but did the trick.
>
> If you have any suggestions about getting the logging output I'd be very 
> grateful!
>
> Ian
>
> On Friday, December 23, 2022 at 3:36:02 AM UTC-5 Massimiliano wrote:
>
>> Sorry I didn't notice that you use apache. 
>> Can I ask you why?
>> In my dev machine I use the web2py internal server for simplicity.
>>
>> Anyway have you setup uwsgi to use the right python?
>>
>> Il giorno ven 23 dic 2022 alle ore 09:22 Massimiliano  
>> ha scritto:
>>
>>> How do you start web2py?
>>>
>>> Il giorno ven 23 dic 2022 alle ore 03:39 Ian W. Scott  
>>> ha scritto:
>>>
 So it looks like it's a problem importing python modules. I'm using a 
 virtualenv (pyenv) and web2py isn't finding the modules I installed for 
 this version. There may be other issues too (since the logging isn't 
 working!) but this is something I can fix... 

 On Thursday, December 22, 2022 at 8:43:56 PM UTC-5 Ian W. Scott wrote:

> I've just moved to mac for my development and am trying to rebuild my 
> (formerly Linux) web2py dev environment. But I've hit a complete dead end:
> - web2py is generating 500 errors in the browser
> - there's no log output in the apache logs at all (so no error 
> messages)
> - none of the db table files are being created in the databases folder
> - a ticket number is being generated, but I can't access any tickets 
> (get a 500 error there too)
>
> Since I can't see any logging output I'm at a complete loss how to 
> debug this! 
>
> I'm using apache (homebrew httpd) with mod_wsgi and postgresql 
> (psycopg2) and they both seem to be working fine apart from web2py. I'm 
> pretty sure apache is configured properly and I can access files from the 
> "static" folder. But anything that goes through the db seems not to be 
> working at all.
>
> Any thoughts about how to start tackling this?
>
>
>  
>
 -- 
 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.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/9483abf7-67d5-4407-a04d-bca90c418a28n%40googlegroups.com
  
 
 .

>>>
>>>
>>> -- 
>>> Massimiliano
>>>
>>
>>
>> -- 
>> Massimiliano
>>
>

-- 
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/4ac7ff93-3c05-4a87-9cd9-3020389f11d6n%40googlegroups.com.


Re: [web2py] Re: Help on macos

2022-12-23 Thread Ian W. Scott
Okay, my one remaining problem is logging output. I'm using the default 
logging settings for web2py, and it usually is output in the apache error 
log. But nothing appears in the error log for my mac installation of apache 
(homebrew version of httpd). The apache server notices are showing up there 
(e.g., for startup and shutdown) but none of the web2py output. Any 
suggestions?

I've solved the python import issues and web2py is running fine aside from 
the logging. To fix the issue I had to:

- add the location of my virtual environment to the WSGIDaemonProcess line 
of my apache virtual host file:   python-home="/path/to/my/virtualenv"
- install each of the missing python modules in that virtual environment

Since I couldn't see logging output I figured out what was missing by 
viewing each of the error ticket files in my web2py application's `errors` 
folder. Time consuming, but did the trick.

If you have any suggestions about getting the logging output I'd be very 
grateful!

Ian

On Friday, December 23, 2022 at 3:36:02 AM UTC-5 Massimiliano wrote:

> Sorry I didn't notice that you use apache. 
> Can I ask you why?
> In my dev machine I use the web2py internal server for simplicity.
>
> Anyway have you setup uwsgi to use the right python?
>
> Il giorno ven 23 dic 2022 alle ore 09:22 Massimiliano  
> ha scritto:
>
>> How do you start web2py?
>>
>> Il giorno ven 23 dic 2022 alle ore 03:39 Ian W. Scott  
>> ha scritto:
>>
>>> So it looks like it's a problem importing python modules. I'm using a 
>>> virtualenv (pyenv) and web2py isn't finding the modules I installed for 
>>> this version. There may be other issues too (since the logging isn't 
>>> working!) but this is something I can fix... 
>>>
>>> On Thursday, December 22, 2022 at 8:43:56 PM UTC-5 Ian W. Scott wrote:
>>>
 I've just moved to mac for my development and am trying to rebuild my 
 (formerly Linux) web2py dev environment. But I've hit a complete dead end:
 - web2py is generating 500 errors in the browser
 - there's no log output in the apache logs at all (so no error messages)
 - none of the db table files are being created in the databases folder
 - a ticket number is being generated, but I can't access any tickets 
 (get a 500 error there too)

 Since I can't see any logging output I'm at a complete loss how to 
 debug this! 

 I'm using apache (homebrew httpd) with mod_wsgi and postgresql 
 (psycopg2) and they both seem to be working fine apart from web2py. I'm 
 pretty sure apache is configured properly and I can access files from the 
 "static" folder. But anything that goes through the db seems not to be 
 working at all.

 Any thoughts about how to start tackling this?


  

>>> -- 
>>> 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.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/9483abf7-67d5-4407-a04d-bca90c418a28n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> Massimiliano
>>
>
>
> -- 
> Massimiliano
>

-- 
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/052d2ab7-2be5-41e3-9518-9c3269b422cdn%40googlegroups.com.


Re: [web2py] Re: Help on macos

2022-12-23 Thread Ian W. Scott

Thanks Massimiliano. I've used local Apache for years so that I can test 
things like ssl and some routing that are done at the server level. But 
I've always done it on Linux, and I'm learning that mac is quite different. 
I've got mod_wsgi set up and working, but I think the issue may just be 
that it isn't finding the virtualenv with the modules that web2py is trying 
to import to run the db.py model. I'll try fixing that and then update here.
On Friday, December 23, 2022 at 3:36:02 AM UTC-5 Massimiliano wrote:

> Sorry I didn't notice that you use apache. 
> Can I ask you why?
> In my dev machine I use the web2py internal server for simplicity.
>
> Anyway have you setup uwsgi to use the right python?
>
> Il giorno ven 23 dic 2022 alle ore 09:22 Massimiliano  
> ha scritto:
>
>> How do you start web2py?
>>
>> Il giorno ven 23 dic 2022 alle ore 03:39 Ian W. Scott  
>> ha scritto:
>>
>>> So it looks like it's a problem importing python modules. I'm using a 
>>> virtualenv (pyenv) and web2py isn't finding the modules I installed for 
>>> this version. There may be other issues too (since the logging isn't 
>>> working!) but this is something I can fix... 
>>>
>>> On Thursday, December 22, 2022 at 8:43:56 PM UTC-5 Ian W. Scott wrote:
>>>
 I've just moved to mac for my development and am trying to rebuild my 
 (formerly Linux) web2py dev environment. But I've hit a complete dead end:
 - web2py is generating 500 errors in the browser
 - there's no log output in the apache logs at all (so no error messages)
 - none of the db table files are being created in the databases folder
 - a ticket number is being generated, but I can't access any tickets 
 (get a 500 error there too)

 Since I can't see any logging output I'm at a complete loss how to 
 debug this! 

 I'm using apache (homebrew httpd) with mod_wsgi and postgresql 
 (psycopg2) and they both seem to be working fine apart from web2py. I'm 
 pretty sure apache is configured properly and I can access files from the 
 "static" folder. But anything that goes through the db seems not to be 
 working at all.

 Any thoughts about how to start tackling this?


  

>>> -- 
>>> 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.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/9483abf7-67d5-4407-a04d-bca90c418a28n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> Massimiliano
>>
>
>
> -- 
> Massimiliano
>

-- 
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/5d61166d-2e74-4c4f-bfaf-2c473c030b71n%40googlegroups.com.


Re: [web2py] Re: Help on macos

2022-12-23 Thread Massimiliano
Sorry I didn't notice that you use apache.
Can I ask you why?
In my dev machine I use the web2py internal server for simplicity.

Anyway have you setup uwsgi to use the right python?

Il giorno ven 23 dic 2022 alle ore 09:22 Massimiliano 
ha scritto:

> How do you start web2py?
>
> Il giorno ven 23 dic 2022 alle ore 03:39 Ian W. Scott 
> ha scritto:
>
>> So it looks like it's a problem importing python modules. I'm using a
>> virtualenv (pyenv) and web2py isn't finding the modules I installed for
>> this version. There may be other issues too (since the logging isn't
>> working!) but this is something I can fix...
>>
>> On Thursday, December 22, 2022 at 8:43:56 PM UTC-5 Ian W. Scott wrote:
>>
>>> I've just moved to mac for my development and am trying to rebuild my
>>> (formerly Linux) web2py dev environment. But I've hit a complete dead end:
>>> - web2py is generating 500 errors in the browser
>>> - there's no log output in the apache logs at all (so no error messages)
>>> - none of the db table files are being created in the databases folder
>>> - a ticket number is being generated, but I can't access any tickets
>>> (get a 500 error there too)
>>>
>>> Since I can't see any logging output I'm at a complete loss how to debug
>>> this!
>>>
>>> I'm using apache (homebrew httpd) with mod_wsgi and postgresql
>>> (psycopg2) and they both seem to be working fine apart from web2py. I'm
>>> pretty sure apache is configured properly and I can access files from the
>>> "static" folder. But anything that goes through the db seems not to be
>>> working at all.
>>>
>>> Any thoughts about how to start tackling this?
>>>
>>>
>>>
>>>
>> --
>> 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/9483abf7-67d5-4407-a04d-bca90c418a28n%40googlegroups.com
>> 
>> .
>>
>
>
> --
> Massimiliano
>


-- 
Massimiliano

-- 
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/CANPTPxJZuFSVg5BvGc_OW3VM%3D8mkPE9vGOKm4eCn5QymZr_3%2Bw%40mail.gmail.com.


Re: [web2py] Re: Help on macos

2022-12-23 Thread Massimiliano
How do you start web2py?

Il giorno ven 23 dic 2022 alle ore 03:39 Ian W. Scott 
ha scritto:

> So it looks like it's a problem importing python modules. I'm using a
> virtualenv (pyenv) and web2py isn't finding the modules I installed for
> this version. There may be other issues too (since the logging isn't
> working!) but this is something I can fix...
>
> On Thursday, December 22, 2022 at 8:43:56 PM UTC-5 Ian W. Scott wrote:
>
>> I've just moved to mac for my development and am trying to rebuild my
>> (formerly Linux) web2py dev environment. But I've hit a complete dead end:
>> - web2py is generating 500 errors in the browser
>> - there's no log output in the apache logs at all (so no error messages)
>> - none of the db table files are being created in the databases folder
>> - a ticket number is being generated, but I can't access any tickets (get
>> a 500 error there too)
>>
>> Since I can't see any logging output I'm at a complete loss how to debug
>> this!
>>
>> I'm using apache (homebrew httpd) with mod_wsgi and postgresql (psycopg2)
>> and they both seem to be working fine apart from web2py. I'm pretty sure
>> apache is configured properly and I can access files from the "static"
>> folder. But anything that goes through the db seems not to be working at
>> all.
>>
>> Any thoughts about how to start tackling this?
>>
>>
>>
>>
> --
> 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/9483abf7-67d5-4407-a04d-bca90c418a28n%40googlegroups.com
> 
> .
>


-- 
Massimiliano

-- 
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/CANPTPx%2BuE_BOVmabmU3oFFFHCCJNX6odK_68T%3DJjaycHC6s9bQ%40mail.gmail.com.


Re: [web2py] Re: how to point web2py to python3.9 not python3.8?

2022-11-30 Thread lucas
hey massimo,

thanks for responding and mine is below.  which got me thinking about 
installing a new version of uwsgi.  so i first installed python39-devel 
using:

*yum install python39-devel*

then i ran:

*pip install uwsgi*

and restarted the web services on the server and web2py is not using 
python3.9.  an aside, for pip to install and compile the uwsgi package it 
needs the python39-devel package first.  also, i realized that the uwsgi 
package was only installed under the 3.8 site-packages and not the 3.9 
site-packages.

so, now all is good.  thank you massimo and have a great day.  lucas


[Unit]
Description=uWSGI Emperor service

[Service]
ExecStartPre=/usr/bin/bash -c 'mkdir -p /run/uwsgi; chown web2py:nginx 
/run/uwsgi'
ExecStart=/usr/local/bin/uwsgi --emperor /etc/uwsgi/sites
Restart=always
KillSignal=SIGQUIT
Type=notify
NotifyAccess=all

[Install]
WantedBy=multi-user.target
On Wednesday, November 30, 2022 at 9:22:14 AM UTC-5 Massimiliano wrote:

> If you use systemd to start uwsgi, check what uwsgi is started
>
> Take a look here:
>
> cat /etc/systemd/system/multi-user.target.wants/uwsgi.service
>
> mine:
>
> [Unit]
> Description=uWSGI Web2Py
> After=network.target
>
> [Service]
> ExecStart=*/home/www-data/.pyenv/shims/uwsgi* --ini 
> /home/www-data/uwsgi/w2p.ini
> # Requires systemd version 211 or newer
> Restart=always
> KillSignal=SIGQUIT
> Type=notify
> StandardError=syslog
> NotifyAccess=all
>
> [Install]
> WantedBy=multi-user.target
>
> Il giorno mer 30 nov 2022 alle ore 13:35 lucas  ha 
> scritto:
>
>> also all of the symbolic links, like "python", run to python3.9.  and 
>> scripts that have "#!/usr/bin/env python" seem to be running python3.9 
>> also.  so, I can not figure out why web2py is backtracking to python3.8, as 
>> shown for instance in the admin interface or under error trace files.
>>
>> On Tuesday, November 29, 2022 at 10:58:57 PM UTC-5 lucas wrote:
>>
>>> hello one and all,
>>>
>>> i just upgraded my centos8stream server from python3.8 to python3.9 
>>> running nginx1.14 and uwsgi2.0.21 and web2py2.22.5.
>>>
>>> when i restart web2py it says it is still accessing and running under 
>>> python3.8.  
>>>
>>> how do i setup web2py to start using python3.9?
>>>
>>> thank you in advance, lucas
>>>
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/9fd566c0-93e5-4715-baae-772d41e44aa6n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Massimiliano
>

-- 
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/12dbdc87-3235-40b8-ac23-944a22a5cefbn%40googlegroups.com.


Re: [web2py] Re: how to point web2py to python3.9 not python3.8?

2022-11-30 Thread Massimiliano
If you use systemd to start uwsgi, check what uwsgi is started

Take a look here:

cat /etc/systemd/system/multi-user.target.wants/uwsgi.service

mine:

[Unit]
Description=uWSGI Web2Py
After=network.target

[Service]
ExecStart=*/home/www-data/.pyenv/shims/uwsgi* --ini
/home/www-data/uwsgi/w2p.ini
# Requires systemd version 211 or newer
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all

[Install]
WantedBy=multi-user.target

Il giorno mer 30 nov 2022 alle ore 13:35 lucas  ha
scritto:

> also all of the symbolic links, like "python", run to python3.9.  and
> scripts that have "#!/usr/bin/env python" seem to be running python3.9
> also.  so, I can not figure out why web2py is backtracking to python3.8, as
> shown for instance in the admin interface or under error trace files.
>
> On Tuesday, November 29, 2022 at 10:58:57 PM UTC-5 lucas wrote:
>
>> hello one and all,
>>
>> i just upgraded my centos8stream server from python3.8 to python3.9
>> running nginx1.14 and uwsgi2.0.21 and web2py2.22.5.
>>
>> when i restart web2py it says it is still accessing and running under
>> python3.8.
>>
>> how do i setup web2py to start using python3.9?
>>
>> thank you in advance, lucas
>>
> --
> 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/9fd566c0-93e5-4715-baae-772d41e44aa6n%40googlegroups.com
> 
> .
>


-- 
Massimiliano

-- 
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/CANPTPxK7SSWuv4jTa4BduyYRe6DrF96ERGXWaXsgAGsgmaS-iQ%40mail.gmail.com.


Re: [web2py] Re: Reset Password does not send email

2022-11-27 Thread Silvian Cedru
Thanks for the information yeah I found it need create an extra app for it .

Am Mo., 28. Nov. 2022 um 06:15 Uhr schrieb Maxi <
maximiliano.dua...@gmail.com>:

> Remember that gmail no longer allows sending emails directly, you must
> create an exclusive key for that service. (Less secure applications
> previously)
> You must enter the configuration and create a key for the service you
> want, you can have several keys.
>
> Recuerden que gmail no permite mas el envio de mails directamente, deben
> crear una clave exclusiva para ese servicio.Aplicaciones menos seguras
> anteriormente
> Deben ingresar a la configuración y crear una clave para el servicio que
> deseen, pueden tener varias claves.
>
> El lun, 14 nov 2022 a las 12:30, Silvian Cedru ()
> escribió:
>
>> thank you Jim I will give it a try I will let you know
>>
>> Am Mo., 14. Nov. 2022 um 22:20 Uhr schrieb Jim Steil > >:
>>
>>> Here is what google wants for smtp settings:
>>>
>>> [image: image.png]
>>>
>>> For web2py you need to set
>>>
>>> server = "smtp.gmail.com:465"   #  assuming you're using ssl
>>> sender = "your_email_address"
>>> login = "username:password"  #  where password is a gmail app password,
>>> assuming you have 2FA enabled on your gmail account
>>> ssl = True
>>> tls = False
>>>
>>> If you choose to use TLS, then change the port and set tls to True
>>>
>>> Hope this helps
>>>
>>> -Jim
>>>
>>>
>>>
>>> On Fri, Nov 11, 2022 at 10:34 PM Silvian Cedru 
>>> wrote:
>>>
 Yeah that is what I tried to do but I am not really sure where I enter
 all the details I got the smtp IP from my own mailserver but I am not
 really sure where I need to pass the username and data trough do you have
 any idea ?

 Am Fr., 11. Nov. 2022 um 22:27 Uhr schrieb Jim S :

> Are you passing a password to the mail server?
>
> When I've set these up with gmail, I've needed an app-specific
> password to pass to it.
>
> -Jim
>
> On Thursday, November 10, 2022 at 11:52:34 PM UTC-6
> silvia...@gmail.com wrote:
>
>> Hello everyone,
>>
>> I want to reset password in my application if someone forgets it but
>> it does not seem to work I dont get how to setup the mail server below 
>> are
>> my two models I dont know what I need to configure that it works.
>>
>>
>> #Email Server Configuration
>> models/db.py
>>
>> mail = auth.settings.mailer
>> mail.settings.server =  'logging' or 'smtp.gmail.com:587'
>> mail.settings.sender = 'si@gmail.com'
>> mail.settings.login = True
>>
>>
>> apllication/applicationname/models/db.py
>>
>> # configure email
>> #
>> -
>> mail = auth.settings.mailer
>> mail.settings.server = 'logging' if request.is_local else
>> configuration.get('smtp.server')
>> mail.settings.sender = configuration.get('smtp.sender')
>> mail.settings.login = configuration.get('smtp.login')
>> mail.settings.tls = configuration.get('smtp.tls') or False
>> mail.settings.ssl = configuration.get('smtp.ssl') or False
>>
>>
>>
>>
>> --
> 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/e0a0c560-c1c7-4d3e-b1c7-c0879a2c0c7dn%40googlegroups.com
> 
> .
>
 --
 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/m4WKnUUEde0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/web2py/CABLX3EGAYWs6HzC2ih46_QL%3DZRyDyXNqB%3DPT1b5Y_nPXbJVd1g%40mail.gmail.com
 
 .

>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - 

Re: [web2py] Re: Reset Password does not send email

2022-11-27 Thread Maxi
Remember that gmail no longer allows sending emails directly, you must
create an exclusive key for that service. (Less secure applications
previously)
You must enter the configuration and create a key for the service you want,
you can have several keys.

Recuerden que gmail no permite mas el envio de mails directamente, deben
crear una clave exclusiva para ese servicio.Aplicaciones menos seguras
anteriormente
Deben ingresar a la configuración y crear una clave para el servicio que
deseen, pueden tener varias claves.

El lun, 14 nov 2022 a las 12:30, Silvian Cedru ()
escribió:

> thank you Jim I will give it a try I will let you know
>
> Am Mo., 14. Nov. 2022 um 22:20 Uhr schrieb Jim Steil  >:
>
>> Here is what google wants for smtp settings:
>>
>> [image: image.png]
>>
>> For web2py you need to set
>>
>> server = "smtp.gmail.com:465"   #  assuming you're using ssl
>> sender = "your_email_address"
>> login = "username:password"  #  where password is a gmail app password,
>> assuming you have 2FA enabled on your gmail account
>> ssl = True
>> tls = False
>>
>> If you choose to use TLS, then change the port and set tls to True
>>
>> Hope this helps
>>
>> -Jim
>>
>>
>>
>> On Fri, Nov 11, 2022 at 10:34 PM Silvian Cedru 
>> wrote:
>>
>>> Yeah that is what I tried to do but I am not really sure where I enter
>>> all the details I got the smtp IP from my own mailserver but I am not
>>> really sure where I need to pass the username and data trough do you have
>>> any idea ?
>>>
>>> Am Fr., 11. Nov. 2022 um 22:27 Uhr schrieb Jim S :
>>>
 Are you passing a password to the mail server?

 When I've set these up with gmail, I've needed an app-specific password
 to pass to it.

 -Jim

 On Thursday, November 10, 2022 at 11:52:34 PM UTC-6 silvia...@gmail.com
 wrote:

> Hello everyone,
>
> I want to reset password in my application if someone forgets it but
> it does not seem to work I dont get how to setup the mail server below are
> my two models I dont know what I need to configure that it works.
>
>
> #Email Server Configuration
> models/db.py
>
> mail = auth.settings.mailer
> mail.settings.server =  'logging' or 'smtp.gmail.com:587'
> mail.settings.sender = 'si@gmail.com'
> mail.settings.login = True
>
>
> apllication/applicationname/models/db.py
>
> # configure email
> #
> -
> mail = auth.settings.mailer
> mail.settings.server = 'logging' if request.is_local else
> configuration.get('smtp.server')
> mail.settings.sender = configuration.get('smtp.sender')
> mail.settings.login = configuration.get('smtp.login')
> mail.settings.tls = configuration.get('smtp.tls') or False
> mail.settings.ssl = configuration.get('smtp.ssl') or False
>
>
>
>
> --
 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/e0a0c560-c1c7-4d3e-b1c7-c0879a2c0c7dn%40googlegroups.com
 
 .

>>> --
>>> 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/m4WKnUUEde0/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/CABLX3EGAYWs6HzC2ih46_QL%3DZRyDyXNqB%3DPT1b5Y_nPXbJVd1g%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 

Re: [web2py] Re: Issue password in plain text before sending when login in the website via HTTPS

2022-11-25 Thread Silvian “Top 10 Answers” Cedru
Hello Chris,

thanks for the detailed information appreciate it.

chriii...@gmail.com schrieb am Donnerstag, 24. November 2022 um 03:24:06 
UTC+7:

> Hello. 
>
> TLS is enough to encrypt and secure the connection, the whole point of 
> HTTPS protocol is to make a clear text channel secure. 
>
> If someone is sniffing your HTTPS connection, will be not able to read the 
> traffic, except if the attacker performs a Man In the Middle and replace 
> the TLS certificate like burpsuite do, but  if something like that happens, 
> there is no point to hash the username and password because capturing the 
> cookie session will be enough to enter the application, or even reutilizing 
> the transmitted hash.
>
> I'm not aware of any mechanism in web2py to hash the username/password. 
> Maybe you can achieve this by adding some javascript code that hash these 
> values when click on submit, and probably you will have to modify an 
> internal component in web2py to make the auth validation able to read your 
> hashed data.
>
> I've been working in the world of cyber security for a lot of years 
> and most of the times when someone point this like a vulnerability is 
> because probably he doesn't understand really well the materia and make an 
> alarm for something that is already protected. In this case HTTPS is 
> enough. If your cyber security officer is saying that the app is not 
> protected even using HTTPS and gives you examples with burpsuite, is clear 
> that he/she does not understand why burpsuite is able to decrypt data (due 
> their own certificate) and will think that everything is unencrypted.
>
> I've some banks  that like to hash the transmitted data even with the 
> HTTPS protection. But again... this is not really secure because hashing 
> data before sending, would need to be performed in the browser via 
> javascript and if the hash process happens in the client side, you can see 
> how encryption is made and reverse it . Even if javascript functions are 
> obfuscated, you just have to put some breakpoints on the javascript console 
> (browser console) and catch events until you find where the hashing process 
> is made, and perform a reverse of that function.
>
>
> Cheers.
> Chris,
>
> El mié, 23 nov 2022 a las 15:59, Arglanir () escribió:
>
>> Hello,
>> It is a big question, and does not concern only web2py. You can find 
>> people asking the same general question in StackOverflow. And the aswers 
>> are generic : The most important is the TLS communication.
>>
>> https://security.stackexchange.com/questions/110415/is-it-ok-to-send-plain-text-password-over-https
>>  
>> (and see linked duplicate questions)
>> Do you know any website that does hash the password client-side ?
>> Arglanir
>>
>>
>> Le mardi 22 novembre 2022 à 01:20:06 UTC+1, silvia...@gmail.com a écrit :
>>
>>> Thank you, but do you have any suggestions what to do cause our 
>>> cybersecurity officer keeps complaining about that wo I need change some 
>>> settings in web2py or do you have an idea how I can sort it out ? 
>>>
>>> Kind regards
>>>
>>> Am Di., 22. Nov. 2022 um 02:23 Uhr schrieb Christian Varas <
>>> chriii...@gmail.com>:
>>>
 Hi, 
 It's OK, it's the way it works, If you put s local proxy like burp and 
 then you go and capture traffic, it is ok that you can see clear text data 
 because burp proxy puts their own certificate between client and backend, 
 because of that burp proxy can decrypt and show you clear text data. If 
 you 
 sniff with a packet capture like wireshark, you will see everything is 
 encrypted.

 Salting your password/username before sending it is not really secure, 
 because hashing the username/password before sending, would need to be 
 performed in the browser via javascript and if the hash process happens in 
 the client side, you can see how encryption is made and reverse it .

 Cheers.
 Chris.

 El lun, 21 nov 2022 a las 5:01, Silvian “Top 10 Answers” Cedru (<
 silvia...@gmail.com>) escribió:

> Its weird why does web2py do not salt username and password before 
> sending it ?
>
> Silvian Cedru schrieb am Montag, 21. November 2022 um 09:25:05 UTC+7:
>
>> Here is a screenshot after sniffing the network and it is weird since 
>> it has HTTPS I thought you could not sniff out the password when someone 
>> logs ins so I need to salt or Hash it but I am not sure where I find the 
>> file and what to change . Would be awesome if someone could help.
>>
>> Silvian Cedru schrieb am Donnerstag, 17. November 2022 um 11:05:34 
>> UTC+7:
>>
>>> Hello everyone ,
>>>
>>> I just found out that when you login in my application my password 
>>> gets send in plain text even I thought it gets hashed does someone know 
>>> a 
>>> solution how to salt or hash the password before sending ?
>>>
>>>
>>> -- 
> Resources:
> - http://web2py.com

Re: [web2py] Re: Issue password in plain text before sending when login in the website via HTTPS

2022-11-23 Thread Christian Varas
Hello.

TLS is enough to encrypt and secure the connection, the whole point of
HTTPS protocol is to make a clear text channel secure.

If someone is sniffing your HTTPS connection, will be not able to read the
traffic, except if the attacker performs a Man In the Middle and replace
the TLS certificate like burpsuite do, but  if something like that happens,
there is no point to hash the username and password because capturing the
cookie session will be enough to enter the application, or even reutilizing
the transmitted hash.

I'm not aware of any mechanism in web2py to hash the username/password.
Maybe you can achieve this by adding some javascript code that hash these
values when click on submit, and probably you will have to modify an
internal component in web2py to make the auth validation able to read your
hashed data.

I've been working in the world of cyber security for a lot of years and
most of the times when someone point this like a vulnerability is because
probably he doesn't understand really well the materia and make an alarm
for something that is already protected. In this case HTTPS is enough. If
your cyber security officer is saying that the app is not protected even
using HTTPS and gives you examples with burpsuite, is clear that he/she
does not understand why burpsuite is able to decrypt data (due their own
certificate) and will think that everything is unencrypted.

I've some banks  that like to hash the transmitted data even with the HTTPS
protection. But again... this is not really secure because hashing data
before sending, would need to be performed in the browser via javascript
and if the hash process happens in the client side, you can see how
encryption is made and reverse it . Even if javascript functions are
obfuscated, you just have to put some breakpoints on the javascript console
(browser console) and catch events until you find where the hashing process
is made, and perform a reverse of that function.


Cheers.
Chris,

El mié, 23 nov 2022 a las 15:59, Arglanir () escribió:

> Hello,
> It is a big question, and does not concern only web2py. You can find
> people asking the same general question in StackOverflow. And the aswers
> are generic : The most important is the TLS communication.
>
> https://security.stackexchange.com/questions/110415/is-it-ok-to-send-plain-text-password-over-https
> (and see linked duplicate questions)
> Do you know any website that does hash the password client-side ?
> Arglanir
>
>
> Le mardi 22 novembre 2022 à 01:20:06 UTC+1, silvia...@gmail.com a écrit :
>
>> Thank you, but do you have any suggestions what to do cause our
>> cybersecurity officer keeps complaining about that wo I need change some
>> settings in web2py or do you have an idea how I can sort it out ?
>>
>> Kind regards
>>
>> Am Di., 22. Nov. 2022 um 02:23 Uhr schrieb Christian Varas <
>> chriii...@gmail.com>:
>>
>>> Hi,
>>> It's OK, it's the way it works, If you put s local proxy like burp and
>>> then you go and capture traffic, it is ok that you can see clear text data
>>> because burp proxy puts their own certificate between client and backend,
>>> because of that burp proxy can decrypt and show you clear text data. If you
>>> sniff with a packet capture like wireshark, you will see everything is
>>> encrypted.
>>>
>>> Salting your password/username before sending it is not really secure,
>>> because hashing the username/password before sending, would need to be
>>> performed in the browser via javascript and if the hash process happens in
>>> the client side, you can see how encryption is made and reverse it .
>>>
>>> Cheers.
>>> Chris.
>>>
>>> El lun, 21 nov 2022 a las 5:01, Silvian “Top 10 Answers” Cedru (<
>>> silvia...@gmail.com>) escribió:
>>>
 Its weird why does web2py do not salt username and password before
 sending it ?

 Silvian Cedru schrieb am Montag, 21. November 2022 um 09:25:05 UTC+7:

> Here is a screenshot after sniffing the network and it is weird since
> it has HTTPS I thought you could not sniff out the password when someone
> logs ins so I need to salt or Hash it but I am not sure where I find the
> file and what to change . Would be awesome if someone could help.
>
> Silvian Cedru schrieb am Donnerstag, 17. November 2022 um 11:05:34
> UTC+7:
>
>> Hello everyone ,
>>
>> I just found out that when you login in my application my password
>> gets send in plain text even I thought it gets hashed does someone know a
>> solution how to salt or hash the password before sending ?
>>
>>
>> --
 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, 

Re: [web2py] Re: Issue password in plain text before sending when login in the website via HTTPS

2022-11-23 Thread Arglanir
Hello,
It is a big question, and does not concern only web2py. You can find people 
asking the same general question in StackOverflow. And the aswers are 
generic : The most important is the TLS communication.
https://security.stackexchange.com/questions/110415/is-it-ok-to-send-plain-text-password-over-https
 
(and see linked duplicate questions)
Do you know any website that does hash the password client-side ?
Arglanir


Le mardi 22 novembre 2022 à 01:20:06 UTC+1, silvia...@gmail.com a écrit :

> Thank you, but do you have any suggestions what to do cause our 
> cybersecurity officer keeps complaining about that wo I need change some 
> settings in web2py or do you have an idea how I can sort it out ? 
>
> Kind regards
>
> Am Di., 22. Nov. 2022 um 02:23 Uhr schrieb Christian Varas <
> chriii...@gmail.com>:
>
>> Hi, 
>> It's OK, it's the way it works, If you put s local proxy like burp and 
>> then you go and capture traffic, it is ok that you can see clear text data 
>> because burp proxy puts their own certificate between client and backend, 
>> because of that burp proxy can decrypt and show you clear text data. If you 
>> sniff with a packet capture like wireshark, you will see everything is 
>> encrypted.
>>
>> Salting your password/username before sending it is not really secure, 
>> because hashing the username/password before sending, would need to be 
>> performed in the browser via javascript and if the hash process happens in 
>> the client side, you can see how encryption is made and reverse it .
>>
>> Cheers.
>> Chris.
>>
>> El lun, 21 nov 2022 a las 5:01, Silvian “Top 10 Answers” Cedru (<
>> silvia...@gmail.com>) escribió:
>>
>>> Its weird why does web2py do not salt username and password before 
>>> sending it ?
>>>
>>> Silvian Cedru schrieb am Montag, 21. November 2022 um 09:25:05 UTC+7:
>>>
 Here is a screenshot after sniffing the network and it is weird since 
 it has HTTPS I thought you could not sniff out the password when someone 
 logs ins so I need to salt or Hash it but I am not sure where I find the 
 file and what to change . Would be awesome if someone could help.

 Silvian Cedru schrieb am Donnerstag, 17. November 2022 um 11:05:34 
 UTC+7:

> Hello everyone ,
>
> I just found out that when you login in my application my password 
> gets send in plain text even I thought it gets hashed does someone know a 
> solution how to salt or hash the password before sending ?
>
>
> -- 
>>> 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.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/3b380bb2-b908-4e8e-be5a-bc465196c38fn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/CA%2Bs%2BuJv2ddys7nQV5%3DCu7xbM%3DQ-vqu09%3DDL2ZMHoN2TNBYsO7A%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
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/f5bbb64a-e5c0-4f06-bb5b-7dc529b97e45n%40googlegroups.com.


Re: [web2py] Re: Issue password in plain text before sending when login in the website via HTTPS

2022-11-21 Thread Silvian Cedru
Thank you, but do you have any suggestions what to do cause our
cybersecurity officer keeps complaining about that wo I need change some
settings in web2py or do you have an idea how I can sort it out ?

Kind regards

Am Di., 22. Nov. 2022 um 02:23 Uhr schrieb Christian Varas <
chriiisti...@gmail.com>:

> Hi,
> It's OK, it's the way it works, If you put s local proxy like burp and
> then you go and capture traffic, it is ok that you can see clear text data
> because burp proxy puts their own certificate between client and backend,
> because of that burp proxy can decrypt and show you clear text data. If you
> sniff with a packet capture like wireshark, you will see everything is
> encrypted.
>
> Salting your password/username before sending it is not really secure,
> because hashing the username/password before sending, would need to be
> performed in the browser via javascript and if the hash process happens in
> the client side, you can see how encryption is made and reverse it .
>
> Cheers.
> Chris.
>
> El lun, 21 nov 2022 a las 5:01, Silvian “Top 10 Answers” Cedru (<
> silvian.ce...@gmail.com>) escribió:
>
>> Its weird why does web2py do not salt username and password before
>> sending it ?
>>
>> Silvian Cedru schrieb am Montag, 21. November 2022 um 09:25:05 UTC+7:
>>
>>> Here is a screenshot after sniffing the network and it is weird since it
>>> has HTTPS I thought you could not sniff out the password when someone logs
>>> ins so I need to salt or Hash it but I am not sure where I find the file
>>> and what to change . Would be awesome if someone could help.
>>>
>>> Silvian Cedru schrieb am Donnerstag, 17. November 2022 um 11:05:34 UTC+7:
>>>
 Hello everyone ,

 I just found out that when you login in my application my password gets
 send in plain text even I thought it gets hashed does someone know a
 solution how to salt or hash the password before sending ?


 --
>> 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/3b380bb2-b908-4e8e-be5a-bc465196c38fn%40googlegroups.com
>> 
>> .
>>
> --
> 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/CA%2Bs%2BuJv2ddys7nQV5%3DCu7xbM%3DQ-vqu09%3DDL2ZMHoN2TNBYsO7A%40mail.gmail.com
> 
> .
>

-- 
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/CABLX3EHdKqy44MNoay_TusmDkG%3Dn1z%3DwoDGc9U6Hqvdkqhz%3DYA%40mail.gmail.com.


Re: [web2py] Re: Issue password in plain text before sending when login in the website via HTTPS

2022-11-21 Thread Christian Varas
Hi,
It's OK, it's the way it works, If you put s local proxy like burp and then
you go and capture traffic, it is ok that you can see clear text data
because burp proxy puts their own certificate between client and backend,
because of that burp proxy can decrypt and show you clear text data. If you
sniff with a packet capture like wireshark, you will see everything is
encrypted.

Salting your password/username before sending it is not really secure,
because hashing the username/password before sending, would need to be
performed in the browser via javascript and if the hash process happens in
the client side, you can see how encryption is made and reverse it .

Cheers.
Chris.

El lun, 21 nov 2022 a las 5:01, Silvian “Top 10 Answers” Cedru (<
silvian.ce...@gmail.com>) escribió:

> Its weird why does web2py do not salt username and password before sending
> it ?
>
> Silvian Cedru schrieb am Montag, 21. November 2022 um 09:25:05 UTC+7:
>
>> Here is a screenshot after sniffing the network and it is weird since it
>> has HTTPS I thought you could not sniff out the password when someone logs
>> ins so I need to salt or Hash it but I am not sure where I find the file
>> and what to change . Would be awesome if someone could help.
>>
>> Silvian Cedru schrieb am Donnerstag, 17. November 2022 um 11:05:34 UTC+7:
>>
>>> Hello everyone ,
>>>
>>> I just found out that when you login in my application my password gets
>>> send in plain text even I thought it gets hashed does someone know a
>>> solution how to salt or hash the password before sending ?
>>>
>>>
>>> --
> 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/3b380bb2-b908-4e8e-be5a-bc465196c38fn%40googlegroups.com
> 
> .
>

-- 
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/CA%2Bs%2BuJv2ddys7nQV5%3DCu7xbM%3DQ-vqu09%3DDL2ZMHoN2TNBYsO7A%40mail.gmail.com.


Re: [web2py] Re: Reset Password does not send email

2022-11-14 Thread Silvian Cedru
thank you Jim I will give it a try I will let you know

Am Mo., 14. Nov. 2022 um 22:20 Uhr schrieb Jim Steil :

> Here is what google wants for smtp settings:
>
> [image: image.png]
>
> For web2py you need to set
>
> server = "smtp.gmail.com:465"   #  assuming you're using ssl
> sender = "your_email_address"
> login = "username:password"  #  where password is a gmail app password,
> assuming you have 2FA enabled on your gmail account
> ssl = True
> tls = False
>
> If you choose to use TLS, then change the port and set tls to True
>
> Hope this helps
>
> -Jim
>
>
>
> On Fri, Nov 11, 2022 at 10:34 PM Silvian Cedru 
> wrote:
>
>> Yeah that is what I tried to do but I am not really sure where I enter
>> all the details I got the smtp IP from my own mailserver but I am not
>> really sure where I need to pass the username and data trough do you have
>> any idea ?
>>
>> Am Fr., 11. Nov. 2022 um 22:27 Uhr schrieb Jim S :
>>
>>> Are you passing a password to the mail server?
>>>
>>> When I've set these up with gmail, I've needed an app-specific password
>>> to pass to it.
>>>
>>> -Jim
>>>
>>> On Thursday, November 10, 2022 at 11:52:34 PM UTC-6 silvia...@gmail.com
>>> wrote:
>>>
 Hello everyone,

 I want to reset password in my application if someone forgets it but it
 does not seem to work I dont get how to setup the mail server below are my
 two models I dont know what I need to configure that it works.


 #Email Server Configuration
 models/db.py

 mail = auth.settings.mailer
 mail.settings.server =  'logging' or 'smtp.gmail.com:587'
 mail.settings.sender = 'si@gmail.com'
 mail.settings.login = True


 apllication/applicationname/models/db.py

 # configure email
 #
 -
 mail = auth.settings.mailer
 mail.settings.server = 'logging' if request.is_local else
 configuration.get('smtp.server')
 mail.settings.sender = configuration.get('smtp.sender')
 mail.settings.login = configuration.get('smtp.login')
 mail.settings.tls = configuration.get('smtp.tls') or False
 mail.settings.ssl = configuration.get('smtp.ssl') or False




 --
>>> 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/e0a0c560-c1c7-4d3e-b1c7-c0879a2c0c7dn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/m4WKnUUEde0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/CABLX3EGAYWs6HzC2ih46_QL%3DZRyDyXNqB%3DPT1b5Y_nPXbJVd1g%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAERBpoC8ZXFk8xWU74--PyLEsDVaAWQoiwEyi91ZgMf9khXd1Q%40mail.gmail.com
> 
> .
>

-- 
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 

Re: [web2py] Re: Reset Password does not send email

2022-11-14 Thread Jim Steil
Here is what google wants for smtp settings:

[image: image.png]

For web2py you need to set

server = "smtp.gmail.com:465"   #  assuming you're using ssl
sender = "your_email_address"
login = "username:password"  #  where password is a gmail app password,
assuming you have 2FA enabled on your gmail account
ssl = True
tls = False

If you choose to use TLS, then change the port and set tls to True

Hope this helps

-Jim



On Fri, Nov 11, 2022 at 10:34 PM Silvian Cedru 
wrote:

> Yeah that is what I tried to do but I am not really sure where I enter all
> the details I got the smtp IP from my own mailserver but I am not really
> sure where I need to pass the username and data trough do you have any idea
> ?
>
> Am Fr., 11. Nov. 2022 um 22:27 Uhr schrieb Jim S :
>
>> Are you passing a password to the mail server?
>>
>> When I've set these up with gmail, I've needed an app-specific password
>> to pass to it.
>>
>> -Jim
>>
>> On Thursday, November 10, 2022 at 11:52:34 PM UTC-6 silvia...@gmail.com
>> wrote:
>>
>>> Hello everyone,
>>>
>>> I want to reset password in my application if someone forgets it but it
>>> does not seem to work I dont get how to setup the mail server below are my
>>> two models I dont know what I need to configure that it works.
>>>
>>>
>>> #Email Server Configuration
>>> models/db.py
>>>
>>> mail = auth.settings.mailer
>>> mail.settings.server =  'logging' or 'smtp.gmail.com:587'
>>> mail.settings.sender = 'si@gmail.com'
>>> mail.settings.login = True
>>>
>>>
>>> apllication/applicationname/models/db.py
>>>
>>> # configure email
>>> #
>>> -
>>> mail = auth.settings.mailer
>>> mail.settings.server = 'logging' if request.is_local else
>>> configuration.get('smtp.server')
>>> mail.settings.sender = configuration.get('smtp.sender')
>>> mail.settings.login = configuration.get('smtp.login')
>>> mail.settings.tls = configuration.get('smtp.tls') or False
>>> mail.settings.ssl = configuration.get('smtp.ssl') or False
>>>
>>>
>>>
>>>
>>> --
>> 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/e0a0c560-c1c7-4d3e-b1c7-c0879a2c0c7dn%40googlegroups.com
>> 
>> .
>>
> --
> 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/m4WKnUUEde0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CABLX3EGAYWs6HzC2ih46_QL%3DZRyDyXNqB%3DPT1b5Y_nPXbJVd1g%40mail.gmail.com
> 
> .
>

-- 
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/CAERBpoC8ZXFk8xWU74--PyLEsDVaAWQoiwEyi91ZgMf9khXd1Q%40mail.gmail.com.


Re: [web2py] Re: Reset Password does not send email

2022-11-11 Thread Silvian Cedru
Yeah that is what I tried to do but I am not really sure where I enter all
the details I got the smtp IP from my own mailserver but I am not really
sure where I need to pass the username and data trough do you have any idea
?

Am Fr., 11. Nov. 2022 um 22:27 Uhr schrieb Jim S :

> Are you passing a password to the mail server?
>
> When I've set these up with gmail, I've needed an app-specific password to
> pass to it.
>
> -Jim
>
> On Thursday, November 10, 2022 at 11:52:34 PM UTC-6 silvia...@gmail.com
> wrote:
>
>> Hello everyone,
>>
>> I want to reset password in my application if someone forgets it but it
>> does not seem to work I dont get how to setup the mail server below are my
>> two models I dont know what I need to configure that it works.
>>
>>
>> #Email Server Configuration
>> models/db.py
>>
>> mail = auth.settings.mailer
>> mail.settings.server =  'logging' or 'smtp.gmail.com:587'
>> mail.settings.sender = 'si@gmail.com'
>> mail.settings.login = True
>>
>>
>> apllication/applicationname/models/db.py
>>
>> # configure email
>> #
>> -
>> mail = auth.settings.mailer
>> mail.settings.server = 'logging' if request.is_local else
>> configuration.get('smtp.server')
>> mail.settings.sender = configuration.get('smtp.sender')
>> mail.settings.login = configuration.get('smtp.login')
>> mail.settings.tls = configuration.get('smtp.tls') or False
>> mail.settings.ssl = configuration.get('smtp.ssl') or False
>>
>>
>>
>>
>> --
> 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/e0a0c560-c1c7-4d3e-b1c7-c0879a2c0c7dn%40googlegroups.com
> 
> .
>

-- 
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/CABLX3EGAYWs6HzC2ih46_QL%3DZRyDyXNqB%3DPT1b5Y_nPXbJVd1g%40mail.gmail.com.


Re: [web2py] Re: Issue with admin acess web2py after deploying on a live server

2022-11-07 Thread Silvian “Top 10 Answers” Cedru
Thanks for the Help appreciate it.

Massimiliano schrieb am Montag, 7. November 2022 um 17:48:58 UTC+7:

> The password is stored in "parameters_8000.py" that you can change with
>
> python web2py.py -a 'your password'
>
> http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options
>
>
>
> Il giorno lun 7 nov 2022 alle ore 11:17 Silvian “Top 10 Answers” Cedru <
> silvia...@gmail.com> ha scritto:
>
>> I manage to acess it via localhost but now I cant get in there anymore 
>> since I dont know what password was assign to web2py krub 
>> Silvian Cedru schrieb am Montag, 7. November 2022 um 15:59:23 UTC+7:
>>
>>> Hello everyone,
>>>
>>> I finally managed to deploy web2py on Windows Server 2019 but the issue 
>>> is I can not access the admin panel for some reason for example my ip is 
>>> 162.25.1.204 and I have a an application called calculator I went to 
>>> http://172.25.1.204/calculator/appadmin and I get a 500 error does 
>>> someone know what settings I need change to change the admin password as 
>>> well  ? 
>>>
>>>
>>> Kind Regards
>>>
>>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/5ee891d2-e9f1-465c-88bb-c3a939817374n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Massimiliano
>

-- 
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/c3ed8408-f746-4299-a1fa-3dff3dfc0728n%40googlegroups.com.


Re: [web2py] Re: Issue with admin acess web2py after deploying on a live server

2022-11-07 Thread Massimiliano
The password is stored in "parameters_8000.py" that you can change with

python web2py.py -a 'your password'

http://web2py.com/books/default/chapter/29/04/the-core#Command-line-options



Il giorno lun 7 nov 2022 alle ore 11:17 Silvian “Top 10 Answers” Cedru <
silvian.ce...@gmail.com> ha scritto:

> I manage to acess it via localhost but now I cant get in there anymore
> since I dont know what password was assign to web2py krub
> Silvian Cedru schrieb am Montag, 7. November 2022 um 15:59:23 UTC+7:
>
>> Hello everyone,
>>
>> I finally managed to deploy web2py on Windows Server 2019 but the issue
>> is I can not access the admin panel for some reason for example my ip is
>> 162.25.1.204 and I have a an application called calculator I went to
>> http://172.25.1.204/calculator/appadmin and I get a 500 error does
>> someone know what settings I need change to change the admin password as
>> well  ?
>>
>>
>> Kind Regards
>>
>> --
> 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/5ee891d2-e9f1-465c-88bb-c3a939817374n%40googlegroups.com
> 
> .
>


-- 
Massimiliano

-- 
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/CANPTPxLYBt8L91PEz9SqJ22KP3OVqWTUGK7eeWJ0F-az%2Bf%3DoZw%40mail.gmail.com.


Re: [web2py] Re: pbkdf2(1000,20,sha512)$etc... in v2.22.5

2022-08-19 Thread Jim S
I think we'll need help from someone who knows more about this than I do.

-Jim


On Friday, August 19, 2022 at 6:27:15 AM UTC-5 lucas wrote:

> ok, i am trying to understand.  i'm using web2py 2.22.5 under centos 8 in 
> console only mode.  i searched all of my application files and there is no 
> hint of auth.settings.hmac_key = "such and such".  when i access auth, 
> session, request, etc., i can see an hmac_key key in auth.settings but it 
> is None, AND i see a session changing value under session.auth with an 
> equal value under response.  but again, that changes with each login.
>
> i grep'd "hmac_key" under gluon and found "pbkdf2_hex" and "simple_hash" 
> under gluon/packages/dal/pydal/validators.py, and i suspect i would access 
> and use these functions based on previous posts asking similar questions, 
> but i have no idea how to import them and then use them in a bash/python 
> script file to reproduce the hash in a password field under web2py.
>
> so i ask again: "in linux/bash script code, not web2py interface [or 
> application], how do i take a regular string and convert it into the 
> password that is stored in the password in the auth_user table under web2py 
> version 2.22.5?"
>
> lucas
>
> On Thursday, August 18, 2022 at 4:51:41 PM UTC-4 Jim S wrote:
>
>> I must be misunderstanding something, because that is what I thought I 
>> just showed.
>>
>> hashed_password 
>> = 
>> str(CRYPT(key="pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(plain_text_password)[0])
>>
>> "whatever-your-hash-string-is needs" to be the same as what you're 
>> assigning to auth.settings.hmac_key in db.py
>>
>> hashed_password should then match what is in auth_user.password
>>
>> -Jim
>>
>>
>> On Thursday, August 18, 2022 at 2:34:45 PM UTC-5 lucas wrote:
>>
>>> ok, that sets up the web2py environment.  i'm asking how to reproduce or 
>>> generate the hashed key from regular text within a separate shell script.  
>>> lucas
>>>
>>> On Thursday, August 18, 2022 at 8:53:38 AM UTC-4 Jim S wrote:
>>>
 It should be the same as auth.settings.hmac_key, probably set in db.py

 auth.settings.hmac_key = (
 "sha512:whatever-your-has-string-is"  # before define_tables()
 )



 On Thu, Aug 18, 2022 at 7:44 AM lucas  wrote:

> but how do you generate the hash string from the regular text string?
>
> On Thursday, August 18, 2022 at 8:40:35 AM UTC-4 Jim S wrote:
>
>> Here is what I'm using:
>>
>> password = str(CRYPT(key=
>> "pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(unhashed)[0])
>>
>> On Wednesday, August 17, 2022 at 9:01:32 PM UTC-5 lucas wrote:
>>
>>> hello one and all,
>>> in linux/bash script code, not web2py interface, how do i take a 
>>> regular string and convert it into the password that is stored in the 
>>> password in the auth_user table under web2py version 2.22.5?
>>> thank you in advance, lucas
>>>
>> -- 
> 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/801jh-wneL0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+un...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/web2py/2b0bd3f4-5dbc-49b5-b40e-e50e616b9d1dn%40googlegroups.com
>  
> 
> .
>


-- 
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/6cf48519-6c19-49fd-9c44-5a0e6b657015n%40googlegroups.com.


Re: [web2py] Re: pbkdf2(1000,20,sha512)$etc... in v2.22.5

2022-08-19 Thread lucas
ok, i am trying to understand.  i'm using web2py 2.22.5 under centos 8 in 
console only mode.  i searched all of my application files and there is no 
hint of auth.settings.hmac_key = "such and such".  when i access auth, 
session, request, etc., i can see an hmac_key key in auth.settings but it 
is None, AND i see a session changing value under session.auth with an 
equal value under response.  but again, that changes with each login.

i grep'd "hmac_key" under gluon and found "pbkdf2_hex" and "simple_hash" 
under gluon/packages/dal/pydal/validators.py, and i suspect i would access 
and use these functions based on previous posts asking similar questions, 
but i have no idea how to import them and then use them in a bash/python 
script file to reproduce the hash in a password field under web2py.

so i ask again: "in linux/bash script code, not web2py interface [or 
application], how do i take a regular string and convert it into the 
password that is stored in the password in the auth_user table under web2py 
version 2.22.5?"

lucas

On Thursday, August 18, 2022 at 4:51:41 PM UTC-4 Jim S wrote:

> I must be misunderstanding something, because that is what I thought I 
> just showed.
>
> hashed_password 
> = 
> str(CRYPT(key="pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(plain_text_password)[0])
>
> "whatever-your-hash-string-is needs" to be the same as what you're 
> assigning to auth.settings.hmac_key in db.py
>
> hashed_password should then match what is in auth_user.password
>
> -Jim
>
>
> On Thursday, August 18, 2022 at 2:34:45 PM UTC-5 lucas wrote:
>
>> ok, that sets up the web2py environment.  i'm asking how to reproduce or 
>> generate the hashed key from regular text within a separate shell script.  
>> lucas
>>
>> On Thursday, August 18, 2022 at 8:53:38 AM UTC-4 Jim S wrote:
>>
>>> It should be the same as auth.settings.hmac_key, probably set in db.py
>>>
>>> auth.settings.hmac_key = (
>>> "sha512:whatever-your-has-string-is"  # before define_tables()
>>> )
>>>
>>>
>>>
>>> On Thu, Aug 18, 2022 at 7:44 AM lucas  wrote:
>>>
 but how do you generate the hash string from the regular text string?

 On Thursday, August 18, 2022 at 8:40:35 AM UTC-4 Jim S wrote:

> Here is what I'm using:
>
> password = str(CRYPT(key=
> "pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(unhashed)[0])
>
> On Wednesday, August 17, 2022 at 9:01:32 PM UTC-5 lucas wrote:
>
>> hello one and all,
>> in linux/bash script code, not web2py interface, how do i take a 
>> regular string and convert it into the password that is stored in the 
>> password in the auth_user table under web2py version 2.22.5?
>> thank you in advance, lucas
>>
> -- 
 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/801jh-wneL0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/2b0bd3f4-5dbc-49b5-b40e-e50e616b9d1dn%40googlegroups.com
  
 
 .

>>>

-- 
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/8d2647c2-8cfa-4336-8e39-57e2b3b62b40n%40googlegroups.com.


Re: [web2py] Re: pbkdf2(1000,20,sha512)$etc... in v2.22.5

2022-08-18 Thread Jim S
I must be misunderstanding something, because that is what I thought I just 
showed.

hashed_password 
= 
str(CRYPT(key="pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(plain_text_password)[0])

"whatever-your-hash-string-is needs" to be the same as what you're 
assigning to auth.settings.hmac_key in db.py

hashed_password should then match what is in auth_user.password

-Jim


On Thursday, August 18, 2022 at 2:34:45 PM UTC-5 lucas wrote:

> ok, that sets up the web2py environment.  i'm asking how to reproduce or 
> generate the hashed key from regular text within a separate shell script.  
> lucas
>
> On Thursday, August 18, 2022 at 8:53:38 AM UTC-4 Jim S wrote:
>
>> It should be the same as auth.settings.hmac_key, probably set in db.py
>>
>> auth.settings.hmac_key = (
>> "sha512:whatever-your-has-string-is"  # before define_tables()
>> )
>>
>>
>>
>> On Thu, Aug 18, 2022 at 7:44 AM lucas  wrote:
>>
>>> but how do you generate the hash string from the regular text string?
>>>
>>> On Thursday, August 18, 2022 at 8:40:35 AM UTC-4 Jim S wrote:
>>>
 Here is what I'm using:

 password = str(CRYPT(key=
 "pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(unhashed)[0])

 On Wednesday, August 17, 2022 at 9:01:32 PM UTC-5 lucas wrote:

> hello one and all,
> in linux/bash script code, not web2py interface, how do i take a 
> regular string and convert it into the password that is stored in the 
> password in the auth_user table under web2py version 2.22.5?
> thank you in advance, lucas
>
 -- 
>>> 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/801jh-wneL0/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> web2py+un...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/2b0bd3f4-5dbc-49b5-b40e-e50e616b9d1dn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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/8b4e05fe-0087-46e9-b645-6027886b79e6n%40googlegroups.com.


Re: [web2py] Re: pbkdf2(1000,20,sha512)$etc... in v2.22.5

2022-08-18 Thread lucas
ok, that sets up the web2py environment.  i'm asking how to reproduce or 
generate the hashed key from regular text within a separate shell script.  
lucas

On Thursday, August 18, 2022 at 8:53:38 AM UTC-4 Jim S wrote:

> It should be the same as auth.settings.hmac_key, probably set in db.py
>
> auth.settings.hmac_key = (
> "sha512:whatever-your-has-string-is"  # before define_tables()
> )
>
>
>
> On Thu, Aug 18, 2022 at 7:44 AM lucas  wrote:
>
>> but how do you generate the hash string from the regular text string?
>>
>> On Thursday, August 18, 2022 at 8:40:35 AM UTC-4 Jim S wrote:
>>
>>> Here is what I'm using:
>>>
>>> password = str(CRYPT(key=
>>> "pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(unhashed)[0])
>>>
>>> On Wednesday, August 17, 2022 at 9:01:32 PM UTC-5 lucas wrote:
>>>
 hello one and all,
 in linux/bash script code, not web2py interface, how do i take a 
 regular string and convert it into the password that is stored in the 
 password in the auth_user table under web2py version 2.22.5?
 thank you in advance, lucas

>>> -- 
>> 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/801jh-wneL0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/2b0bd3f4-5dbc-49b5-b40e-e50e616b9d1dn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/4cf9a668-f60c-4052-baac-4d12b6788bean%40googlegroups.com.


Re: [web2py] Re: pbkdf2(1000,20,sha512)$etc... in v2.22.5

2022-08-18 Thread Jim Steil
It should be the same as auth.settings.hmac_key, probably set in db.py

auth.settings.hmac_key = (
"sha512:whatever-your-has-string-is"  # before define_tables()
)



On Thu, Aug 18, 2022 at 7:44 AM lucas  wrote:

> but how do you generate the hash string from the regular text string?
>
> On Thursday, August 18, 2022 at 8:40:35 AM UTC-4 Jim S wrote:
>
>> Here is what I'm using:
>>
>> password = str(CRYPT(key=
>> "pbkdf2(1000,20,sha512):whatever-your-hash-string-is")(unhashed)[0])
>>
>> On Wednesday, August 17, 2022 at 9:01:32 PM UTC-5 lucas wrote:
>>
>>> hello one and all,
>>> in linux/bash script code, not web2py interface, how do i take a regular
>>> string and convert it into the password that is stored in the password in
>>> the auth_user table under web2py version 2.22.5?
>>> thank you in advance, lucas
>>>
>> --
> 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/801jh-wneL0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/2b0bd3f4-5dbc-49b5-b40e-e50e616b9d1dn%40googlegroups.com
> 
> .
>

-- 
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/CAERBpoBW0xJ7e%2BVbNeOpar_K3jG%2Btq03Vkxa21n95rZ0WUpyyA%40mail.gmail.com.


Re: [web2py] Re: sessions folder under application

2022-07-13 Thread Dave S


On Thursday, July 7, 2022 at 1:07:02 AM UTC-7 Niphlod wrote:

> there's an handy session cleaner   web2py/sessions2trash.py at master · 
> web2py/web2py (github.com) 
>  and 
> a whole section in the docs  web2py - Deployment recipes 
> 


Hey, Stefan, hope you're keeping well!

(and I've often appreciated that script, too)

/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/45f917fa-de63-4eef-bd53-0aca182e9e5dn%40googlegroups.com.


Re: [web2py] Re: sessions folder under application

2022-07-07 Thread Eliezer (Vlad) Tseytkin
Oops, I missed this section.
Thank you very much

On Thu, Jul 7, 2022, 4:07 AM Niphlod  wrote:

> there's an handy session cleaner   web2py/sessions2trash.py at master ·
> web2py/web2py (github.com)
>  and
> a whole section in the docs  web2py - Deployment recipes
> 
>
> On Wednesday, July 6, 2022 at 3:22:43 PM UTC+2 Vlad wrote:
>
>> Invalidating existing sessions is not a problem; they can login again. As
>> long as it doesn't break things...
>>
>> Thank you, Jim!
>>
>>
>> On Wed, Jul 6, 2022, 9:20 AM Jim S  wrote:
>>
>>> I believe that you can.
>>>
>>> However, this will invalidate all active sessions and all active users
>>> will have to log in again.
>>>
>>> Are there date stamps you can use to delete old session files but keep
>>> current ones?
>>>
>>> -Jim
>>>
>>> On Tuesday, July 5, 2022 at 10:44:35 PM UTC-5 Vlad wrote:
>>>
 I was checking memory usage and noticed that the sessions folder (under
 one specific application) takes over 1G of disk space. Can I just delete
 everything in there? Trying to clean up the space to optimize disk usage -

>>> --
>>> 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/VBkKItehYfQ/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+un...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/ef6ffa3f-1f27-43ed-9f70-8a8e694d501bn%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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/VBkKItehYfQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/6bf23f74-2677-48bb-a1fd-6673dcd4efb7n%40googlegroups.com
> 
> .
>

-- 
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/CABZ%2BKCAvrRJnUmxVBBnWrMb%2B5BkX4nRiCpXiKST0DC953LwQeg%40mail.gmail.com.


Re: [web2py] Re: sessions folder under application

2022-07-07 Thread Niphlod
there's an handy session cleaner   web2py/sessions2trash.py at master · 
web2py/web2py (github.com) 
 and 
a whole section in the docs  web2py - Deployment recipes 


On Wednesday, July 6, 2022 at 3:22:43 PM UTC+2 Vlad wrote:

> Invalidating existing sessions is not a problem; they can login again. As 
> long as it doesn't break things... 
>
> Thank you, Jim! 
>
>
> On Wed, Jul 6, 2022, 9:20 AM Jim S  wrote:
>
>> I believe that you can.
>>
>> However, this will invalidate all active sessions and all active users 
>> will have to log in again.
>>
>> Are there date stamps you can use to delete old session files but keep 
>> current ones?
>>
>> -Jim
>>
>> On Tuesday, July 5, 2022 at 10:44:35 PM UTC-5 Vlad wrote:
>>
>>> I was checking memory usage and noticed that the sessions folder (under 
>>> one specific application) takes over 1G of disk space. Can I just delete 
>>> everything in there? Trying to clean up the space to optimize disk usage - 
>>>
>> -- 
>> 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/VBkKItehYfQ/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/ef6ffa3f-1f27-43ed-9f70-8a8e694d501bn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/6bf23f74-2677-48bb-a1fd-6673dcd4efb7n%40googlegroups.com.


Re: [web2py] Re: sessions folder under application

2022-07-06 Thread Eliezer (Vlad) Tseytkin
Invalidating existing sessions is not a problem; they can login again. As
long as it doesn't break things...

Thank you, Jim!


On Wed, Jul 6, 2022, 9:20 AM Jim S  wrote:

> I believe that you can.
>
> However, this will invalidate all active sessions and all active users
> will have to log in again.
>
> Are there date stamps you can use to delete old session files but keep
> current ones?
>
> -Jim
>
> On Tuesday, July 5, 2022 at 10:44:35 PM UTC-5 Vlad wrote:
>
>> I was checking memory usage and noticed that the sessions folder (under
>> one specific application) takes over 1G of disk space. Can I just delete
>> everything in there? Trying to clean up the space to optimize disk usage -
>>
> --
> 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/VBkKItehYfQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/ef6ffa3f-1f27-43ed-9f70-8a8e694d501bn%40googlegroups.com
> 
> .
>

-- 
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/CABZ%2BKCCwiBfXFns4FBVrYvuhitnyjbj3w5s17TpP3gPHqQixUg%40mail.gmail.com.


Re: [web2py] Re: Pillow not imported by web2py-win

2022-05-13 Thread Dave S
On Monday, May 9, 2022 at 5:19:42 PM UTC-7 Dave S wrote:

> On Sunday, May 8, 2022 at 1:55:52 AM UTC-7 nico...@gmail.com wrote:
>
>> Hi Dave,
>>
>> the simplest solution is surely to use web2py from source - and it's even 
>> better on py3 if possible.
>>
>> If you're stick with the frozen app (apart from my simple guide on this 
>> at 
>> https://github.com/nicozanf/web2py-pyinstaller/blob/master/HOWTO-modules.md),
>>  
>> I don't have any special advise - you have to try all the possibilities...
>> Also, check what happens if you try to import the module from the python 
>> shell of web2py; maybe you'be a clearer traceback.
>>
>> Unfortunately the traceback above does not help me in understanding the 
>> issue. But it seems to be similar to this: 
>> https://stackoverflow.com/questions/63123335/distutils-spawn-not-available-unless-imported
>>  
>> , maybe you could follow their advices.
>>
>>
>> Ciao,
>> Nico
>>
>>
> Thanks, this gives me something to start looking at, and the fallback of 
> moving to source.  I'll try to report back when I have success.
>

You'll all be relieved to know that Pillow works fine with my installation 
of Python3 (3.10), at least for the manipulations I am interested in, 
and that I can  import it into a web2py shell just fine.  I'll soon be 
looking at how much 2->3 effort has been hiding behind the curtain, but I 
think I've got the "print -> print()" part covered.

/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/965e7d13-ebc7-4180-8d5b-97d2ed4ad664n%40googlegroups.com.


Re: [web2py] Re: Pillow not imported by web2py-win

2022-05-09 Thread Dave S


On Sunday, May 8, 2022 at 1:55:52 AM UTC-7 nico...@gmail.com wrote:

> Hi Dave,
>
> the simplest solution is surely to use web2py from source - and it's even 
> better on py3 if possible.
>
> If you're stick with the frozen app (apart from my simple guide on this at 
> https://github.com/nicozanf/web2py-pyinstaller/blob/master/HOWTO-modules.md), 
> I don't have any special advise - you have to try all the possibilities...
> Also, check what happens if you try to import the module from the python 
> shell of web2py; maybe you'be a clearer traceback.
>
> Unfortunately the traceback above does not help me in understanding the 
> issue. But it seems to be similar to this: 
> https://stackoverflow.com/questions/63123335/distutils-spawn-not-available-unless-imported
>  
> , maybe you could follow their advices.
>
>
> Ciao,
> Nico
>
>
Thanks, this gives me something to start looking at, and the fallback of 
moving to source.  I'll try to report back when I have success.

Dave S
/dps

 

> Il giorno sab 7 mag 2022 alle ore 08:00 Massimo Di Pierro <
> massimo@gmail.com> ha scritto:
>
>> can you try "pip install pillow" instead of putting it in 
>> C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages 
>> Not all packages like to be there and it can create problems.
>>
>>
>> On Wednesday, 20 April 2022 at 00:26:48 UTC-7 snide...@gmail.com wrote:
>>
>>> [mumble,mumble]
>
>
 
 

-- 
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/4b40db47-f9cc-4d30-88b8-aa33a8bdc8a0n%40googlegroups.com.


Re: [web2py] Re: Pillow not imported by web2py-win

2022-05-08 Thread Nico Zanferrari
Hi Dave,

the simplest solution is surely to use web2py from source - and it's even
better on py3 if possible.

If you're stick with the frozen app (apart from my simple guide on this at
https://github.com/nicozanf/web2py-pyinstaller/blob/master/HOWTO-modules.md),
I don't have any special advise - you have to try all the possibilities...
Also, check what happens if you try to import the module from the python
shell of web2py; maybe you'be a clearer traceback.

Unfortunately the traceback above does not help me in understanding the
issue. But it seems to be similar to this:
https://stackoverflow.com/questions/63123335/distutils-spawn-not-available-unless-imported
, maybe you could follow their advices.


Ciao,
Nico

Il giorno sab 7 mag 2022 alle ore 08:00 Massimo Di Pierro <
massimo.dipie...@gmail.com> ha scritto:

> can you try "pip install pillow" instead of putting it in 
> C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages
> Not all packages like to be there and it can create problems.
>
>
> On Wednesday, 20 April 2022 at 00:26:48 UTC-7 snide...@gmail.com wrote:
>
>> I want to do some simple image manipulation using Pillow.  I've been
>> using Pillow in a standalone Python27 setup, and now I want to use it
>> within my w2p app.
>>
>> Since I had done the PIP into the standalone, I copied the files from
>> that site-packages to the web2py/site-packages.  The function that needed
>> to use the package did
>>
>> from PIL import Image
>>
>> which resulted in the stacktrace:
>>
>> Traceback (most recent call last):
>> File
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\restricted.py",
>> line 219, in restricted
>> exec(ccode, environment)
>> File
>> "C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
>> , line
>> 2691, in 
>> File
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\globals.py",
>> line 430, in 
>> self._caller = lambda f: f()
>> File
>> "C:/Users/Dave/web2py_win/web2py_win_2.21.1_py27/web2py/applications/badlist/controllers/default.py"
>> , line
>> 1059, in display
>> img = Image.open(deep_path)
>> File
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
>> line 2807, in open
>> if init():
>> File
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\Image.py",
>> line 427, in init
>> __import__("PIL.%s" % plugin, globals(), locals(), [])
>> File
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\gluon\custom_import.py",
>> line 59, in custom_importer
>> return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
>> File
>> "C:\Users\Dave\web2py_win\web2py_win_2.21.1_py27\web2py\site-packages\PIL\EpsImagePlugin.py",
>> line 51, in 
>> which = distutils.spawn.find_executable
>> AttributeError: 'module' object has no attribute 'spawn'
>>
>> What are my options here, and what is the simplest way to get past this?
>> Should I
>>
>> * try to get the appropriate distutils?
>> * try to run web2py from source on the standalone 2.7?
>> * try to run web2py-win's 3.x and switch to the matching Pillow?
>>
>> (I think I have a standalone 3.10 already, but I haven't run Pillow on
>> that)
>>
>> Thanks for the sage advice.
>>
>> /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/b35e69b6-9151-43d3-895a-faf05c03607fn%40googlegroups.com
> 
> .
>

-- 
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/CAAE8D_Bd7%2BkAU%2BO92sC_Jfx5SxFOhhzQ5drEBLzzJmvU%3Dxqwuw%40mail.gmail.com.


Re: [web2py] Re: Do we have Plugin solid form upgraded code for python 3 ?

2022-04-04 Thread Rahul
Hey All,
   This is *finally fixed.* I spent some time debugging on it 
today. The fix was actually very simple, all I had to do was to convert 
some values to integer. Here is the final fixed version on 
*plugin_solidform.py. 
*For all the folks who want to use this awesome plugin with python 3.x.x 
can give it a try. 

[image: working.png]

*Thanks snide.. and all*


Regards,

*Rahul*

On Sunday, April 3, 2022 at 11:07:05 PM UTC+5:30 snide...@gmail.com wrote:

> On Friday, March 25, 2022 at 11:14:07 PM UTC-7 Rahul wrote:
>
>> yes I used some things like *trunc *or *ceil *to fix it however the 
>> error persists on the same line. Pretty weird. Also used what was suggested 
>> like // 
>> but did not work for me. I want to get this fixed soon. However, 
>>  If its not possible to fix it "quickly" perhaps someone can suggest me 
>> some plugin to manage fields in the layout for proper UI orientation. 
>>
>> All suggestions are welcome
>>
>> Regards,
>> *Rahul*
>>
>>
>
> Have you examined the type of structured_fields and it's components at 
> the time of the exception?  I would add some debug prints just before the 
> for statement.
>
> /dps
>
> On Thursday, March 24, 2022 at 4:51:46 PM UTC+5:30 snide...@gmail.com 
>> wrote:
>>
>>> On Thursday, March 24, 2022 at 3:21:01 AM UTC-7 Massimiliano wrote:
>>>
 This could be one problem:

 for i in range((max_row_lines - extra_colspan) / colspan):

 there are many of this. 

 *range* take an integer, but a division in python3 return a float...


>>> Interesting, but why doesn't the exception occur in the quoted line with 
>>> the range statement?
>>>
>>> The stack trace suggests it occurs after the for loop completes.
>>>
>>> (I' also dizzy from the number of places where self.structured fields 
>>> get redone by enumerating itself)
>>>
>>> /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/22201292-5249-4f25-a15d-84cdfef0840an%40googlegroups.com.
# -*- coding: utf-8 -*-
# This plugins is licensed under the MIT license: 
http://www.opensource.org/licenses/mit-license.php
# Authors: Kenji Hosoda 
from gluon import *
import copy


class SOLIDFORM(SQLFORM):

def __init__(self, *args, **kwds):
self.structured_fields = kwds.get('fields')
self.showid = kwds.get('showid', True)

table = args and args[0] or kwds['table']
if not self.structured_fields:
self.structured_fields = [f.name for f in table if self._is_show(f)]
else:
self.structured_fields = copy.copy(self.structured_fields)
_precedent_row_len = 1

include_id = False
flat_fields = []
max_row_lines = 1

for i, inner in enumerate(self.structured_fields):

if type(inner) in (list, tuple):
_inner = []
for field in inner:
   
if field == 'id':
include_id = True
self.showid = True
if field and self._is_show(table[field]):
flat_fields.append(field)
_inner.append(field)
self.structured_fields[i] = _inner
max_row_lines = max(len(_inner), max_row_lines)

_precedent_row_len = len(_inner)
elif inner:
if inner == 'id':
include_id = True
self.showid = True
if self._is_show(table[inner]):
flat_fields.append(inner)
else:
self.structured_fields[i] = None
else:
self.structured_fields[i] = [inner for i in 
range(_precedent_row_len)]


self.structured_fields = [e for e in self.structured_fields if e or e 
is None]
  

row_spans = dict((e, 1) for e in flat_fields)
col_spans = dict((e, 1) for e in flat_fields)

row_lines = [[] for i in range(max_row_lines)]
for row_no, inner in enumerate(self.structured_fields):
if type(inner) in (list, tuple):
num_lines = len(inner)
colspan = int(max_row_lines / num_lines)
   
extra_colspan = max_row_lines % num_lines 


for i in range( int((max_row_lines - extra_colspan) / colspan)):
field = inner[i]
if field:

Re: [web2py] Re: Do we have Plugin solid form upgraded code for python 3 ?

2022-04-03 Thread Dave S

On Friday, March 25, 2022 at 11:14:07 PM UTC-7 Rahul wrote:

> yes I used some things like *trunc *or *ceil *to fix it however the error 
> persists on the same line. Pretty weird. Also used what was suggested like 
> // 
> but did not work for me. I want to get this fixed soon. However, 
>  If its not possible to fix it "quickly" perhaps someone can suggest me 
> some plugin to manage fields in the layout for proper UI orientation. 
>
> All suggestions are welcome
>
> Regards,
> *Rahul*
>
>

Have you examined the type of structured_fields and it's components at the 
time of the exception?  I would add some debug prints just before the for 
statement.

/dps

On Thursday, March 24, 2022 at 4:51:46 PM UTC+5:30 snide...@gmail.com wrote:
>
>> On Thursday, March 24, 2022 at 3:21:01 AM UTC-7 Massimiliano wrote:
>>
>>> This could be one problem:
>>>
>>> for i in range((max_row_lines - extra_colspan) / colspan):
>>>
>>> there are many of this. 
>>>
>>> *range* take an integer, but a division in python3 return a float...
>>>
>>>
>> Interesting, but why doesn't the exception occur in the quoted line with 
>> the range statement?
>>
>> The stack trace suggests it occurs after the for loop completes.
>>
>> (I' also dizzy from the number of places where self.structured fields get 
>> redone by enumerating itself)
>>
>> /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/66548933-081a-4894-9a69-b6e38a58dfe6n%40googlegroups.com.


Re: [web2py] Re: Centos 7 uwsgi no driver for psycopg2

2022-04-03 Thread urban....@gmail.com
I think we've somehow solved this issue. I will report back tomorrow or 
when I'm sure what exactly we did.  

On Saturday, April 2, 2022 at 8:29:32 AM UTC+2 Clemens wrote:

> I think, that Jims answer is right. Have a try sudo-pip psycopg2 (--> sudo 
> -H)
>
> Regards
> Clemens
>
> On 31.03.22 18:33, urban@gmail.com wrote:
>
> Am I correct in assuming this error is occurring because python is unable 
> to import the module and so web2py is trying to import it from local 
> modules: 
>
>   File "/opt/web2py/gluon/custom_import.py", line 78, in custom_importer
> result = sys.modules[modules_prefix]
> KeyError: 'applications.welcome.modules.psycopg2'
>
> On Thursday, March 31, 2022 at 5:02:20 PM UTC+2 Jim S wrote:
>
>> I only mentioned that in case there were different versions of psycopg2 
>> in the user home vs the system one.  That could have caused some issues but 
>> since all are pre-3.1 it seems like it shouldn't cause a problem. 
>>
>> -Jim
>>
>> On Thursday, March 31, 2022 at 9:52:06 AM UTC-5 urban@gmail.com 
>> wrote:
>>
>>> Upon inspection it seems psycopg2 is installed at 3 locations. .
>>>
>>> */home/ouruser/.local/lib/python3.6/site-packages/psycopg2*
>>> */usr/local/lib64/python3.6/site-packages*
>>> *AND*
>>>
>>> */usr/lib64/python3.6/site-packages/psycopg2 *
>>>
>>> Two first two are 2.9.3 and the last one is 2.8.6.
>>>
>>> When I log the packages using this code
>>> import pkg_resources
>>> pkgs = str({p.project_name: p.version for p in 
>>> pkg_resources.working_set})
>>>
>>> I get 'psycopg2': '2.9.3' among others. However, importing it does not 
>>> work. 
>>>
>>> Perhaps we should try with a newer version of python again with sudo pip 
>>> install. Though if it were a compatibility problem I don't see why it 
>>> should work without wsgi. 
>>> On Thursday, March 31, 2022 at 4:20:45 PM UTC+2 Jim S wrote:
>>>
 You don't have different versions of psycopg2 in the ourusr vs system 
 drivers do you?  Looks like newer versions of psycopg2 no longer support 
 python 3.6 

 https://www.psycopg.org/psycopg3/docs/basic/install.html



 On Thursday, March 31, 2022 at 9:01:24 AM UTC-5 urban@gmail.com 
 wrote:

> Thank you for the reply! 
>
> I believe we've already tried sudo pip install psycopg2. 
> Psycopg2 seems to be located at 
> */usr/local/lib64/python3.6/site-packages*
> Other packages that don't exhibit the same problem are also there. 
> There's another installation of psycopg2 in
> */home/ouruser/.local/lib/python3.6/site-packages/psycopg2*
>
> I'm not sure about the user running the process, but I think it isn't 
> root. I'll have to check that with the colleague chiefly wrestling with 
> this migration.  
>
> Yes, we're going to move to a newer version. In fact we started on a 
> newer version but ran into this problem. We're now on 3.6 because we were 
> checking if the problem would persist since 3.6 was the default python3 
> on 
> the machine. 
>
> It's interesting that this is an issue in particular with psycopg2.
>
> On Thursday, March 31, 2022 at 2:21:42 PM UTC+2 Jim S wrote:
>
>> When I've run into similar situations on Ubuntu the resolution was to 
>> install the package using sudo.  If you just pip installed the package 
>> under your user then I believe it is stored in 
>> .local/lib/python3.x/site-packages in the user home directory.
>>
>> This would explain why it works when you run it interactively.  What 
>> user is running your uwsgi process?  
>>
>> Also, if possible I'd move to a newer version of python3.  Python 3.6 
>> is end-of-life as of 12/23/2021
>>
>> -Jim
>>
>>
>> On Thursday, March 31, 2022 at 6:24:32 AM UTC-5 urban@gmail.com 
>> wrote:
>>
>>> Hi,
>>>
>>> Trying to setup web2py, python3 centos 7, nginx, uwsgi.
>>>
>>> The application is already running on centos 7 with python 2.7.
>>>
>>> With python 3.6 I get the following error:
>>>
>>> class 'RuntimeError'> Failure to connect, tried 5 times:
>>> Traceback (most recent call last):
>>>   File "/opt/web2py/gluon/packages/dal/pydal/base.py", line 514, in 
>>> __init__
>>> self._adapter = adapter(**kwargs)
>>>   File "/opt/web2py/gluon/packages/dal/pydal/adapters/postgres.py", 
>>> line 28, in __call__
>>> return AdapterMeta.__call__(cls, *args, **kwargs)
>>>   File "/opt/web2py/gluon/packages/dal/pydal/adapters/__init__.py", 
>>> line 41, in __call__
>>> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>>>   File "/opt/web2py/gluon/packages/dal/pydal/adapters/postgres.py", 
>>> line 67, in __init__
>>> after_connection,
>>>   File "/opt/web2py/gluon/packages/dal/pydal/adapters/base.py", line 
>>> 424, in __init__
>>> super(SQLAdapter, self).__init__(*args, **kwargs)

Re: [web2py] Re: Do we have Plugin solid form upgraded code for python 3 ?

2022-04-02 Thread Rahul
Do we have alternatives to this feature  ? 

Rahul

On Saturday, March 26, 2022 at 11:44:07 AM UTC+5:30 Rahul wrote:

> yes I used some things like *trunc *or *ceil *to fix it however the error 
> persists on the same line. Pretty weird. Also used what was suggested like 
> // 
> but did not work for me. I want to get this fixed soon. However, 
>  If its not possible to fix it "quickly" perhaps someone can suggest me 
> some plugin to manage fields in the layout for proper UI orientation. 
>
> All suggestions are welcome
>
> Regards,
> *Rahul*
>
> On Thursday, March 24, 2022 at 4:51:46 PM UTC+5:30 snide...@gmail.com 
> wrote:
>
>> On Thursday, March 24, 2022 at 3:21:01 AM UTC-7 Massimiliano wrote:
>>
>>> This could be one problem:
>>>
>>> for i in range((max_row_lines - extra_colspan) / colspan):
>>>
>>> there are many of this. 
>>>
>>> *range* take an integer, but a division in python3 return a float...
>>>
>>>
>> Interesting, but why doesn't the exception occur in the quoted line with 
>> the range statement?
>>
>> The stack trace suggests it occurs after the for loop completes.
>>
>> (I' also dizzy from the number of places where self.structured fields get 
>> redone by enumerating itself)
>>
>> /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/675bd526-d362-447d-80d7-df5657983ba1n%40googlegroups.com.


Re: [web2py] Re: Centos 7 uwsgi no driver for psycopg2

2022-04-02 Thread Dr. Clemens R. Odendahl

  
  
I think, that Jims answer is
right. Have a try sudo-pip psycopg2 (--> sudo -H)

Regards
Clemens
  
On 31.03.22 18:33, urban@gmail.com
  wrote:


  
  Am I correct in assuming this error is occurring because python is
  unable to import the module and so web2py is trying to import it
  from local modules:
  


  File "/opt/web2py/gluon/custom_import.py", line 78, in
  custom_importer
      result = sys.modules[modules_prefix]
  KeyError: 'applications.welcome.modules.psycopg2'

  
  
On Thursday, March 31, 2022
  at 5:02:20 PM UTC+2 Jim S wrote:

I
  only mentioned that in case there were different versions of
  psycopg2 in the user home vs the system one.  That could have
  caused some issues but since all are pre-3.1 it seems like it
  shouldn't cause a problem.
  
  
  -Jim

  
  
On Thursday, March 31,
  2022 at 9:52:06 AM UTC-5 urban@gmail.com
  wrote:

Upon inspection it
  seems psycopg2 is installed at 3 locations. .
  
  /home/ouruser/.local/lib/python3.6/site-packages/psycopg2
  
  /usr/local/lib64/python3.6/site-packages

  AND
  /usr/lib64/python3.6/site-packages/psycopg2

  

  Two first two are 2.9.3 and the last one is 2.8.6.
  
  
  When I log the packages using this code
  import pkg_resources
pkgs = str({p.project_name: p.version for p in
pkg_resources.working_set})
  
  
  
  I get 'psycopg2': '2.9.3' among others. However,
importing it does not work. 
  
  
  Perhaps we should try with a newer version of python
again with sudo pip install. Though if it were a
compatibility problem I don't see why it should work
without wsgi. 
  
On Thursday, March
  31, 2022 at 4:20:45 PM UTC+2 Jim S wrote:

You don't have
  different versions of psycopg2 in the ourusr vs system
  drivers do you?  Looks like newer versions of psycopg2
  no longer support python 3.6
  
  
  https://www.psycopg.org/psycopg3/docs/basic/install.html
  
  
  

  
  
On Thursday,
  March 31, 2022 at 9:01:24 AM UTC-5 urban@gmail.com
  wrote:

Thank you for
  the reply!
  
  
  I believe we've already tried sudo pip
install psycopg2. 
  Psycopg2 seems to be located at /usr/local/lib64/python3.6/site-packages
  Other packages that don't exhibit the same
problem are also there. 
  There's another installation of psycopg2 in
  /home/ouruser/.local/lib/python3.6/site-packages/psycopg2
  
  
  
  I'm not sure about the user running the
process, but I think it isn't root. I'll have to
check that with the colleague chiefly wrestling
with this migration.  
  
  
  Yes, we're going to move to a newer version.
In fact we started on a newer version but ran
into this problem. We're now on 3.6 because we
were checking if the problem would persist since
3.6 was the default python3 on the machine. 
  
  
  It's interesting that this is an issue in
particular with psycopg2.
  
  
  
On Thursday,
  March 31, 2022 at 2:21:42 PM UTC+2 Jim S
  wrote:


  When I've run into similar situations on
Ubuntu the resolution was to install the
package using sudo.  If you just pip
installed the package under your user 

Re: [web2py] Re: Do we have Plugin solid form upgraded code for python 3 ?

2022-03-26 Thread Rahul
yes I used some things like *trunc *or *ceil *to fix it however the error 
persists on the same line. Pretty weird. Also used what was suggested like 
// 
but did not work for me. I want to get this fixed soon. However, 
 If its not possible to fix it "quickly" perhaps someone can suggest me 
some plugin to manage fields in the layout for proper UI orientation. 

All suggestions are welcome

Regards,
*Rahul*

On Thursday, March 24, 2022 at 4:51:46 PM UTC+5:30 snide...@gmail.com wrote:

> On Thursday, March 24, 2022 at 3:21:01 AM UTC-7 Massimiliano wrote:
>
>> This could be one problem:
>>
>> for i in range((max_row_lines - extra_colspan) / colspan):
>>
>> there are many of this. 
>>
>> *range* take an integer, but a division in python3 return a float...
>>
>>
> Interesting, but why doesn't the exception occur in the quoted line with 
> the range statement?
>
> The stack trace suggests it occurs after the for loop completes.
>
> (I' also dizzy from the number of places where self.structured fields get 
> redone by enumerating itself)
>
> /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/2e802ab4-233d-45e9-ad27-fdc1bc46157cn%40googlegroups.com.


Re: [web2py] Re: Do we have Plugin solid form upgraded code for python 3 ?

2022-03-24 Thread Dave S


On Thursday, March 24, 2022 at 3:21:01 AM UTC-7 Massimiliano wrote:

> This could be one problem:
>
> for i in range((max_row_lines - extra_colspan) / colspan):
>
> there are many of this. 
>
> *range* take an integer, but a division in python3 return a float...
>
>
Interesting, but why doesn't the exception occur in the quoted line with 
the range statement?

The stack trace suggests it occurs after the for loop completes.

(I' also dizzy from the number of places where self.structured fields get 
redone by enumerating itself)

/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/6983bf12-0a5e-444b-9066-5c86e553730dn%40googlegroups.com.


Re: [web2py] Re: Do we have Plugin solid form upgraded code for python 3 ?

2022-03-24 Thread Massimiliano
This could be one problem:

for i in range((max_row_lines - extra_colspan) / colspan):

there are many of this.

*range* take an integer, but a division in python3 return a float...




Il giorno gio 24 mar 2022 alle ore 09:47 Rahul  ha
scritto:

> anyone has any ideas ?
>
> On Wednesday, March 23, 2022 at 5:13:15 PM UTC+5:30 Rahul wrote:
>
>> Hi All,
>>  I am migrating my python 2.7 project to py 3.7 - I am facing
>> issues with plugin solid form conversion to py3 code. My code uses this
>> plugin a lot. Rest all code works fine except the plugin part - While using
>> it I am getting the error - I tried web recommendations but to no avail -
>> Please suggest !
>>
>>  'float' object cannot be interpreted as an integer
>> Version
>> web2py™
>> Version 2.22.3-stable+timestamp.2022.02.15.15.14.38
>> Python
>> Python 3.7.5: C:\Python37\python.exe (prefix: C:\Python37)Traceback
>>
>> 1.
>> 2.
>> 3.
>> 4.
>> 5.
>> 6.
>> 7.
>> 8.
>> 9.
>> 10.
>> 11.
>> 12.
>> Traceback (most recent call last):
>> File "E:\web2py_src\web2py\gluon\restricted.py", line 219, in restricted
>> exec(ccode, environment)
>> File "E:/web2py_src/web2py/applications/artpic/controllers/default.py"
>> ,
>> line 9599, in 
>> File "E:\web2py_src\web2py\gluon\globals.py", line 430, in 
>> self._caller = lambda f: f()
>> File "E:/web2py_src/web2py/applications/artpic/controllers/default.py"
>> ,
>> line 6200, in contact
>> form = SOLIDFORM(db.contactus, fields=fields, submit_button='Submit')
>> File
>> "E:\web2py_src\web2py\applications\artpic\modules\plugin_solidform.py", line
>> 59, in __init__
>> for row_no, inner in enumerate(self.structured_fields):
>> TypeError: 'float' object cannot be interpreted as an integer
>>
>>
>> Attached is the file
>>
>> also here is the code -
>>
>>
>> # -*- coding: utf-8 -*-
>> # This plugins is licensed under the MIT license:
>> http://www.opensource.org/licenses/mit-license.php#
>> #Authors: Kenji Hosoda 
>> from gluon import *
>> import copy
>> from math import trunc, ceil
>>
>> class SOLIDFORM(SQLFORM):
>> def __init__(self, *args, **kwds):
>> self.structured_fields = kwds.get('fields')
>> self.showid = kwds.get('showid', True)
>> table = args and args[0] or kwds['table']
>> if not self.structured_fields:
>> self.structured_fields = [f.name for f in table if
>> self._is_show(f)]
>> else:
>> self.structured_fields = copy.copy(self.structured_fields)
>> _precedent_row_len = 1
>>
>> include_id = False
>> flat_fields = []
>> max_row_lines = 1
>> for i, inner in enumerate(self.structured_fields):
>> if type(inner) in (list, tuple):
>> _inner = []
>> for field in inner:
>> if field == 'id':
>> include_id = True
>> self.showid = True
>> if field and self._is_show(table[field]):
>> flat_fields.append(field)
>> _inner.append(field)
>> self.structured_fields[i] = _inner
>> max_row_lines = max(len(_inner), max_row_lines)
>> _precedent_row_len = len(_inner)
>> elif inner:
>> if inner == 'id':
>> include_id = True
>> self.showid = True
>> if self._is_show(table[inner]):
>> flat_fields.append(inner)
>> else:
>> self.structured_fields[i] = None
>> else:
>> self.structured_fields[i] = [inner for i in
>> range(_precedent_row_len)]
>> self.structured_fields = [e for e in self.structured_fields if e
>> or e is None]
>> row_spans = dict((e, 1) for e in flat_fields)
>> col_spans = dict((e, 1) for e in flat_fields)
>> row_lines = [[] for i in range(max_row_lines)]
>> for row_no, inner in enumerate(self.structured_fields):
>> if type(inner) in (list, tuple):
>> num_lines = trunc (len(inner))
>> colspan = max_row_lines / num_lines
>> extra_colspan = max_row_lines % num_lines
>> for i in range((max_row_lines - extra_colspan) / colspan):
>> field = inner[i]
>> if field:
>> col_spans[field] = colspan
>> row_lines[i * colspan].append(field)
>> else:
>> for _row_no in reversed(list(range(row_no))):
>> try:
>>
>> row_spans[self.structured_fields[_row_no][i]] += 1
>> break
>> except KeyError:
>> pass
>> if 

Re: [web2py] Re: left outer join

2022-02-20 Thread Jonathan Clark
Hi,

Sorry I hadn't noticed that was what you meant. I was just trying to say
that the book has a section on left joins, like many other topics, which
you might not have seen.

It's a long time since I looked at this, but I thought you could treat a
select as a table for this kind of thing, but I've never done it. So I'll
leave this for more knowledgeable people to answer.

Best wishes.

On Sun, 20 Feb 2022 at 11:33, Al Ex  wrote:

> Thank you
>
> But what if the left join is made on an arbitrary select, not an already
> defined table?
> Maybe I am missing something evident
>
>
>
>
> On February 20, 2022 at 18:15:50, jonatha...@whatho.net (
> jonathan.cl...@whatho.net) wrote:
>
>
> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Left-outer-join
>
> On Saturday, 19 February 2022 at 02:48:35 UTC alex wrote:
>
>> Hi,
>>
>> How can I reproduce this LEFT OUTER JOIN in PyDAL ?
>>
>>
>> SELECT name
>> FROM doc
>>
>> LEFT JOIN (
>>
>> SELECT name
>> FROM X
>> INNER JOIN ...
>> WHERE ...
>> ) T ON ( T.name = name)
>>
>> WHERE
>> T.name IS NULL
>>
>>
>> --
> 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/3e47a5ea-6048-4ea6-a376-b150083a7c31n%40googlegroups.com
> 
> .
>
>

-- 
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/CAHPvVMbQnqrwURpCXJ8r8yi3euDbZjLBtqVs_po0NSnvDP2vtw%40mail.gmail.com.


Re: [web2py] Re: left outer join

2022-02-20 Thread Al Ex
Thank you

But what if the left join is made on an arbitrary select, not an already
defined table?
Maybe I am missing something evident




On February 20, 2022 at 18:15:50, jonatha...@whatho.net (
jonathan.cl...@whatho.net) wrote:

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Left-outer-join

On Saturday, 19 February 2022 at 02:48:35 UTC alex wrote:

> Hi,
>
> How can I reproduce this LEFT OUTER JOIN in PyDAL ?
>
>
> SELECT name
> FROM doc
>
> LEFT JOIN (
>
> SELECT name
> FROM X
> INNER JOIN ...
> WHERE ...
> ) T ON ( T.name = name)
>
> WHERE
> T.name IS NULL
>
>
> --
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/3e47a5ea-6048-4ea6-a376-b150083a7c31n%40googlegroups.com

.

-- 
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/CAKC%3DaX7WPgAYJdcdU9CaJvQfRWCRgutWzezW8gFh32xkjGAGkQ%40mail.gmail.com.


Re: [web2py] Re: LOAD in py4web

2022-02-17 Thread cdbaron
Thanks a lot.

I'll try load_and_trap, but I think htmx may be better. I will look at your 
applications.

El jueves, 17 de febrero de 2022 a las 0:10:33 UTC+1, Jim S escribió:

> See this thread for how to replicate LOAD in py4web - 
> https://groups.google.com/u/1/g/py4web/c/EUpv9IRJ_eo/m/niHzrnR5AwAJ
>
> In short, use load_and_trap from utils.js.
>
> I was using this for a while but then transitioned to doing all my 
> reactive-type functions using htmx.  https://htmx.org
>
> Check out my py4web htmx demo - 
> https://github.com/jpsteil/py4web_htmx_demo
>
> or my sample SouthBreeze application 
> https://github.com/jpsteil/southbreeze  for examples.
>
> htmx is amazing
>
> NOTE - demos might now work with the latest py4web from github.  There are 
> some changes I need to apply to my code that I haven't gotten to yet.
>
> Can anyone else address the "A" and "URL" questions?
>
> -Jim
>
>
> On Tuesday, February 15, 2022 at 3:47:24 PM UTC-6 cdbaron wrote:
>
>> I have several projects with web2py and I have already started to study 
>> the possibility of migrating to py4web.
>>
>> They are all rendered on the server side and for now I want to keep it 
>> that way.
>>
>> I see some challenges that make me a little scared:
>>
>> *LOAD
>> * A Helper: (many times with the callback parameter and others with _href)
>> * URL: With user_signature=True for links with callback
>>
>> I use hundreds of times A and URL and a little less LOAD
>>
>> For none of these functions or helpers have I found a direct replacement 
>> in py4web.
>>
>> LOAD does not exist in py4web, A does not have the possibility of ajax 
>> calls with the callback parameter and URL is totally different in py4web.
>>
>> It would be great to see some of this web2py magic carried over to py4web.
>>
>> El domingo, 6 de febrero de 2022 a las 15:37:49 UTC+1, vinid...@gmail.com 
>> escribió:
>>
>>> Have you managed to make a welcome template based on Unpoly?
>>>
>>> On Wednesday, March 4, 2020 at 8:37:51 PM UTC+7 yamand...@gmail.com 
>>> wrote:
>>>
 Sorry for the typo.
 I want to make a welcome template based on unpoly soon.

 Em sex., 28 de fev. de 2020 às 04:21, AGRogers  
 escreveu:

> https://unpoly.com/  
>
> On Fri, 28 Feb 2020 at 16:22, Massimo Di Pierro  
> wrote:
>
>> never heard of unpolly.js and cannot find it. Have a link?
>>
>>
>> On Wednesday, 26 February 2020 19:32:20 UTC-8, Carlos Costa wrote:
>>>
>>> LOAD is a very cool thing! And beginners just say WOW when they can 
>>> create ajax-like experience so easy.
>>> But, IMO, it lacks some important features for modern apps, like 
>>> error handling and history handling.
>>>
>>> I have written some simple functions to help cover these things...
>>>
>>> Another way I found very useful was to use unpolly.js. It's magic 
>>> but makes me a little lazyer about getting things done with vue.js.
>>> (BTW they created unpolly to avoid using things like vue, react, 
>>> etc, really!)
>>>
>>> I would like very much to use vue.js but I am still noob regarding 
>>> how to use it with py4web.
>>> Maybe we should really encourage vue.js and stuff alike... but an 
>>> initial pattern would be cool.
>>> And IMO it should be simple and very cleared stated in the docs.
>>> So no one will miss LOAD.
>>>
>>> Em domingo, 23 de fevereiro de 2020 15:18:51 UTC-3, RHC escreveu:

 HI,

 I am beginning to experiment with py4web, I like the sound of it 
 and I am looking to convert a web2py project to py4web to see how they 
 compare.

 It appears that the LOAD (helper?) that was available in web2py 
 templates is not available in py4web. I was using this to populate 
 part of 
 a web page, I liked the way you had the option to use LOAD to call a 
 separate URL (within the same app) and insert the result into your 
 page 
 before returning the page to the client.

 What is the reason for the absence of LOAD in py4web? is there a 
 recommended alternative method of achieving the same effect? I have 
 used a 
 mixture of ajax=True and ajax=False options for this feature.

 Thanks,

 Richard.

>>> -- 
>> 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.
>> To view this discussion on the web visit 
>> 

Re: [web2py] Re: LOAD in py4web

2022-02-16 Thread Jim S
See this thread for how to replicate LOAD in py4web - 
https://groups.google.com/u/1/g/py4web/c/EUpv9IRJ_eo/m/niHzrnR5AwAJ

In short, use load_and_trap from utils.js.

I was using this for a while but then transitioned to doing all my 
reactive-type functions using htmx.  https://htmx.org

Check out my py4web htmx demo - https://github.com/jpsteil/py4web_htmx_demo

or my sample SouthBreeze application 
https://github.com/jpsteil/southbreeze  for examples.

htmx is amazing

NOTE - demos might now work with the latest py4web from github.  There are 
some changes I need to apply to my code that I haven't gotten to yet.

Can anyone else address the "A" and "URL" questions?

-Jim


On Tuesday, February 15, 2022 at 3:47:24 PM UTC-6 cdbaron wrote:

> I have several projects with web2py and I have already started to study 
> the possibility of migrating to py4web.
>
> They are all rendered on the server side and for now I want to keep it 
> that way.
>
> I see some challenges that make me a little scared:
>
> *LOAD
> * A Helper: (many times with the callback parameter and others with _href)
> * URL: With user_signature=True for links with callback
>
> I use hundreds of times A and URL and a little less LOAD
>
> For none of these functions or helpers have I found a direct replacement 
> in py4web.
>
> LOAD does not exist in py4web, A does not have the possibility of ajax 
> calls with the callback parameter and URL is totally different in py4web.
>
> It would be great to see some of this web2py magic carried over to py4web.
>
> El domingo, 6 de febrero de 2022 a las 15:37:49 UTC+1, vinid...@gmail.com 
> escribió:
>
>> Have you managed to make a welcome template based on Unpoly?
>>
>> On Wednesday, March 4, 2020 at 8:37:51 PM UTC+7 yamand...@gmail.com 
>> wrote:
>>
>>> Sorry for the typo.
>>> I want to make a welcome template based on unpoly soon.
>>>
>>> Em sex., 28 de fev. de 2020 às 04:21, AGRogers  
>>> escreveu:
>>>
 https://unpoly.com/  

 On Fri, 28 Feb 2020 at 16:22, Massimo Di Pierro  
 wrote:

> never heard of unpolly.js and cannot find it. Have a link?
>
>
> On Wednesday, 26 February 2020 19:32:20 UTC-8, Carlos Costa wrote:
>>
>> LOAD is a very cool thing! And beginners just say WOW when they can 
>> create ajax-like experience so easy.
>> But, IMO, it lacks some important features for modern apps, like 
>> error handling and history handling.
>>
>> I have written some simple functions to help cover these things...
>>
>> Another way I found very useful was to use unpolly.js. It's magic but 
>> makes me a little lazyer about getting things done with vue.js.
>> (BTW they created unpolly to avoid using things like vue, react, etc, 
>> really!)
>>
>> I would like very much to use vue.js but I am still noob regarding 
>> how to use it with py4web.
>> Maybe we should really encourage vue.js and stuff alike... but an 
>> initial pattern would be cool.
>> And IMO it should be simple and very cleared stated in the docs.
>> So no one will miss LOAD.
>>
>> Em domingo, 23 de fevereiro de 2020 15:18:51 UTC-3, RHC escreveu:
>>>
>>> HI,
>>>
>>> I am beginning to experiment with py4web, I like the sound of it and 
>>> I am looking to convert a web2py project to py4web to see how they 
>>> compare.
>>>
>>> It appears that the LOAD (helper?) that was available in web2py 
>>> templates is not available in py4web. I was using this to populate part 
>>> of 
>>> a web page, I liked the way you had the option to use LOAD to call a 
>>> separate URL (within the same app) and insert the result into your page 
>>> before returning the page to the client.
>>>
>>> What is the reason for the absence of LOAD in py4web? is there a 
>>> recommended alternative method of achieving the same effect? I have 
>>> used a 
>>> mixture of ajax=True and ajax=False options for this feature.
>>>
>>> Thanks,
>>>
>>> Richard.
>>>
>> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/web2py/22d8b9cf-9ce2-464b-809e-32d4dd84fd02%40googlegroups.com
>  
> 
> .
>
 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)

Re: [web2py] Re: LOAD in py4web

2022-02-15 Thread cdbaron
I have several projects with web2py and I have already started to study the 
possibility of migrating to py4web.

They are all rendered on the server side and for now I want to keep it that 
way.

I see some challenges that make me a little scared:

*LOAD
* A Helper: (many times with the callback parameter and others with _href)
* URL: With user_signature=True for links with callback

I use hundreds of times A and URL and a little less LOAD

For none of these functions or helpers have I found a direct replacement in 
py4web.

LOAD does not exist in py4web, A does not have the possibility of ajax 
calls with the callback parameter and URL is totally different in py4web.

It would be great to see some of this web2py magic carried over to py4web.

El domingo, 6 de febrero de 2022 a las 15:37:49 UTC+1, vinid...@gmail.com 
escribió:

> Have you managed to make a welcome template based on Unpoly?
>
> On Wednesday, March 4, 2020 at 8:37:51 PM UTC+7 yamand...@gmail.com wrote:
>
>> Sorry for the typo.
>> I want to make a welcome template based on unpoly soon.
>>
>> Em sex., 28 de fev. de 2020 às 04:21, AGRogers  
>> escreveu:
>>
>>> https://unpoly.com/  
>>>
>>> On Fri, 28 Feb 2020 at 16:22, Massimo Di Pierro  
>>> wrote:
>>>
 never heard of unpolly.js and cannot find it. Have a link?


 On Wednesday, 26 February 2020 19:32:20 UTC-8, Carlos Costa wrote:
>
> LOAD is a very cool thing! And beginners just say WOW when they can 
> create ajax-like experience so easy.
> But, IMO, it lacks some important features for modern apps, like error 
> handling and history handling.
>
> I have written some simple functions to help cover these things...
>
> Another way I found very useful was to use unpolly.js. It's magic but 
> makes me a little lazyer about getting things done with vue.js.
> (BTW they created unpolly to avoid using things like vue, react, etc, 
> really!)
>
> I would like very much to use vue.js but I am still noob regarding how 
> to use it with py4web.
> Maybe we should really encourage vue.js and stuff alike... but an 
> initial pattern would be cool.
> And IMO it should be simple and very cleared stated in the docs.
> So no one will miss LOAD.
>
> Em domingo, 23 de fevereiro de 2020 15:18:51 UTC-3, RHC escreveu:
>>
>> HI,
>>
>> I am beginning to experiment with py4web, I like the sound of it and 
>> I am looking to convert a web2py project to py4web to see how they 
>> compare.
>>
>> It appears that the LOAD (helper?) that was available in web2py 
>> templates is not available in py4web. I was using this to populate part 
>> of 
>> a web page, I liked the way you had the option to use LOAD to call a 
>> separate URL (within the same app) and insert the result into your page 
>> before returning the page to the client.
>>
>> What is the reason for the absence of LOAD in py4web? is there a 
>> recommended alternative method of achieving the same effect? I have used 
>> a 
>> mixture of ajax=True and ajax=False options for this feature.
>>
>> Thanks,
>>
>> Richard.
>>
> -- 
 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.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/22d8b9cf-9ce2-464b-809e-32d4dd84fd02%40googlegroups.com
  
 
 .

>>> -- 
>>> 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.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/CACWMBMPXoWfp9iZ7yQtbCw_YU6yh-9M2_xAQ%3Dzj4ocyWTzxuXw%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>
>>
>> -- 
>> At.
>>
>> Carlos J. Costa
>> --
>> Cientista da Computação - Esp. Gestão em Telecom
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- 

Re: [web2py] Re: LOAD in py4web

2022-02-06 Thread Alexei Vinidiktov
Have you managed to make a welcome template based on Unpoly?

On Wednesday, March 4, 2020 at 8:37:51 PM UTC+7 yamand...@gmail.com wrote:

> Sorry for the typo.
> I want to make a welcome template based on unpoly soon.
>
> Em sex., 28 de fev. de 2020 às 04:21, AGRogers  
> escreveu:
>
>> https://unpoly.com/  
>>
>> On Fri, 28 Feb 2020 at 16:22, Massimo Di Pierro  
>> wrote:
>>
>>> never heard of unpolly.js and cannot find it. Have a link?
>>>
>>>
>>> On Wednesday, 26 February 2020 19:32:20 UTC-8, Carlos Costa wrote:

 LOAD is a very cool thing! And beginners just say WOW when they can 
 create ajax-like experience so easy.
 But, IMO, it lacks some important features for modern apps, like error 
 handling and history handling.

 I have written some simple functions to help cover these things...

 Another way I found very useful was to use unpolly.js. It's magic but 
 makes me a little lazyer about getting things done with vue.js.
 (BTW they created unpolly to avoid using things like vue, react, etc, 
 really!)

 I would like very much to use vue.js but I am still noob regarding how 
 to use it with py4web.
 Maybe we should really encourage vue.js and stuff alike... but an 
 initial pattern would be cool.
 And IMO it should be simple and very cleared stated in the docs.
 So no one will miss LOAD.

 Em domingo, 23 de fevereiro de 2020 15:18:51 UTC-3, RHC escreveu:
>
> HI,
>
> I am beginning to experiment with py4web, I like the sound of it and I 
> am looking to convert a web2py project to py4web to see how they compare.
>
> It appears that the LOAD (helper?) that was available in web2py 
> templates is not available in py4web. I was using this to populate part 
> of 
> a web page, I liked the way you had the option to use LOAD to call a 
> separate URL (within the same app) and insert the result into your page 
> before returning the page to the client.
>
> What is the reason for the absence of LOAD in py4web? is there a 
> recommended alternative method of achieving the same effect? I have used 
> a 
> mixture of ajax=True and ajax=False options for this feature.
>
> Thanks,
>
> Richard.
>
 -- 
>>> 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.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/22d8b9cf-9ce2-464b-809e-32d4dd84fd02%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/CACWMBMPXoWfp9iZ7yQtbCw_YU6yh-9M2_xAQ%3Dzj4ocyWTzxuXw%40mail.gmail.com
>>  
>> 
>> .
>>
>
>
> -- 
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a94a7f90-df6a-4f3f-bb04-05bc44e86509n%40googlegroups.com.


Re: [web2py] Re: DataTable() not a function

2021-12-23 Thread Jim Steil
If you look at your page source can you see what is being rendered for
[[=results]] in your script section?

Jim


On Thu, Dec 23, 2021, 6:38 PM Dave S  wrote:

>
> On Tuesday, December 21, 2021 at 1:05:08 PM UTC-8 Jim S wrote:
>
>> I wish I could help, but I'm not javascript guru.  That's why I've moved
>> to py4web, grid and htmx.
>>
>> Do you have the datatables .css and .js files loaded?
>> jquery.dataTables.min.js is not all that you need.
>>
>> cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css
>> cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js
>>
>> -Jim
>>
>>
>
> Thank you, that was a useful clue.  I am now able to get it to draw the
> table.  Next, figuring out why the data isn't showing.
>
> /dps
>
>
>
>
>> On Monday, December 20, 2021 at 10:01:32 PM UTC-6 snide...@gmail.com
>> wrote:
>>
>>> Jim?  Other datatable gurus?
>>>
>>> /dps
>>>
>>>
>>> On Thursday, December 2, 2021 at 4:30:20 AM UTC-8 Dave S wrote:
>>>
 That's the error I'm getting, according to Chrome's console.

 The view code is pretty simple:

 
 var table;
 $(document).ready(function(){
table = $('#tableXactions').DataTable( {
"data": {{=results}} ,
"columns": [
 /* { data: 'xaction.PostDate'}, */
  { data: 'xaction.Id' },
  { data: 'xaction.Amount' },
  { data: 'xaction.Expense' },
  { data: 'xaction.Tag' }

 ]

 });

  });
 

 


   Id
   Amount
   Expense
   Tag

 
 
 

 The console shows that jquery.dataTables.min.js (and the css) is loaded
 from the datatables.net cdn (1.10.19, not the latest but close).  Both
 my debug code and the console show that my results are as expected, so I
 don't think the controller is where I messed up.

 The actual console message is

 listing:96 Uncaught TypeError: $(...).DataTable is not a function
 at HTMLDocument. (listing:96)
 at i (jquery.js:2)
 at Object.fireWith [as resolveWith] (jquery.js:2)
 at Function.ready (jquery.js:2)
 at HTMLDocument.K (jquery.js:2)
 (listing is my view/default/listing.html)

 I get this error even if I have no options in the DataTable() call.
 (And I should be using DataTable(), not the dataTable() version, right?
 Equivalent, but different return types)

 I have Roger's example, but it's much more complex than I'm ready for.
 The sample on web2pyslices.com is about right, but uses a much older
 version.  The examples on datatables.net are snippets that they assume
 you know where to put them.

 What's the fix for my mistake (or at least, what's my mistake?)

 /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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/L6M5EBRE1kM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/b7bb9aa4-968e-4431-9daf-1b4dab898c80n%40googlegroups.com
> 
> .
>

-- 
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/CAERBpoCU26YU_ttx7TmCw9c9deCufDepRKV1pQsZqYh5MCNM9w%40mail.gmail.com.


Re: [web2py] Re: Error ticket for "admin" when trying to create a view

2021-12-20 Thread Dave S
On Friday, December 17, 2021 at 9:12:55 AM UTC-8 mostwanted wrote:

> This is happening on a live app, its live, hosted on pythonanywhere. I am 
> starting to suspect something though, I recently received an email from 
> pythonanywhere.com informing me that I should change  the system image of 
> my app because my app is running on an old one called "dangermouse", in a 
> year's time that system image will be absolute so I was encouraged to use a 
> new one & I changed it. But they also warned that  my code might need 
> modification to run with the new system image & i am starting to suspect 
> that the system image i chose is the one affecting the normal functionality 
> of my app Just suspicions because before i changed my system image all 
> was good.
>
>
Did the python version change when you changed system images?  

Also, in the ticket you may be able to see which of request.vars.sender and 
anchor is the null value.

Dave S
/dps


 

> On Friday, December 17, 2021 at 2:52:22 PM UTC+2 Jim S wrote:
>
>> Is it possible your were no longer logged in or that you cleared your 
>> browser cache before this happened?
>>
>> Sense really weird. Have you tried with a fresh install of web2py?
>>
>> Jim
>>
>> On Fri, Dec 17, 2021, 5:56 AM mostwanted  wrote:
>>
>>> But that's just the thing, I wasn't trying pass any data, i just trying 
>>> to create a new view for a new function In my admin interface, as soon as I 
>>> clicked create the error popped up & the view failed to create.
>>>
>>> On Thursday, December 16, 2021 at 7:31:55 PM UTC+2 Jim S wrote:
>>>
 Looks like you're passing some data through the request vars and the 
 value is Null.  Would need to see more code to be able to help.

 -Jim

 On Wednesday, December 15, 2021 at 12:09:08 AM UTC-6 mostwanted wrote:

> Hi guys, I'm updating one of my very early projects, I was trying to 
> create a view and I got an error:  Error ticket for "admin", I dont 
> know what's causing it, how do I fix this? Its a new error that I have 
> never encountered before, thats the traceback below. I developed it with  
> Version 2.14.6
>
> Traceback
> Traceback (most recent call last):
> File "/home/sesoa/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
> File "/home/sesoa/web2py/applications/admin/controllers/default.py" 
> ,
>  
> line 2000, in 
> File "/home/sesoa/web2py/gluon/globals.py", line 417, in 
> self._caller = lambda f: f()
> File "/home/sesoa/web2py/applications/admin/controllers/default.py" 
> ,
>  
> line 1484, in create_file
> redirect(request.vars.sender + anchor)
> TypeError: unsupported operand type(s) for +: 'NoneType' and '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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/e58c8d44-a412-4f13-ad68-bfea6bc4c6b5n%40googlegroups.com.


Re: [web2py] Re: Error ticket for "admin" when trying to create a view

2021-12-17 Thread Jim Steil
Yes, I would suspect the image off that is the main thing that changed.

Jim

On Fri, Dec 17, 2021, 11:13 AM mostwanted  wrote:

> This is happening on a live app, its live, hosted on pythonanywhere. I am
> starting to suspect something though, I recently received an email from
> pythonanywhere.com informing me that I should change  the system image of
> my app because my app is running on an old one called "dangermouse", in a
> year's time that system image will be absolute so I was encouraged to use a
> new one & I changed it. But they also warned that  my code might need
> modification to run with the new system image & i am starting to suspect
> that the system image i chose is the one affecting the normal functionality
> of my app Just suspicions because before i changed my system image all
> was good.
>
> On Friday, December 17, 2021 at 2:52:22 PM UTC+2 Jim S wrote:
>
>> Is it possible your were no longer logged in or that you cleared your
>> browser cache before this happened?
>>
>> Sense really weird. Have you tried with a fresh install of web2py?
>>
>> Jim
>>
>> On Fri, Dec 17, 2021, 5:56 AM mostwanted  wrote:
>>
>>> But that's just the thing, I wasn't trying pass any data, i just trying
>>> to create a new view for a new function In my admin interface, as soon as I
>>> clicked create the error popped up & the view failed to create.
>>>
>>> On Thursday, December 16, 2021 at 7:31:55 PM UTC+2 Jim S wrote:
>>>
 Looks like you're passing some data through the request vars and the
 value is Null.  Would need to see more code to be able to help.

 -Jim

 On Wednesday, December 15, 2021 at 12:09:08 AM UTC-6 mostwanted wrote:

> Hi guys, I'm updating one of my very early projects, I was trying to
> create a view and I got an error:  Error ticket for "admin", I dont
> know what's causing it, how do I fix this? Its a new error that I have
> never encountered before, thats the traceback below. I developed it with
> Version 2.14.6
>
> Traceback
> Traceback (most recent call last):
> File "/home/sesoa/web2py/gluon/restricted.py", line 227, in restricted
> exec ccode in environment
> File "/home/sesoa/web2py/applications/admin/controllers/default.py"
> ,
> line 2000, in 
> File "/home/sesoa/web2py/gluon/globals.py", line 417, in 
> self._caller = lambda f: f()
> File "/home/sesoa/web2py/applications/admin/controllers/default.py"
> ,
> line 1484, in create_file
> redirect(request.vars.sender + anchor)
> TypeError: unsupported operand type(s) for +: 'NoneType' and '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 a topic in the
>>> Google Groups "web2py-users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/web2py/zmRXh10o4Y0/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+un...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/5491225e-6ed7-4edc-9776-0bed44a99263n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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/zmRXh10o4Y0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/a01d4058-00fc-47e0-87f0-6a2f85551493n%40googlegroups.com
> 
> .
>

-- 
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 

Re: [web2py] Re: Error ticket for "admin" when trying to create a view

2021-12-17 Thread mostwanted
This is happening on a live app, its live, hosted on pythonanywhere. I am 
starting to suspect something though, I recently received an email from 
pythonanywhere.com informing me that I should change  the system image of 
my app because my app is running on an old one called "dangermouse", in a 
year's time that system image will be absolute so I was encouraged to use a 
new one & I changed it. But they also warned that  my code might need 
modification to run with the new system image & i am starting to suspect 
that the system image i chose is the one affecting the normal functionality 
of my app Just suspicions because before i changed my system image all 
was good.

On Friday, December 17, 2021 at 2:52:22 PM UTC+2 Jim S wrote:

> Is it possible your were no longer logged in or that you cleared your 
> browser cache before this happened?
>
> Sense really weird. Have you tried with a fresh install of web2py?
>
> Jim
>
> On Fri, Dec 17, 2021, 5:56 AM mostwanted  wrote:
>
>> But that's just the thing, I wasn't trying pass any data, i just trying 
>> to create a new view for a new function In my admin interface, as soon as I 
>> clicked create the error popped up & the view failed to create.
>>
>> On Thursday, December 16, 2021 at 7:31:55 PM UTC+2 Jim S wrote:
>>
>>> Looks like you're passing some data through the request vars and the 
>>> value is Null.  Would need to see more code to be able to help.
>>>
>>> -Jim
>>>
>>> On Wednesday, December 15, 2021 at 12:09:08 AM UTC-6 mostwanted wrote:
>>>
 Hi guys, I'm updating one of my very early projects, I was trying to 
 create a view and I got an error:  Error ticket for "admin", I dont 
 know what's causing it, how do I fix this? Its a new error that I have 
 never encountered before, thats the traceback below. I developed it with  
 Version 2.14.6

 Traceback
 Traceback (most recent call last):
 File "/home/sesoa/web2py/gluon/restricted.py", line 227, in restricted
 exec ccode in environment
 File "/home/sesoa/web2py/applications/admin/controllers/default.py" 
 , 
 line 2000, in 
 File "/home/sesoa/web2py/gluon/globals.py", line 417, in 
 self._caller = lambda f: f()
 File "/home/sesoa/web2py/applications/admin/controllers/default.py" 
 , 
 line 1484, in create_file
 redirect(request.vars.sender + anchor)
 TypeError: unsupported operand type(s) for +: 'NoneType' and '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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/zmRXh10o4Y0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/5491225e-6ed7-4edc-9776-0bed44a99263n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/a01d4058-00fc-47e0-87f0-6a2f85551493n%40googlegroups.com.


Re: [web2py] Re: Error ticket for "admin" when trying to create a view

2021-12-17 Thread Jim Steil
Is it possible your were no longer logged in or that you cleared your
browser cache before this happened?

Sense really weird. Have you tried with a fresh install of web2py?

Jim

On Fri, Dec 17, 2021, 5:56 AM mostwanted  wrote:

> But that's just the thing, I wasn't trying pass any data, i just trying to
> create a new view for a new function In my admin interface, as soon as I
> clicked create the error popped up & the view failed to create.
>
> On Thursday, December 16, 2021 at 7:31:55 PM UTC+2 Jim S wrote:
>
>> Looks like you're passing some data through the request vars and the
>> value is Null.  Would need to see more code to be able to help.
>>
>> -Jim
>>
>> On Wednesday, December 15, 2021 at 12:09:08 AM UTC-6 mostwanted wrote:
>>
>>> Hi guys, I'm updating one of my very early projects, I was trying to
>>> create a view and I got an error:  Error ticket for "admin", I dont
>>> know what's causing it, how do I fix this? Its a new error that I have
>>> never encountered before, thats the traceback below. I developed it with
>>> Version 2.14.6
>>>
>>> Traceback
>>> Traceback (most recent call last):
>>> File "/home/sesoa/web2py/gluon/restricted.py", line 227, in restricted
>>> exec ccode in environment
>>> File "/home/sesoa/web2py/applications/admin/controllers/default.py"
>>> ,
>>> line 2000, in 
>>> File "/home/sesoa/web2py/gluon/globals.py", line 417, in 
>>> self._caller = lambda f: f()
>>> File "/home/sesoa/web2py/applications/admin/controllers/default.py"
>>> ,
>>> line 1484, in create_file
>>> redirect(request.vars.sender + anchor)
>>> TypeError: unsupported operand type(s) for +: 'NoneType' and '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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/zmRXh10o4Y0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/5491225e-6ed7-4edc-9776-0bed44a99263n%40googlegroups.com
> 
> .
>

-- 
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/CAERBpoAdjdtNs2ycqOHW2p4z4Uxmtx6DcAoOd6_C2iwg0ieOLA%40mail.gmail.com.


Re: [web2py] Re: Displaying database information without repeating details

2021-10-28 Thread Massimiliano
You need to create an alias for your field.

Look here:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=count%28%29#sum-avg-min-max-and-len

Massimiliano


Il 28 ott 2021, 11:15:48, mostwanted  ha scritto:

> I am able to group them up using *(groupby) *e.g 
> (*products=db().select(db.sales.ALL,
> orderby=db.sales.product.name ,
> groupby=db.sales.product.name )*) but now I
> have a problem calculating the sum of each item's sold quantities.
>
> On Wednesday, October 27, 2021 at 8:27:50 PM UTC+2 Jim S wrote:
>
>> I have done this before, but not using SQLFORM.grid
>>
>> In a nutshell
>>
>> 1. Create table tag
>> 2. create your table header
>> 3. create a temp variable last_item_name and set to None
>> 4. loop through all the data you're going to display
>> 5. in the item_name column, check if the current item name is equal to
>> last_item_name - if it is, put blanks in that cell, if not, put the item
>> name
>> 6. set last_item_name = current item name
>>
>> Not pretty or clever, more of a brute force way to get it to work.
>>
>> -Jim
>>
>> On Wednesday, October 27, 2021 at 9:56:28 AM UTC-5 Clemens wrote:
>>
>>> Have a look here:
>>>
>>> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#groupby-having
>>>
>>> Combining this with:
>>>
>>> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#sum-avg-min-max-and-len
>>>
>>> Is it what you need?
>>>
>>> Best regards
>>> Clemens
>>>
>>>
>>> On Wednesday, October 27, 2021 at 4:44:11 PM UTC+2 mostwanted wrote:
>>>
 I have a sales database table that records items sold in a store, an
 item can appear several times in the table having been sold several times
 or in different days. What i wanna do is display this information in an
 html table in a view without the item names repeating also with the sold
 quantity summed up for every item that appears more than once, how can i
 achieve this?

 Regards

>>> --
> 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/313a1e44-7044-4cd9-b603-d0659c73b04dn%40googlegroups.com
> 
> .
>

-- 
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/CANPTPxKxPBRqv1qMH2gY%3DQODM2eNk%3D8b4TUD0KoRKoeqgKt-%3Dg%40mail.gmail.com.


Re: [web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-09-10 Thread Davidiam
We tried the parameters that were recommended in the link of @Niphlod 's 
post, but the error is still occurring.  What is strange is the error 
occurs after only about 3 seconds, so there may be something else happening 
here.

I will try to get the developer to comment on this thread as he knows best 
what he is doing.

Kind Regards,
David

On Thursday, September 2, 2021 at 9:34:56 AM UTC+2 Niphlod wrote:

> the timeout is part of rocket webserver, not web2py. if you're running 
> fastcgi, that's where you want to set a timeout: as configuration in IIS 
> (see  python - How do I stop FastCGI process exceeding the configured 
> request timeout - Stack Overflow 
> 
>   
> or something like that )
>
> On Wednesday, September 1, 2021 at 11:12:29 AM UTC+2 david@gmail.com 
> wrote:
>
>> I would like to increase the timeout parameters to see if it resolves 
>> some issues we are having with internal server error messages. 
>>
>> Get Outlook for Android 
>> --
>> *From:* web...@googlegroups.com  on behalf of 
>> Niphlod 
>> *Sent:* Wednesday, September 1, 2021 10:35:35 AM
>> *To:* web2py-users 
>> *Subject:* [web2py] Re: How to add command line arguments to web2py when 
>> it is running as an application pool on IIS? 
>>  
>> what command line argument, specifically ?
>>
>> On Tuesday, August 31, 2021 at 5:59:31 AM UTC+2 snide...@gmail.com wrote:
>>
>> On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com 
>> wrote:
>>
>> Hi web2py folks, 
>>
>> I would like to add a command line argument to the startup of web2py 
>> which is running on an IIS web server.  Can someone tell me the place where 
>> I need to add those parameters on the IIS?
>>
>> Kind Regards,
>> David
>>
>>
>>
>> I can't, but perhaps the archives can help.  One of the long-time 
>> masters, Simone, ran IIS configurations and sometimes discussed his 
>> setups.  Use the search string "
>> https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to see his 
>> posts.  (There are a lot; he did the Scheduler and also the JWT 
>> implementation, so you may want to refine the search.) 
>>
>> /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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/1ac4efb0-1524-4f03-9370-4ac03da788bfn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/1db2f35f-9a09-4fda-9928-629bb5ab36c3n%40googlegroups.com.


Re: [web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-09-06 Thread Davidiam
Thanks, I was out for a week and just see your reply now.  I will try that.

On Thursday, September 2, 2021 at 9:34:56 AM UTC+2 Niphlod wrote:

> the timeout is part of rocket webserver, not web2py. if you're running 
> fastcgi, that's where you want to set a timeout: as configuration in IIS 
> (see  python - How do I stop FastCGI process exceeding the configured 
> request timeout - Stack Overflow 
> 
>   
> or something like that )
>
> On Wednesday, September 1, 2021 at 11:12:29 AM UTC+2 david@gmail.com 
> wrote:
>
>> I would like to increase the timeout parameters to see if it resolves 
>> some issues we are having with internal server error messages. 
>>
>> Get Outlook for Android 
>> --
>> *From:* web...@googlegroups.com  on behalf of 
>> Niphlod 
>> *Sent:* Wednesday, September 1, 2021 10:35:35 AM
>> *To:* web2py-users 
>> *Subject:* [web2py] Re: How to add command line arguments to web2py when 
>> it is running as an application pool on IIS? 
>>  
>> what command line argument, specifically ?
>>
>> On Tuesday, August 31, 2021 at 5:59:31 AM UTC+2 snide...@gmail.com wrote:
>>
>> On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com 
>> wrote:
>>
>> Hi web2py folks, 
>>
>> I would like to add a command line argument to the startup of web2py 
>> which is running on an IIS web server.  Can someone tell me the place where 
>> I need to add those parameters on the IIS?
>>
>> Kind Regards,
>> David
>>
>>
>>
>> I can't, but perhaps the archives can help.  One of the long-time 
>> masters, Simone, ran IIS configurations and sometimes discussed his 
>> setups.  Use the search string "
>> https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to see his 
>> posts.  (There are a lot; he did the Scheduler and also the JWT 
>> implementation, so you may want to refine the search.) 
>>
>> /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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/1ac4efb0-1524-4f03-9370-4ac03da788bfn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/7e085126-93b9-4eb0-be06-1c201dedc645n%40googlegroups.com.


Re: [web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-09-02 Thread Dave S
Good to hear from you again!  Keeping busy?

/dps


On Thursday, September 2, 2021 at 12:34:56 AM UTC-7 Niphlod wrote:

> the timeout is part of rocket webserver, not web2py. if you're running 
> fastcgi, that's where you want to set a timeout: as configuration in IIS 
> (see  python - How do I stop FastCGI process exceeding the configured 
> request timeout - Stack Overflow 
> 
>   
> or something like that )
>
> On Wednesday, September 1, 2021 at 11:12:29 AM UTC+2 david@gmail.com 
> wrote:
>
>> I would like to increase the timeout parameters to see if it resolves 
>> some issues we are having with internal server error messages. 
>>
>> Get Outlook for Android 
>> --
>> *From:* web...@googlegroups.com  on behalf of 
>> Niphlod 
>> *Sent:* Wednesday, September 1, 2021 10:35:35 AM
>> *To:* web2py-users 
>> *Subject:* [web2py] Re: How to add command line arguments to web2py when 
>> it is running as an application pool on IIS? 
>>  
>> what command line argument, specifically ?
>>
>> On Tuesday, August 31, 2021 at 5:59:31 AM UTC+2 snide...@gmail.com wrote:
>>
>> On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com 
>> wrote:
>>
>> Hi web2py folks, 
>>
>> I would like to add a command line argument to the startup of web2py 
>> which is running on an IIS web server.  Can someone tell me the place where 
>> I need to add those parameters on the IIS?
>>
>> Kind Regards,
>> David
>>
>>
>>
>> I can't, but perhaps the archives can help.  One of the long-time 
>> masters, Simone, ran IIS configurations and sometimes discussed his 
>> setups.  Use the search string "
>> https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to see his 
>> posts.  (There are a lot; he did the Scheduler and also the JWT 
>> implementation, so you may want to refine the search.) 
>>
>> /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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/1ac4efb0-1524-4f03-9370-4ac03da788bfn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/530191a9-a355-4db3-8a79-05336f2e493cn%40googlegroups.com.


Re: [web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-09-02 Thread Niphlod
the timeout is part of rocket webserver, not web2py. if you're running 
fastcgi, that's where you want to set a timeout: as configuration in IIS 
(see  python - How do I stop FastCGI process exceeding the configured 
request timeout - Stack Overflow 

  
or something like that )

On Wednesday, September 1, 2021 at 11:12:29 AM UTC+2 david@gmail.com 
wrote:

> I would like to increase the timeout parameters to see if it resolves some 
> issues we are having with internal server error messages. 
>
> Get Outlook for Android 
> --
> *From:* web...@googlegroups.com  on behalf of 
> Niphlod 
> *Sent:* Wednesday, September 1, 2021 10:35:35 AM
> *To:* web2py-users 
> *Subject:* [web2py] Re: How to add command line arguments to web2py when 
> it is running as an application pool on IIS? 
>  
> what command line argument, specifically ?
>
> On Tuesday, August 31, 2021 at 5:59:31 AM UTC+2 snide...@gmail.com wrote:
>
> On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com 
> wrote:
>
> Hi web2py folks, 
>
> I would like to add a command line argument to the startup of web2py which 
> is running on an IIS web server.  Can someone tell me the place where I 
> need to add those parameters on the IIS?
>
> Kind Regards,
> David
>
>
>
> I can't, but perhaps the archives can help.  One of the long-time masters, 
> Simone, ran IIS configurations and sometimes discussed his setups.  Use the 
> search string "
> https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to see his 
> posts.  (There are a lot; he did the Scheduler and also the JWT 
> implementation, so you may want to refine the search.) 
>
> /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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/web2py/1ac4efb0-1524-4f03-9370-4ac03da788bfn%40googlegroups.com
>  
> 
> .
>

-- 
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/9c5ee293-acfc-42fe-aac1-6fe3f67db71fn%40googlegroups.com.


Re: [web2py] Re: How to add command line arguments to web2py when it is running as an application pool on IIS?

2021-09-01 Thread Davidiam
I would like to increase the timeout parameters to see if it resolves some 
issues we are having with internal server error messages.

Get Outlook for Android

From: web2py@googlegroups.com  on behalf of Niphlod 

Sent: Wednesday, September 1, 2021 10:35:35 AM
To: web2py-users 
Subject: [web2py] Re: How to add command line arguments to web2py when it is 
running as an application pool on IIS?

what command line argument, specifically ?

On Tuesday, August 31, 2021 at 5:59:31 AM UTC+2 snide...@gmail.com wrote:
On Thursday, August 26, 2021 at 11:30:34 PM UTC-7 david@gmail.com wrote:
Hi web2py folks,

I would like to add a command line argument to the startup of web2py which is 
running on an IIS web server.  Can someone tell me the place where I need to 
add those parameters on the IIS?

Kind Regards,
David


I can't, but perhaps the archives can help.  One of the long-time masters, 
Simone, ran IIS configurations and sometimes discussed his setups.  Use the 
search string "https://groups.google.com/g/web2py/search?q=author%3ANiphlod; to 
see his posts.  (There are a lot; he did the Scheduler and also the JWT 
implementation, so you may want to refine the search.)

/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/1ac4efb0-1524-4f03-9370-4ac03da788bfn%40googlegroups.com.

-- 
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/AM8P193MB0802AFB8DCB723CC6F5AEB59FECD9%40AM8P193MB0802.EURP193.PROD.OUTLOOK.COM.


Re: [web2py] Re: sqlform insert row id

2021-07-01 Thread Javier Pepe
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-and-insert-update-delete

In form.vars.id store Last ID inserted

El jue., 1 de julio de 2021 15:47, Dave S  escribió:

>
>
> On Wednesday, June 30, 2021 at 11:35:29 PM UTC-7 Clemens wrote:
>
>> the insert returns the id of the new record.
>>
>> new_id = db.table.insert(...)
>>
>> Have a try!
>>
>
> Well, yes, if you do the insert yourself, but when you're doing SQLFORM,
> it will do the insert.  So you need it to return the new record idea.  Does
> it, and if it does how can I access it?
>
> /dps
>
>
>>
>> On Wednesday, June 30, 2021 at 11:51:08 PM UTC+2 snide...@gmail.com
>> wrote:
>>
>>> If SQLFORM.process() accepts the form and does an insert, is there a
>>> variable the controller or view can use to get the id of the row inserted?
>>>
>>> I'm not spotting it in Chapter 7 nor in sqlhtml.py.
>>>
>>> /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/182ad87d-380c-4e9e-888f-690ca22ade8dn%40googlegroups.com
> 
> .
>

-- 
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/CAHxJ-7rJboZvEzP1EjtGK2aZYxvnVSwqXzfJgXpHabJ%3DRCPxqg%40mail.gmail.com.


Re: [web2py] Re: string validation

2021-05-13 Thread Manuele

Thanks for the valuable advice about the regex!

This is my solution:

https://gist.github.com/manuelep/19a0e9ab6723086fdbf1ffa8e858a5f9

Cheers

    Manuele


Il 12/05/21 19:08, Raul Monares ha scritto:

I found this code on the web

# Python code to find the URL from an input string
# Using the regular expression
import re

def Find(string):

# findall() has been used
# with valid conditions for urls in string
regex = 
r"(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’]))"

url = re.findall(regex,string)
return [x[0] for x in url]
# Driver Code
string = 'My Profile: 
https://auth.geeksforgeeks.org/user/Chinmoy%20Lenka/articles in the 
portal of http://www.geeksforgeeks.org/'

print("Urls: ", Find(string))


On Wednesday, May 12, 2021 at 1:22:01 AM UTC-6 Manuele wrote:

Hi!

I have a quite specific question... can anyone help me to implement a
validator that reject all text containing a URL inside?

Some spammers are annoying me registering some fake account
introducing
links in registration fields such like first name, last name... I
hope
in this way to limit it. Adding Google reCaptcha v2 to the
registration
forms didn't help.

Thanks a lot

    Manuele

--
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/91925a1b-ed3e-46e8-9f75-b9d6949656c7n%40googlegroups.com 
.


--
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/8fbe17aa-8ebf-c9a1-dc24-78eadf3939d0%40gmail.com.


Re: [web2py] Re: auth.signature not working

2021-02-15 Thread António Ramos
I didnt because the problem was not in that table.
I was looking to the wrong table.
Thk u

Kevin Keller  escreveu em seg., 15/02/2021 às 18:58 :

> How did you solve it?
>
> On Mon, Feb 15, 2021, 17:33 António Ramos  wrote:
>
>> Thank you Jim but i found the problem.
>> My fault this time.
>> Thank you again.
>>
>> PS. Its just me or this forum is abandoned? Should i go elsewhere for
>> help ?
>>
>> Em seg., 15 de fev. de 2021 às 15:46, António Ramos 
>> escreveu:
>>
>>> Hi Jim
>>> Sorry but dont understand your suggestion.
>>> You mean auth.requires_login() on my restful function like this
>>> @auth.requires_login() ?
>>> @request.restful()
>>> def uploadInvoice():
>>> Does it make sense? Its going to be called by external script.
>>> Inside my  uploadInvoice i have
>>> user = auth.login_bare("myuser", "pwd") and i can check that it returns
>>> the myuser ID. so before inserting a record it should know who the user is.
>>>
>>> I also have this code that i suspect that could get auth.signature in
>>> trouble.
>>> Please comment .
>>>
>>>
>>> db.entities._after_update.append(lambda s, f
>>> : wfFields().update_readers(db, 'entities', s, f))
>>> db.entities._after_update.append(lambda s, f
>>> : wfFields().update_authors(db, 'entities', s, f))
>>> db.entities._after_update.append(lambda s, f: extrafields_sync(s, f))
>>> db.entities._after_insert.append(lambda f, id: extrafields_sync(db(
>>> db.entities.id==id), f))
>>>
>>> Em seg., 15 de fev. de 2021 às 15:33, Jim S 
>>> escreveu:
>>>
 Have you tried with an auth decorator?  Maybe auth.requires_login()?

 -Jim

 On Saturday, February 13, 2021 at 3:33:01 PM UTC-6 Ramos wrote:

> Anybody here?
>
> Em sex., 12 de fev. de 2021 às 23:57, António Ramos <
> ramst...@gmail.com> escreveu:
>
>> hello this is my model
>> db.define_table(
>> 'entities',
>> Field('uuid', length=64, default=lambda: str(uuid.uuid4())),
>> Field('entity', 'string',length=70,required=True, label=T(
>> "Entity")),
>> Field('description', length=100,label=T("Description"), default=
>> ""),
>> Field('status', db.status),
>> Field('type', 'reference dbentities', label=T("Type")),
>> Field('sub_type', "reference subtypes", label=T("Type")),
>> Field('event','string',length=10),
>> Field('trailevent', 'list:integer'),
>> Field("last_error", default=""),
>> Field('extrareaders', 'list:reference auth_user'),
>> Field('extrafield', db.extrafields, requires=IS_EMPTY_OR(
>> IS_IN_DB(db, 'extrafields.id', '%(extrafield)s'))),
>> Field('relatedto', 'reference entities', requires=IS_EMPTY_OR(
>> IS_IN_DB(db, 'entities.id', '%(entity)s'))),
>> Field('file', 'upload', label="Ficheiro"),
>> Field('valstart', 'date', label="Válido de",
>>   default=datetime.datetime.utcnow()),
>> Field('valend', 'date', label="Válido até",
>>   default=datetime.datetime.utcnow()),
>> Field('orderedat', 'float'),
>> Field('question','string'),
>> Field('qt','double'),
>> Field('units','string',length=5),
>> Field('readers', 'list:string', default=[""]),#friend uuid
>> Field('details','json'),
>> auth.signature,
>> format='%(type)s %(entity)s',
>> )
>>
>>
>> I have auth.signature but  this code
>>
>> @request.restful()
>> def uploadInvoice():
>> import random
>> import string
>> response.view = 'generic.json'
>>
>> def POST(*args, **kw):
>> try:
>> user = auth.login_bare("userxxx", "") # so it has a
>> user
>> uploaded_file = kw['file']
>> filename =
>>  db.entities.file.store(uploaded_file, uploaded_file.filename)
>> id = db.entities.insert(
>> entity="Invoice",
>> type=db.dbentities(entity="Invoice")["id"],
>> status=DBTools().setStatus(db,"Draft", "Invoice"),
>> file=filename,
>> created_by=4, # even with this line it saves as None
>> modified_by=4, # even with this line it saves as None
>> description="")
>> if id:
>> eventid = db.events.insert(
>> event="Invoice", relatedto=id,  type=
>> "Document added", receipts={},linktodoc=id
>> )
>> db.entities[id]=dict(event=eventid)
>> return "ok"
>>
>> except Exception as e:
>> raise Exception('Error on line {}{}{}'.format(
>> sys.exc_info()[-1].tb_lineno, str(e), request.vars))
>> return locals()
>>
>> does not fills the created_by and modified_by field. They have None
>>
>> Any help ???
>> Regards

Re: [web2py] Re: auth.signature not working

2021-02-15 Thread Kevin Keller
How did you solve it?

On Mon, Feb 15, 2021, 17:33 António Ramos  wrote:

> Thank you Jim but i found the problem.
> My fault this time.
> Thank you again.
>
> PS. Its just me or this forum is abandoned? Should i go elsewhere for help
> ?
>
> Em seg., 15 de fev. de 2021 às 15:46, António Ramos 
> escreveu:
>
>> Hi Jim
>> Sorry but dont understand your suggestion.
>> You mean auth.requires_login() on my restful function like this
>> @auth.requires_login() ?
>> @request.restful()
>> def uploadInvoice():
>> Does it make sense? Its going to be called by external script.
>> Inside my  uploadInvoice i have
>> user = auth.login_bare("myuser", "pwd") and i can check that it returns
>> the myuser ID. so before inserting a record it should know who the user is.
>>
>> I also have this code that i suspect that could get auth.signature in
>> trouble.
>> Please comment .
>>
>>
>> db.entities._after_update.append(lambda s, f
>> : wfFields().update_readers(db, 'entities', s, f))
>> db.entities._after_update.append(lambda s, f
>> : wfFields().update_authors(db, 'entities', s, f))
>> db.entities._after_update.append(lambda s, f: extrafields_sync(s, f))
>> db.entities._after_insert.append(lambda f, id: extrafields_sync(db(
>> db.entities.id==id), f))
>>
>> Em seg., 15 de fev. de 2021 às 15:33, Jim S 
>> escreveu:
>>
>>> Have you tried with an auth decorator?  Maybe auth.requires_login()?
>>>
>>> -Jim
>>>
>>> On Saturday, February 13, 2021 at 3:33:01 PM UTC-6 Ramos wrote:
>>>
 Anybody here?

 Em sex., 12 de fev. de 2021 às 23:57, António Ramos 
 escreveu:

> hello this is my model
> db.define_table(
> 'entities',
> Field('uuid', length=64, default=lambda: str(uuid.uuid4())),
> Field('entity', 'string',length=70,required=True, label=T("Entity"
> )),
> Field('description', length=100,label=T("Description"), default=""
> ),
> Field('status', db.status),
> Field('type', 'reference dbentities', label=T("Type")),
> Field('sub_type', "reference subtypes", label=T("Type")),
> Field('event','string',length=10),
> Field('trailevent', 'list:integer'),
> Field("last_error", default=""),
> Field('extrareaders', 'list:reference auth_user'),
> Field('extrafield', db.extrafields, requires=IS_EMPTY_OR(
> IS_IN_DB(db, 'extrafields.id', '%(extrafield)s'))),
> Field('relatedto', 'reference entities', requires=IS_EMPTY_OR(
> IS_IN_DB(db, 'entities.id', '%(entity)s'))),
> Field('file', 'upload', label="Ficheiro"),
> Field('valstart', 'date', label="Válido de",
>   default=datetime.datetime.utcnow()),
> Field('valend', 'date', label="Válido até",
>   default=datetime.datetime.utcnow()),
> Field('orderedat', 'float'),
> Field('question','string'),
> Field('qt','double'),
> Field('units','string',length=5),
> Field('readers', 'list:string', default=[""]),#friend uuid
> Field('details','json'),
> auth.signature,
> format='%(type)s %(entity)s',
> )
>
>
> I have auth.signature but  this code
>
> @request.restful()
> def uploadInvoice():
> import random
> import string
> response.view = 'generic.json'
>
> def POST(*args, **kw):
> try:
> user = auth.login_bare("userxxx", "") # so it has a
> user
> uploaded_file = kw['file']
> filename =
>  db.entities.file.store(uploaded_file, uploaded_file.filename)
> id = db.entities.insert(
> entity="Invoice",
> type=db.dbentities(entity="Invoice")["id"],
> status=DBTools().setStatus(db,"Draft", "Invoice"),
> file=filename,
> created_by=4, # even with this line it saves as None
> modified_by=4, # even with this line it saves as None
> description="")
> if id:
> eventid = db.events.insert(
> event="Invoice", relatedto=id,  type=
> "Document added", receipts={},linktodoc=id
> )
> db.entities[id]=dict(event=eventid)
> return "ok"
>
> except Exception as e:
> raise Exception('Error on line {}{}{}'.format(
> sys.exc_info()[-1].tb_lineno, str(e), request.vars))
> return locals()
>
> does not fills the created_by and modified_by field. They have None
>
> Any help ???
> Regards
>
> --
>>> 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

Re: [web2py] Re: auth.signature not working

2021-02-15 Thread António Ramos
Once again thank you Jim for your patience :)
Regards from Portugal

António

Em seg., 15 de fev. de 2021 às 16:59, Jim S  escreveu:

> No, this forum has not been abandoned.  I think the issue may be that most
> of us are now spending a much greater amount of time with py4web.  That,
> and in my case anyway, I shied away from this question because I haven't
> used web2py in a restful manner before so wasn't sure I had anything to
> offer.
>
> -Jim
>
> On Monday, February 15, 2021 at 10:33:12 AM UTC-6 Ramos wrote:
>
>> Thank you Jim but i found the problem.
>> My fault this time.
>> Thank you again.
>>
>> PS. Its just me or this forum is abandoned? Should i go elsewhere for
>> help ?
>>
>> Em seg., 15 de fev. de 2021 às 15:46, António Ramos 
>> escreveu:
>>
>>> Hi Jim
>>> Sorry but dont understand your suggestion.
>>> You mean auth.requires_login() on my restful function like this
>>> @auth.requires_login() ?
>>> @request.restful()
>>> def uploadInvoice():
>>> Does it make sense? Its going to be called by external script.
>>> Inside my  uploadInvoice i have
>>> user = auth.login_bare("myuser", "pwd") and i can check that it returns
>>> the myuser ID. so before inserting a record it should know who the user is.
>>>
>>> I also have this code that i suspect that could get auth.signature in
>>> trouble.
>>> Please comment .
>>>
>>>
>>> db.entities._after_update.append(lambda s, f
>>> : wfFields().update_readers(db, 'entities', s, f))
>>> db.entities._after_update.append(lambda s, f
>>> : wfFields().update_authors(db, 'entities', s, f))
>>> db.entities._after_update.append(lambda s, f: extrafields_sync(s, f))
>>> db.entities._after_insert.append(lambda f, id: extrafields_sync(db(
>>> db.entities.id==id), f))
>>>
>>> Em seg., 15 de fev. de 2021 às 15:33, Jim S 
>>> escreveu:
>>>
 Have you tried with an auth decorator?  Maybe auth.requires_login()?

 -Jim

 On Saturday, February 13, 2021 at 3:33:01 PM UTC-6 Ramos wrote:

> Anybody here?
>
> Em sex., 12 de fev. de 2021 às 23:57, António Ramos <
> ramst...@gmail.com> escreveu:
>
>> hello this is my model
>> db.define_table(
>> 'entities',
>> Field('uuid', length=64, default=lambda: str(uuid.uuid4())),
>> Field('entity', 'string',length=70,required=True, label=T(
>> "Entity")),
>> Field('description', length=100,label=T("Description"), default=
>> ""),
>> Field('status', db.status),
>> Field('type', 'reference dbentities', label=T("Type")),
>> Field('sub_type', "reference subtypes", label=T("Type")),
>> Field('event','string',length=10),
>> Field('trailevent', 'list:integer'),
>> Field("last_error", default=""),
>> Field('extrareaders', 'list:reference auth_user'),
>> Field('extrafield', db.extrafields, requires=IS_EMPTY_OR(
>> IS_IN_DB(db, 'extrafields.id', '%(extrafield)s'))),
>> Field('relatedto', 'reference entities', requires=IS_EMPTY_OR(
>> IS_IN_DB(db, 'entities.id', '%(entity)s'))),
>> Field('file', 'upload', label="Ficheiro"),
>> Field('valstart', 'date', label="Válido de",
>>   default=datetime.datetime.utcnow()),
>> Field('valend', 'date', label="Válido até",
>>   default=datetime.datetime.utcnow()),
>> Field('orderedat', 'float'),
>> Field('question','string'),
>> Field('qt','double'),
>> Field('units','string',length=5),
>> Field('readers', 'list:string', default=[""]),#friend uuid
>> Field('details','json'),
>> auth.signature,
>> format='%(type)s %(entity)s',
>> )
>>
>>
>> I have auth.signature but  this code
>>
>> @request.restful()
>> def uploadInvoice():
>> import random
>> import string
>> response.view = 'generic.json'
>>
>> def POST(*args, **kw):
>> try:
>> user = auth.login_bare("userxxx", "") # so it has a
>> user
>> uploaded_file = kw['file']
>> filename =
>>  db.entities.file.store(uploaded_file, uploaded_file.filename)
>> id = db.entities.insert(
>> entity="Invoice",
>> type=db.dbentities(entity="Invoice")["id"],
>> status=DBTools().setStatus(db,"Draft", "Invoice"),
>> file=filename,
>> created_by=4, # even with this line it saves as None
>> modified_by=4, # even with this line it saves as None
>> description="")
>> if id:
>> eventid = db.events.insert(
>> event="Invoice", relatedto=id,  type=
>> "Document added", receipts={},linktodoc=id
>> )
>> db.entities[id]=dict(event=eventid)
>> return "ok"
>>
>> except Exception as 

Re: [web2py] Re: auth.signature not working

2021-02-15 Thread Jim S
No, this forum has not been abandoned.  I think the issue may be that most 
of us are now spending a much greater amount of time with py4web.  That, 
and in my case anyway, I shied away from this question because I haven't 
used web2py in a restful manner before so wasn't sure I had anything to 
offer.

-Jim

On Monday, February 15, 2021 at 10:33:12 AM UTC-6 Ramos wrote:

> Thank you Jim but i found the problem.
> My fault this time.
> Thank you again.
>
> PS. Its just me or this forum is abandoned? Should i go elsewhere for help 
> ?
>
> Em seg., 15 de fev. de 2021 às 15:46, António Ramos  
> escreveu:
>
>> Hi Jim
>> Sorry but dont understand your suggestion.
>> You mean auth.requires_login() on my restful function like this 
>> @auth.requires_login() ?
>> @request.restful()
>> def uploadInvoice():
>> Does it make sense? Its going to be called by external script. 
>> Inside my  uploadInvoice i have 
>> user = auth.login_bare("myuser", "pwd") and i can check that it returns 
>> the myuser ID. so before inserting a record it should know who the user is.
>>
>> I also have this code that i suspect that could get auth.signature in 
>> trouble. 
>> Please comment .
>>  
>>
>> db.entities._after_update.append(lambda s, f
>> : wfFields().update_readers(db, 'entities', s, f))
>> db.entities._after_update.append(lambda s, f
>> : wfFields().update_authors(db, 'entities', s, f))
>> db.entities._after_update.append(lambda s, f: extrafields_sync(s, f))
>> db.entities._after_insert.append(lambda f, id: extrafields_sync(db(
>> db.entities.id==id), f))
>>
>> Em seg., 15 de fev. de 2021 às 15:33, Jim S  escreveu:
>>
>>> Have you tried with an auth decorator?  Maybe auth.requires_login()?
>>>
>>> -Jim
>>>
>>> On Saturday, February 13, 2021 at 3:33:01 PM UTC-6 Ramos wrote:
>>>
 Anybody here?

 Em sex., 12 de fev. de 2021 às 23:57, António Ramos  
 escreveu:

> hello this is my model
> db.define_table(
> 'entities',
> Field('uuid', length=64, default=lambda: str(uuid.uuid4())),
> Field('entity', 'string',length=70,required=True, label=T("Entity"
> )),
> Field('description', length=100,label=T("Description"), default=""
> ),
> Field('status', db.status),
> Field('type', 'reference dbentities', label=T("Type")),
> Field('sub_type', "reference subtypes", label=T("Type")),
> Field('event','string',length=10),
> Field('trailevent', 'list:integer'),
> Field("last_error", default=""),
> Field('extrareaders', 'list:reference auth_user'),
> Field('extrafield', db.extrafields, requires=IS_EMPTY_OR(
> IS_IN_DB(db, 'extrafields.id', '%(extrafield)s'))),
> Field('relatedto', 'reference entities', requires=IS_EMPTY_OR(
> IS_IN_DB(db, 'entities.id', '%(entity)s'))),
> Field('file', 'upload', label="Ficheiro"),
> Field('valstart', 'date', label="Válido de",
>   default=datetime.datetime.utcnow()),
> Field('valend', 'date', label="Válido até",
>   default=datetime.datetime.utcnow()),
> Field('orderedat', 'float'),
> Field('question','string'),
> Field('qt','double'),
> Field('units','string',length=5),
> Field('readers', 'list:string', default=[""]),#friend uuid
> Field('details','json'),
> auth.signature,
> format='%(type)s %(entity)s',
> )
>
>
> I have auth.signature but  this code
>
> @request.restful()
> def uploadInvoice():
> import random
> import string
> response.view = 'generic.json'
>
> def POST(*args, **kw):
> try:
> user = auth.login_bare("userxxx", "") # so it has a 
> user
> uploaded_file = kw['file']
> filename =
>  db.entities.file.store(uploaded_file, uploaded_file.filename)
> id = db.entities.insert(
> entity="Invoice",
> type=db.dbentities(entity="Invoice")["id"],
> status=DBTools().setStatus(db,"Draft", "Invoice"),
> file=filename,
> created_by=4, # even with this line it saves as None
> modified_by=4, # even with this line it saves as None
> description="")
> if id:
> eventid = db.events.insert(
> event="Invoice", relatedto=id,  type=
> "Document added", receipts={},linktodoc=id
> )
> db.entities[id]=dict(event=eventid)
> return "ok"
>
> except Exception as e:
> raise Exception('Error on line {}{}{}'.format(
> sys.exc_info()[-1].tb_lineno, str(e), request.vars))
> return locals()
>
> does not fills the created_by and modified_by field. They have None 
>
> Any help ???

Re: [web2py] Re: auth.signature not working

2021-02-15 Thread António Ramos
Thank you Jim but i found the problem.
My fault this time.
Thank you again.

PS. Its just me or this forum is abandoned? Should i go elsewhere for help ?

Em seg., 15 de fev. de 2021 às 15:46, António Ramos 
escreveu:

> Hi Jim
> Sorry but dont understand your suggestion.
> You mean auth.requires_login() on my restful function like this
> @auth.requires_login() ?
> @request.restful()
> def uploadInvoice():
> Does it make sense? Its going to be called by external script.
> Inside my  uploadInvoice i have
> user = auth.login_bare("myuser", "pwd") and i can check that it returns
> the myuser ID. so before inserting a record it should know who the user is.
>
> I also have this code that i suspect that could get auth.signature in
> trouble.
> Please comment .
>
>
> db.entities._after_update.append(lambda s, f
> : wfFields().update_readers(db, 'entities', s, f))
> db.entities._after_update.append(lambda s, f
> : wfFields().update_authors(db, 'entities', s, f))
> db.entities._after_update.append(lambda s, f: extrafields_sync(s, f))
> db.entities._after_insert.append(lambda f, id: extrafields_sync(db(
> db.entities.id==id), f))
>
> Em seg., 15 de fev. de 2021 às 15:33, Jim S 
> escreveu:
>
>> Have you tried with an auth decorator?  Maybe auth.requires_login()?
>>
>> -Jim
>>
>> On Saturday, February 13, 2021 at 3:33:01 PM UTC-6 Ramos wrote:
>>
>>> Anybody here?
>>>
>>> Em sex., 12 de fev. de 2021 às 23:57, António Ramos 
>>> escreveu:
>>>
 hello this is my model
 db.define_table(
 'entities',
 Field('uuid', length=64, default=lambda: str(uuid.uuid4())),
 Field('entity', 'string',length=70,required=True, label=T("Entity"
 )),
 Field('description', length=100,label=T("Description"), default=""
 ),
 Field('status', db.status),
 Field('type', 'reference dbentities', label=T("Type")),
 Field('sub_type', "reference subtypes", label=T("Type")),
 Field('event','string',length=10),
 Field('trailevent', 'list:integer'),
 Field("last_error", default=""),
 Field('extrareaders', 'list:reference auth_user'),
 Field('extrafield', db.extrafields, requires=IS_EMPTY_OR(
 IS_IN_DB(db, 'extrafields.id', '%(extrafield)s'))),
 Field('relatedto', 'reference entities', requires=IS_EMPTY_OR(
 IS_IN_DB(db, 'entities.id', '%(entity)s'))),
 Field('file', 'upload', label="Ficheiro"),
 Field('valstart', 'date', label="Válido de",
   default=datetime.datetime.utcnow()),
 Field('valend', 'date', label="Válido até",
   default=datetime.datetime.utcnow()),
 Field('orderedat', 'float'),
 Field('question','string'),
 Field('qt','double'),
 Field('units','string',length=5),
 Field('readers', 'list:string', default=[""]),#friend uuid
 Field('details','json'),
 auth.signature,
 format='%(type)s %(entity)s',
 )


 I have auth.signature but  this code

 @request.restful()
 def uploadInvoice():
 import random
 import string
 response.view = 'generic.json'

 def POST(*args, **kw):
 try:
 user = auth.login_bare("userxxx", "") # so it has a
 user
 uploaded_file = kw['file']
 filename =
  db.entities.file.store(uploaded_file, uploaded_file.filename)
 id = db.entities.insert(
 entity="Invoice",
 type=db.dbentities(entity="Invoice")["id"],
 status=DBTools().setStatus(db,"Draft", "Invoice"),
 file=filename,
 created_by=4, # even with this line it saves as None
 modified_by=4, # even with this line it saves as None
 description="")
 if id:
 eventid = db.events.insert(
 event="Invoice", relatedto=id,  type=
 "Document added", receipts={},linktodoc=id
 )
 db.entities[id]=dict(event=eventid)
 return "ok"

 except Exception as e:
 raise Exception('Error on line {}{}{}'.format(
 sys.exc_info()[-1].tb_lineno, str(e), request.vars))
 return locals()

 does not fills the created_by and modified_by field. They have None

 Any help ???
 Regards

 --
>> 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
>> 

Re: [web2py] Re: Programatically create Row

2021-02-15 Thread Jacinto Parga
So, do you want to storage a dummy row to be proccessed in the same 
controler or to be passed to another controller or function?. I mean, if 
you want to use it in the same controller why not a local variable to 
storage it.. 

If you have used a SQLFORM. factory to get the values they are storaged in 
form.vars object.

What do you mean with a dummy row? Is it like a structure of a db row? 

El sábado, 13 de febrero de 2021 a las 17:45:09 UTC+1, david...@gmail.com 
escribió:

> Thanks for the suggestion. I don't need to create the form 
> programmatically - the factory is great for that. I've already got code to 
> create the form but want to create a dummy row on the server side to 
> populate a display example form. 
>
> Cheers, 
> David
>
> On Sat, 13 Feb 2021, 08:37 Jacinto Parga,  wrote:
>
>>
>> http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory
>>
>> El viernes, 12 de febrero de 2021 a las 18:26:42 UTC+1, 
>> david...@gmail.com escribió:
>>
>>> I have a controller that displays confidential data from a table but 
>>> want to be able to show the form publicly with some dummy data. The 
>>> controller makes use of field representation and references so I basically 
>>> need a Row.
>>>
>>> I can create the object I need using the table.insert() methods and then 
>>> db.rollback() to avoid committing the dummy data but is there a better 
>>> method. I've had a look at the internals of Row and suspect that trying to 
>>> create a Row object by hand would be pretty fraught, but is there a better 
>>> way than just using insert() and rollback()? It feels like using a 
>>> sledgehammer to crack a nut.
>>>
>>> Cheers,
>>> David
>>>
>> -- 
>> 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/FSHPxYTxr24/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/5ce7ca44-d5d7-4854-96c9-99b78b14fcdcn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/85137da9-e4a0-4fb0-9c7b-291fbb3c40a1n%40googlegroups.com.


Re: [web2py] Re: auth.signature not working

2021-02-15 Thread António Ramos
Hi Jim
Sorry but dont understand your suggestion.
You mean auth.requires_login() on my restful function like this
@auth.requires_login() ?
@request.restful()
def uploadInvoice():
Does it make sense? Its going to be called by external script.
Inside my  uploadInvoice i have
user = auth.login_bare("myuser", "pwd") and i can check that it returns the
myuser ID. so before inserting a record it should know who the user is.

I also have this code that i suspect that could get auth.signature in
trouble.
Please comment .


db.entities._after_update.append(lambda s, f: wfFields().update_readers(db,
'entities', s, f))
db.entities._after_update.append(lambda s, f: wfFields().update_authors(db,
'entities', s, f))
db.entities._after_update.append(lambda s, f: extrafields_sync(s, f))
db.entities._after_insert.append(lambda f, id: extrafields_sync(db(
db.entities.id==id), f))

Em seg., 15 de fev. de 2021 às 15:33, Jim S  escreveu:

> Have you tried with an auth decorator?  Maybe auth.requires_login()?
>
> -Jim
>
> On Saturday, February 13, 2021 at 3:33:01 PM UTC-6 Ramos wrote:
>
>> Anybody here?
>>
>> Em sex., 12 de fev. de 2021 às 23:57, António Ramos 
>> escreveu:
>>
>>> hello this is my model
>>> db.define_table(
>>> 'entities',
>>> Field('uuid', length=64, default=lambda: str(uuid.uuid4())),
>>> Field('entity', 'string',length=70,required=True, label=T("Entity"
>>> )),
>>> Field('description', length=100,label=T("Description"), default=""),
>>> Field('status', db.status),
>>> Field('type', 'reference dbentities', label=T("Type")),
>>> Field('sub_type', "reference subtypes", label=T("Type")),
>>> Field('event','string',length=10),
>>> Field('trailevent', 'list:integer'),
>>> Field("last_error", default=""),
>>> Field('extrareaders', 'list:reference auth_user'),
>>> Field('extrafield', db.extrafields, requires=IS_EMPTY_OR(
>>> IS_IN_DB(db, 'extrafields.id', '%(extrafield)s'))),
>>> Field('relatedto', 'reference entities', requires=IS_EMPTY_OR(
>>> IS_IN_DB(db, 'entities.id', '%(entity)s'))),
>>> Field('file', 'upload', label="Ficheiro"),
>>> Field('valstart', 'date', label="Válido de",
>>>   default=datetime.datetime.utcnow()),
>>> Field('valend', 'date', label="Válido até",
>>>   default=datetime.datetime.utcnow()),
>>> Field('orderedat', 'float'),
>>> Field('question','string'),
>>> Field('qt','double'),
>>> Field('units','string',length=5),
>>> Field('readers', 'list:string', default=[""]),#friend uuid
>>> Field('details','json'),
>>> auth.signature,
>>> format='%(type)s %(entity)s',
>>> )
>>>
>>>
>>> I have auth.signature but  this code
>>>
>>> @request.restful()
>>> def uploadInvoice():
>>> import random
>>> import string
>>> response.view = 'generic.json'
>>>
>>> def POST(*args, **kw):
>>> try:
>>> user = auth.login_bare("userxxx", "") # so it has a user
>>> uploaded_file = kw['file']
>>> filename =
>>>  db.entities.file.store(uploaded_file, uploaded_file.filename)
>>> id = db.entities.insert(
>>> entity="Invoice",
>>> type=db.dbentities(entity="Invoice")["id"],
>>> status=DBTools().setStatus(db,"Draft", "Invoice"),
>>> file=filename,
>>> created_by=4, # even with this line it saves as None
>>> modified_by=4, # even with this line it saves as None
>>> description="")
>>> if id:
>>> eventid = db.events.insert(
>>> event="Invoice", relatedto=id,  type=
>>> "Document added", receipts={},linktodoc=id
>>> )
>>> db.entities[id]=dict(event=eventid)
>>> return "ok"
>>>
>>> except Exception as e:
>>> raise Exception('Error on line {}{}{}'.format(
>>> sys.exc_info()[-1].tb_lineno, str(e), request.vars))
>>> return locals()
>>>
>>> does not fills the created_by and modified_by field. They have None
>>>
>>> Any help ???
>>> Regards
>>>
>>> --
> 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/022388a0-7a1a-405a-93e2-86498f18e334n%40googlegroups.com
> 
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- 

Re: [web2py] Re: Programatically create Row

2021-02-13 Thread David Orme
Thanks for the suggestion. I don't need to create the form programmatically
- the factory is great for that. I've already got code to create the form
but want to create a dummy row on the server side to populate a display
example form.

Cheers,
David

On Sat, 13 Feb 2021, 08:37 Jacinto Parga,  wrote:

>
> http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-factory
>
> El viernes, 12 de febrero de 2021 a las 18:26:42 UTC+1, david...@gmail.com
> escribió:
>
>> I have a controller that displays confidential data from a table but want
>> to be able to show the form publicly with some dummy data. The controller
>> makes use of field representation and references so I basically need a Row.
>>
>> I can create the object I need using the table.insert() methods and then
>> db.rollback() to avoid committing the dummy data but is there a better
>> method. I've had a look at the internals of Row and suspect that trying to
>> create a Row object by hand would be pretty fraught, but is there a better
>> way than just using insert() and rollback()? It feels like using a
>> sledgehammer to crack a nut.
>>
>> Cheers,
>> David
>>
> --
> 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/FSHPxYTxr24/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/5ce7ca44-d5d7-4854-96c9-99b78b14fcdcn%40googlegroups.com
> 
> .
>

-- 
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/CAJnoBj60Cus76nmCUyUh9dVQAdwdh4VMOsoedEyZ%3Dv3Maa3Ofw%40mail.gmail.com.


Re: [web2py] Re: can i delete sql.log?

2021-02-11 Thread António Ramos
Thank u

Em qua., 10 de fev. de 2021 às 23:38, cdbaron 
escreveu:

> Sql.log is an informative file, if you delete it, it will be created again. It
> does not affect the operation of the applications. In this file, SQL
> queries of the DB migrations are stored.
>
> El martes, 9 de febrero de 2021 a las 23:34:06 UTC+1, Ramos escribió:
>
>> can i delete sql.log?
>>
> --
> 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/26ad2f8d-2467-4540-a5ab-61007cd6ea97n%40googlegroups.com
> 
> .
>

-- 
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/CAEM0BxNJ-t4TOfCRwY54B0_aMMBbYV-buwmxYRcH6BJsYwQzBw%40mail.gmail.com.


Re: [web2py] Re: fake_migration issues

2021-02-10 Thread António Ramos
I have started another post with apparently the same problem.
as i have a production app i cant wait much longer so if anyone can help me
professionaly with this please contact me privately.
Regards

Em dom., 31 de jan. de 2021 às 23:58, Dave S 
escreveu:

> On Saturday, January 30, 2021 at 3:32:13 PM UTC-8 valq...@gmail.com wrote:
>
>> try to compare db.py from  "fresh" welcome-app with your app. I have had
>> a migration problem due to imports changes
>>
>>
> Thanks!  This wasn't the issue, but you got me looking in the right place
> ... I had missed migrate_enabled.
>
> There's some followup details for when I have time at the keyboard.
>
> Dave S
> /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/f45054c1-5233-4106-a85b-25556b2e9255n%40googlegroups.com
> 
> .
>

-- 
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/CAEM0BxMxFd7W1t-qG4Hj2-jJ%3D8GKsKUq7FYOan6%3DEUYcMp%3DwTA%40mail.gmail.com.


Re: [web2py] Re: fake_migration issues

2021-01-31 Thread Nico Zanferrari
You are right, I'd completely forgotten these issues...

I've closed them all, because the zip files in the official repository
http://www.web2py.com/init/default/download are fine.
Also, you can easily update the web2py program (and/or pydal) by manually
substituting the source files inside.

Cheers,
Nico

Il giorno dom 31 gen 2021 alle ore 00:17 valq...@gmail.com <
valq7...@gmail.com> ha scritto:

> I dont know, try to ask Nico, since issue is still open
>
> воскресенье, 31 января 2021 г. в 01:45:28 UTC+3, snide...@gmail.com:
>
>> On Saturday, January 30, 2021 at 2:33:37 PM UTC-8 valq...@gmail.com
>> wrote:
>>
>>> Do you use windows binaries? i.e web2py.exe?
>>> https://github.com/web2py/web2py/issues/2300
>>>
>>>
>> That issue is from April , and the exe I'm using is from November.  Are
>> the official ones still broken?
>>
>> /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/1ba5a3aa-3393-450d-8b30-a8f552f44452n%40googlegroups.com
> 
> .
>

-- 
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/CAAE8D_DEtG4SiDkxjhvfuUm5JS-A%2BpwUxpYnU8w3m4dQbPk_nw%40mail.gmail.com.


Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-29 Thread Muhammad Atif Ayaz
Thank you very much!

On Fri, Jan 29, 2021 at 9:14 AM valq...@gmail.com 
wrote:

> db.table['fieldname']
>
>
> четверг, 28 января 2021 г. в 07:31:04 UTC+3, at:
>
>> It gives error: `*AttributeError('str' object has no attribute
>> 'tablename')*`
>>
>> The reason is that the field names are in string format not in
>> db.tablename.fieldname format
>>
>>
>> On Wed, Jan 27, 2021 at 6:30 PM Jim Steil  wrote:
>>
>>> What is wrong with using the example you provided?
>>>
>>> -Jim
>>>
>>>
>>> On Tue, Jan 26, 2021 at 10:45 PM Muhammad Atif Ayaz 
>>> wrote:
>>>
 Thank you Jim, it works.

 Do you think a way that can help dynamically making a list of all
 fields of a table and then we can remove specific fields from it.
 Like the following which produces the required list but in the desired
 data-type:
 fields = [fld for fld in db.engagement.fields if fld!='token']
 grid = SQLFORM.grid(db.engagement, fields=fields)


 On Tue, Jan 26, 2021 at 9:50 PM Jim S  wrote:

> Can you try with the field in the format:
>
> db.tablename.fieldname
>
> ex:
>
> fields = [db.engagement.id, db.engagement.name]
>
> -Jim
>
>
> On Monday, January 25, 2021 at 11:45:49 PM UTC-6 at wrote:
>
>> Here is the code:
>> `fields=['id', 'name']`
>> `grid = SQLFORM.grid(db.engagement, fields=fields)`
>>
>> Error:
>> `AttributeError('str' object has no attribute 'tablename')`
>>
>>
>> --
> 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/Ym3zsLYNePg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/e19daf19-95c7-4e46-88da-74882bd4e51an%40googlegroups.com
> 
> .
>
 --
 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/Ym3zsLYNePg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+un...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/web2py/CAFpY7yFSRZMRPY02sHJtxGasp3T%3Dy7sRdqbq58KncYDdDpkXDg%40mail.gmail.com
 
 .

>>> --
>>> 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/Ym3zsLYNePg/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+un...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/CAERBpoCjJrCe_3W1Nq%3DZKh8wFc-e8stoHOpMzDwxMHfbFjexKA%40mail.gmail.com
>>> 
>>> .
>>>
>> --
> 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/Ym3zsLYNePg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/3b718aef-ec6a-45d3-9c6a-7ae039ae787an%40googlegroups.com
> 
> .
>

-- 
Resources:
- http://web2py.com
- 

Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-28 Thread valq...@gmail.com
db.table['fieldname']


четверг, 28 января 2021 г. в 07:31:04 UTC+3, at: 

> It gives error: `*AttributeError('str' object has no attribute 
> 'tablename')*`
>
> The reason is that the field names are in string format not in 
> db.tablename.fieldname format
>
>
> On Wed, Jan 27, 2021 at 6:30 PM Jim Steil  wrote:
>
>> What is wrong with using the example you provided?
>>
>> -Jim
>>
>>
>> On Tue, Jan 26, 2021 at 10:45 PM Muhammad Atif Ayaz  
>> wrote:
>>
>>> Thank you Jim, it works.
>>>
>>> Do you think a way that can help dynamically making a list of all fields 
>>> of a table and then we can remove specific fields from it.
>>> Like the following which produces the required list but in the desired 
>>> data-type: 
>>> fields = [fld for fld in db.engagement.fields if fld!='token']
>>> grid = SQLFORM.grid(db.engagement, fields=fields)
>>>
>>>
>>> On Tue, Jan 26, 2021 at 9:50 PM Jim S  wrote:
>>>
 Can you try with the field in the format:

 db.tablename.fieldname

 ex:

 fields = [db.engagement.id, db.engagement.name]

 -Jim


 On Monday, January 25, 2021 at 11:45:49 PM UTC-6 at wrote:

> Here is the code:
> `fields=['id', 'name']`
> `grid = SQLFORM.grid(db.engagement, fields=fields)`
>
> Error:
> `AttributeError('str' object has no attribute 'tablename')`
>
>
> -- 
 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/Ym3zsLYNePg/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/e19daf19-95c7-4e46-88da-74882bd4e51an%40googlegroups.com
  
 
 .

>>> -- 
>>> 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/Ym3zsLYNePg/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to 
>>> web2py+un...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/CAFpY7yFSRZMRPY02sHJtxGasp3T%3Dy7sRdqbq58KncYDdDpkXDg%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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/Ym3zsLYNePg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/CAERBpoCjJrCe_3W1Nq%3DZKh8wFc-e8stoHOpMzDwxMHfbFjexKA%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
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/3b718aef-ec6a-45d3-9c6a-7ae039ae787an%40googlegroups.com.


Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-27 Thread Muhammad Atif Ayaz
It gives error: `*AttributeError('str' object has no attribute 'tablename')*
`

The reason is that the field names are in string format not in
db.tablename.fieldname format


On Wed, Jan 27, 2021 at 6:30 PM Jim Steil  wrote:

> What is wrong with using the example you provided?
>
> -Jim
>
>
> On Tue, Jan 26, 2021 at 10:45 PM Muhammad Atif Ayaz 
> wrote:
>
>> Thank you Jim, it works.
>>
>> Do you think a way that can help dynamically making a list of all fields
>> of a table and then we can remove specific fields from it.
>> Like the following which produces the required list but in the desired
>> data-type:
>> fields = [fld for fld in db.engagement.fields if fld!='token']
>> grid = SQLFORM.grid(db.engagement, fields=fields)
>>
>>
>> On Tue, Jan 26, 2021 at 9:50 PM Jim S  wrote:
>>
>>> Can you try with the field in the format:
>>>
>>> db.tablename.fieldname
>>>
>>> ex:
>>>
>>> fields = [db.engagement.id, db.engagement.name]
>>>
>>> -Jim
>>>
>>>
>>> On Monday, January 25, 2021 at 11:45:49 PM UTC-6 at wrote:
>>>
 Here is the code:
 `fields=['id', 'name']`
 `grid = SQLFORM.grid(db.engagement, fields=fields)`

 Error:
 `AttributeError('str' object has no attribute 'tablename')`


 --
>>> 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/Ym3zsLYNePg/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/e19daf19-95c7-4e46-88da-74882bd4e51an%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/Ym3zsLYNePg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/CAFpY7yFSRZMRPY02sHJtxGasp3T%3Dy7sRdqbq58KncYDdDpkXDg%40mail.gmail.com
>> 
>> .
>>
> --
> 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/Ym3zsLYNePg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CAERBpoCjJrCe_3W1Nq%3DZKh8wFc-e8stoHOpMzDwxMHfbFjexKA%40mail.gmail.com
> 
> .
>

-- 
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/CAFpY7yHS54wiYKsMDof82z%2BD%2BsS%3DAeC%3D1CtyFa5Wx20guw495A%40mail.gmail.com.


Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-27 Thread Jim Steil
What is wrong with using the example you provided?

-Jim


On Tue, Jan 26, 2021 at 10:45 PM Muhammad Atif Ayaz 
wrote:

> Thank you Jim, it works.
>
> Do you think a way that can help dynamically making a list of all fields
> of a table and then we can remove specific fields from it.
> Like the following which produces the required list but in the desired
> data-type:
> fields = [fld for fld in db.engagement.fields if fld!='token']
> grid = SQLFORM.grid(db.engagement, fields=fields)
>
>
> On Tue, Jan 26, 2021 at 9:50 PM Jim S  wrote:
>
>> Can you try with the field in the format:
>>
>> db.tablename.fieldname
>>
>> ex:
>>
>> fields = [db.engagement.id, db.engagement.name]
>>
>> -Jim
>>
>>
>> On Monday, January 25, 2021 at 11:45:49 PM UTC-6 at wrote:
>>
>>> Here is the code:
>>> `fields=['id', 'name']`
>>> `grid = SQLFORM.grid(db.engagement, fields=fields)`
>>>
>>> Error:
>>> `AttributeError('str' object has no attribute 'tablename')`
>>>
>>>
>>> --
>> 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/Ym3zsLYNePg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/web2py/e19daf19-95c7-4e46-88da-74882bd4e51an%40googlegroups.com
>> 
>> .
>>
> --
> 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/Ym3zsLYNePg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/CAFpY7yFSRZMRPY02sHJtxGasp3T%3Dy7sRdqbq58KncYDdDpkXDg%40mail.gmail.com
> 
> .
>

-- 
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/CAERBpoCjJrCe_3W1Nq%3DZKh8wFc-e8stoHOpMzDwxMHfbFjexKA%40mail.gmail.com.


Re: [web2py] Re: Got error when I put 'fields' as an argument to SQLFORM.grid

2021-01-26 Thread Muhammad Atif Ayaz
Thank you Jim, it works.

Do you think a way that can help dynamically making a list of all fields of
a table and then we can remove specific fields from it.
Like the following which produces the required list but in the desired
data-type:
fields = [fld for fld in db.engagement.fields if fld!='token']
grid = SQLFORM.grid(db.engagement, fields=fields)


On Tue, Jan 26, 2021 at 9:50 PM Jim S  wrote:

> Can you try with the field in the format:
>
> db.tablename.fieldname
>
> ex:
>
> fields = [db.engagement.id, db.engagement.name]
>
> -Jim
>
>
> On Monday, January 25, 2021 at 11:45:49 PM UTC-6 at wrote:
>
>> Here is the code:
>> `fields=['id', 'name']`
>> `grid = SQLFORM.grid(db.engagement, fields=fields)`
>>
>> Error:
>> `AttributeError('str' object has no attribute 'tablename')`
>>
>>
>> --
> 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/Ym3zsLYNePg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/e19daf19-95c7-4e46-88da-74882bd4e51an%40googlegroups.com
> 
> .
>

-- 
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/CAFpY7yFSRZMRPY02sHJtxGasp3T%3Dy7sRdqbq58KncYDdDpkXDg%40mail.gmail.com.


Re: [web2py] Re: Pass/Receive args contains "&" in the value

2021-01-20 Thread Omi Chiba
>So, are you trying to pass a company name through a URL?  Seems to me that 
would be problematic. 
Yes, that's what I'm trying and I was hoping there is a easy fix. 

Thank you for your help!  I think I will stop here for now. 


On Wednesday, January 20, 2021 at 3:52:04 PM UTC-6 Jim S wrote:

> So, are you trying to pass a company name through a URL?  Seems to me that 
> would be problematic.  
>
> If that is what you're doing maybe you need to look at urllib 
> unquote_plus.  I use that in some cases to build valid URLs where the text 
> can be unpredictable.
>
> Is there anything else you could pass other than a name to uniquely 
> identify the company in your url?
>
> Or, maybe I'm not following what you're trying to do here.
>
> -Jim
>
>
> On Wed, Jan 20, 2021 at 3:36 PM Omi Chiba  wrote:
>
>> ok, so this is four parameters I'm passing..
>>
>> J2831
>>
>> AL04
>>
>> 36105
>>
>> HYUNDAI MOTOR MANUFACTURI
>>
>> then list.xxx or XML(list.xxx) actually shows the same result. It 
>> replaced blank with "_"... that's why I failed to get the data from the 
>> database because the original value doesn't have "_". I also tried the with 
>> "&" in the company name and it failed to display the page because of "&"
>>
>> J2831
>>
>> AL04
>>
>> 36105
>>
>> HYUNDAI_MOTOR_MANUFACTURI
>>
>>
>>
>> On Wednesday, January 20, 2021 at 2:35:56 PM UTC-6 Jim S wrote:
>>
>>> So, if you would do a for look around 'lists' and print out the field 
>>> values, what would that look like?  Also, is there a difference if you also 
>>> print it out with the XML function wrapped around it?
>>>
>>> On Wed, Jan 20, 2021 at 2:03 PM Omi Chiba  wrote:
>>>
 here's the controller for enduser_index view. It's like I have this 
 index view to list and lick "View" button to pass the variable and go to 
 enduser_view page.

 def enduser_index():
 response.title = 'List'
 response.subtitle = 'End User Code'
 
 form=SQLFORM.factory(Field('search'))
 form.custom.widget.search['_class'] = 'input-medium search-query'
 form.custom.submit['_value'] = 'Search'
 form.custom.submit['_class'] = 'btn'
 
 if form.accepts(request):
 key=form.vars.search.upper() + "%"
 query = (db.EDXUSF00.USDIID.like(key)) | 
 (db.EDXUSF00.USDICD.like(key)) | (db.EDXUSF00.USTSKJ.like(key))
 else:
 query = db.EDXUSF00.USDIID!=""
 
 # Paging plugin
 paginate_selector = PaginateSelector(anchor='main')
 paginator = Paginator(paginate=paginate_selector.paginate, 
   extra_vars={'v':1}, anchor='main',
   renderstyle=True) 
 paginator.records = db(query).count()
 paginate_info = PaginateInfo(paginator.page, paginator.paginate, 
 paginator.records)
 # End Paging plugin...
 
 
 lists=db(query).select(db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ,db.EDXUSF00.USUSCD,orderby=[db.EDXUSF00.USDIID,db.EDXUSF00.USDICD,db.EDXUSF00.USYUB5,db.EDXUSF00.USTSKJ],limitby=paginator.limitby())
 return 
 dict(form=form,lists=lists,paginator=paginator,paginate_selector=paginate_selector,
  
 paginate_info=paginate_info)
 


 On Wednesday, January 20, 2021 at 2:01:07 PM UTC-6 Jim S wrote:

> I thought you were trying to get it working in this html tag:
>
>  href="{{=URL('customer_view',args=[list.TKDIID,list.TKDICD])}}" 
> class="btn"> View<
>
> I don't see the 'list' variable in the controller...
>
> Where is that coming from?
>
> -Jim
>
> On Wed, Jan 20, 2021 at 1:49 PM Omi Chiba  wrote:
>
>> I'm not sure how to check...
>>
>> This is my controller for view page
>>
>> def enduser_view():
>> response.title = 'View'
>> response.subtitle = 'End User Code'
>> 
>> request.args(0) or redirect (URL('enduser_index'))
>> record = db.EDXUSF00(db.EDXUSF00.USDIID==request.args(0) and 
>> db.EDXUSF00.USDICD==request.args(1) and 
>> db.EDXUSF00.USYUB5==request.args(2) 
>> and db.EDXUSF00.USTSKJ==request.args(3))
>> 
>> if record != None:
>> form = SQLFORM(db.EDXUSF00,record, readonly=True)
>> else:
>> redirect(URL('enduser_index'))  
>> 
>> return dict(form=form)
>>
>>
>>
>> On Wednesday, January 20, 2021 at 11:47:17 AM UTC-6 Jim S wrote:
>>
>>> I don't think it will help to change the controller side.
>>>
>>> In the controller can you print out the values and also print out 
>>> the XML(value) and see what the difference is?
>>>
>>> -Jim
>>>
>>> On Wed, Jan 20, 2021 at 10:36 AM Omi Chiba  
>>> wrote:
>>>
 I added XML. It doesn't show the error but cannot get the value and 
 shows the records...  

  1   2   3   4   5   6   7   8   9   10   >