[web2py] py4web chat Saturday April 16

2022-04-15 Thread Jim S
For anyone interested in learning more about py4web...

>From Massimo - 

Hello everybody,

We are planning a py4web Q on Saturday April 16 at 10am Pacific time. On 
our discord channel.

Hope to see you there.

Massimo


py4web discord link -> https://discord.gg/WQc2skNG

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/ea330c0d-96af-4629-8055-43ca874d06b7n%40googlegroups.com.


Re: [web2py] py4web jwt ?

2021-03-01 Thread Kevin Keller
What are the current files that would need to be fixed to be pyjwt 2
compatible?

auth and form no?

Anything else?


[image: cloudHQ] <https://www.free-email-tracker.com> Powered by
cloudHQ <https://www.free-email-tracker.com>

Am Mo., 1. März 2021 um 09:02 Uhr schrieb Nico Zanferrari <
nicoz...@gmail.com>:

> BTW,
>
> in fact JWT  is cited here :
> https://py4web.com/_documentation/static/en/chapter-04.html#sessions -
> and I'm even currently working for expanding it ;-)
>
> Nico
>
> Il giorno ven 26 feb 2021 alle ore 19:55 Richard Vézina <
> ml.richard.vez...@gmail.com> ha scritto:
>
>> Thanks
>>
>> On Fri, Feb 26, 2021 at 1:43 PM Kevin Keller  wrote:
>>
>>> Look for the email thread with the following title in the py4web google
>>> group and you ll find a way:
>>>
>>> Sample Code simple JWT Auth for pydal API
>>>
>>>
>>> in the
>>>
>>>
>>> [image: cloudHQ] <https://www.free-email-tracker.com> Powered by
>>> cloudHQ <https://www.free-email-tracker.com>
>>>
>>> Am Fr., 26. Feb. 2021 um 19:39 Uhr schrieb Richard Vézina <
>>> ml.richard.vez...@gmail.com>:
>>>
>>>> UP!
>>>>
>>>> Is py4web has jwt token mechanism??
>>>>
>>>> Evaluating py4web currently (yes getting back to good stuff loved
>>>> web2py and pydal)...
>>>>
>>>> I would need py4web to support jwt (https://jwt.io/). I recall that
>>>> been implement in web2py
>>>>
>>>> Not found anything in the doc about it :
>>>> https://py4web.com/_documentation/static/en/chapter-11.html
>>>>
>>>> Thanks
>>>>
>>>> Richard
>>>>
>>>> On Thu, Feb 20, 2020 at 2:19 PM Val K  wrote:
>>>>
>>>>> As I know py2web already stores _session_token as jwt, no?
>>>>>
>>>>> On Thursday, February 20, 2020 at 10:00:00 PM UTC+3, Kevin Keller
>>>>> wrote:
>>>>>>
>>>>>> With a Spa the routing is done in Javascript in the Browser.
>>>>>>
>>>>>> So Javascript or Vue / React etc need. To check if the user has a
>>>>>> access or id_token and if not redirect to the login page to obtain it.
>>>>>>
>>>>>> Doing crud and be able to secure those crud rest routes will be
>>>>>> critical for productivity.
>>>>>>
>>>>>> So we need a simple jwt token minting engine that at least can spit
>>>>>> out a access token for prototyping and and easy way to switch over to 
>>>>>> other
>>>>>> IAM solutions with py4web for production that can do the token minting.
>>>>>>
>>>>>> That is something I am currently working on the whole oidc auth part
>>>>>> make it easy and I also want to make it available for web2py.
>>>>>>
>>>>>> I have updated and got the oauth2 login provider working with Okta
>>>>>> yesterday and web2py.
>>>>>>
>>>>>> Will share this. Code asap and sent a push to git to have that
>>>>>> provider updated and at some providers for different IAM solutions for 
>>>>>> both
>>>>>> web2py and py4web going forward.
>>>>>>
>>>>>> Will try to share an example with py4web asap once I have something
>>>>>> working.
>>>>>>
>>>>>> Will probaly be on the. Weekend.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, 20 Feb 2020, 10:42 Val K,  wrote:
>>>>>>
>>>>>>> check request.content_type - is that 'application/json' ?
>>>>>>>
>>>>>>> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>>>>>>>
>>>>>>>> getting this from py4web as an api.
>>>>>>>> [image: image.png]
>>>>>>>> Is not what i would like to see from a SPA standpoint.
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> António
>>>>>>>>
>>>>>>>>
>>>>>>>> Em qui., 20 de fev. de 2020 às 18:03, Val K 
>>>>>>>> escreveu:
>>>>>>>>
>

Re: [web2py] py4web jwt ?

2021-03-01 Thread Nico Zanferrari
BTW,

in fact JWT  is cited here :
https://py4web.com/_documentation/static/en/chapter-04.html#sessions - and
I'm even currently working for expanding it ;-)

Nico

Il giorno ven 26 feb 2021 alle ore 19:55 Richard Vézina <
ml.richard.vez...@gmail.com> ha scritto:

> Thanks
>
> On Fri, Feb 26, 2021 at 1:43 PM Kevin Keller  wrote:
>
>> Look for the email thread with the following title in the py4web google
>> group and you ll find a way:
>>
>> Sample Code simple JWT Auth for pydal API
>>
>>
>> in the
>>
>>
>> [image: cloudHQ] <https://www.free-email-tracker.com> Powered by
>> cloudHQ <https://www.free-email-tracker.com>
>>
>> Am Fr., 26. Feb. 2021 um 19:39 Uhr schrieb Richard Vézina <
>> ml.richard.vez...@gmail.com>:
>>
>>> UP!
>>>
>>> Is py4web has jwt token mechanism??
>>>
>>> Evaluating py4web currently (yes getting back to good stuff loved web2py
>>> and pydal)...
>>>
>>> I would need py4web to support jwt (https://jwt.io/). I recall that
>>> been implement in web2py
>>>
>>> Not found anything in the doc about it :
>>> https://py4web.com/_documentation/static/en/chapter-11.html
>>>
>>> Thanks
>>>
>>> Richard
>>>
>>> On Thu, Feb 20, 2020 at 2:19 PM Val K  wrote:
>>>
>>>> As I know py2web already stores _session_token as jwt, no?
>>>>
>>>> On Thursday, February 20, 2020 at 10:00:00 PM UTC+3, Kevin Keller wrote:
>>>>>
>>>>> With a Spa the routing is done in Javascript in the Browser.
>>>>>
>>>>> So Javascript or Vue / React etc need. To check if the user has a
>>>>> access or id_token and if not redirect to the login page to obtain it.
>>>>>
>>>>> Doing crud and be able to secure those crud rest routes will be
>>>>> critical for productivity.
>>>>>
>>>>> So we need a simple jwt token minting engine that at least can spit
>>>>> out a access token for prototyping and and easy way to switch over to 
>>>>> other
>>>>> IAM solutions with py4web for production that can do the token minting.
>>>>>
>>>>> That is something I am currently working on the whole oidc auth part
>>>>> make it easy and I also want to make it available for web2py.
>>>>>
>>>>> I have updated and got the oauth2 login provider working with Okta
>>>>> yesterday and web2py.
>>>>>
>>>>> Will share this. Code asap and sent a push to git to have that
>>>>> provider updated and at some providers for different IAM solutions for 
>>>>> both
>>>>> web2py and py4web going forward.
>>>>>
>>>>> Will try to share an example with py4web asap once I have something
>>>>> working.
>>>>>
>>>>> Will probaly be on the. Weekend.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Thu, 20 Feb 2020, 10:42 Val K,  wrote:
>>>>>
>>>>>> check request.content_type - is that 'application/json' ?
>>>>>>
>>>>>> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>>>>>>
>>>>>>> getting this from py4web as an api.
>>>>>>> [image: image.png]
>>>>>>> Is not what i would like to see from a SPA standpoint.
>>>>>>>
>>>>>>> Regards
>>>>>>> António
>>>>>>>
>>>>>>>
>>>>>>> Em qui., 20 de fev. de 2020 às 18:03, Val K 
>>>>>>> escreveu:
>>>>>>>
>>>>>>>> It seems it depends on request.content_type
>>>>>>>>
>>>>>>>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>>>>>>>
>>>>>>>> --
>>>>>>>> Resources:
>>>>>>>> - http://web2py.com
>>>>>>>> - http://web2py.com/book (Documentation)
>>>>>>>> - http://github.com/web2py/web2py (Source code)
>>>>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>>>>> ---
>>>>>>>> You received this message becaus

Re: [web2py] py4web jwt ?

2021-02-26 Thread Richard Vézina
Thanks

On Fri, Feb 26, 2021 at 1:43 PM Kevin Keller  wrote:

> Look for the email thread with the following title in the py4web google
> group and you ll find a way:
>
> Sample Code simple JWT Auth for pydal API
>
>
> in the
>
>
> [image: cloudHQ] <https://www.free-email-tracker.com> Powered by
> cloudHQ <https://www.free-email-tracker.com>
>
> Am Fr., 26. Feb. 2021 um 19:39 Uhr schrieb Richard Vézina <
> ml.richard.vez...@gmail.com>:
>
>> UP!
>>
>> Is py4web has jwt token mechanism??
>>
>> Evaluating py4web currently (yes getting back to good stuff loved web2py
>> and pydal)...
>>
>> I would need py4web to support jwt (https://jwt.io/). I recall that been
>> implement in web2py
>>
>> Not found anything in the doc about it :
>> https://py4web.com/_documentation/static/en/chapter-11.html
>>
>> Thanks
>>
>> Richard
>>
>> On Thu, Feb 20, 2020 at 2:19 PM Val K  wrote:
>>
>>> As I know py2web already stores _session_token as jwt, no?
>>>
>>> On Thursday, February 20, 2020 at 10:00:00 PM UTC+3, Kevin Keller wrote:
>>>>
>>>> With a Spa the routing is done in Javascript in the Browser.
>>>>
>>>> So Javascript or Vue / React etc need. To check if the user has a
>>>> access or id_token and if not redirect to the login page to obtain it.
>>>>
>>>> Doing crud and be able to secure those crud rest routes will be
>>>> critical for productivity.
>>>>
>>>> So we need a simple jwt token minting engine that at least can spit out
>>>> a access token for prototyping and and easy way to switch over to other IAM
>>>> solutions with py4web for production that can do the token minting.
>>>>
>>>> That is something I am currently working on the whole oidc auth part
>>>> make it easy and I also want to make it available for web2py.
>>>>
>>>> I have updated and got the oauth2 login provider working with Okta
>>>> yesterday and web2py.
>>>>
>>>> Will share this. Code asap and sent a push to git to have that provider
>>>> updated and at some providers for different IAM solutions for both web2py
>>>> and py4web going forward.
>>>>
>>>> Will try to share an example with py4web asap once I have something
>>>> working.
>>>>
>>>> Will probaly be on the. Weekend.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, 20 Feb 2020, 10:42 Val K,  wrote:
>>>>
>>>>> check request.content_type - is that 'application/json' ?
>>>>>
>>>>> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>>>>>
>>>>>> getting this from py4web as an api.
>>>>>> [image: image.png]
>>>>>> Is not what i would like to see from a SPA standpoint.
>>>>>>
>>>>>> Regards
>>>>>> António
>>>>>>
>>>>>>
>>>>>> Em qui., 20 de fev. de 2020 às 18:03, Val K 
>>>>>> escreveu:
>>>>>>
>>>>>>> It seems it depends on request.content_type
>>>>>>>
>>>>>>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>>>>>>
>>>>>>> --
>>>>>>> Resources:
>>>>>>> - http://web2py.com
>>>>>>> - http://web2py.com/book (Documentation)
>>>>>>> - http://github.com/web2py/web2py (Source code)
>>>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "web2py-users" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to web...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%40googlegroups.com
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>> Resources:
>>>>> - http://web2py.com
>>>>> - http://web2py.com/book (Documentation)
>>>>> - http://git

Re: [web2py] py4web jwt ?

2021-02-26 Thread Kevin Keller
Look for the email thread with the following title in the py4web google
group and you ll find a way:

Sample Code simple JWT Auth for pydal API


in the


[image: cloudHQ] <https://www.free-email-tracker.com> Powered by
cloudHQ <https://www.free-email-tracker.com>

Am Fr., 26. Feb. 2021 um 19:39 Uhr schrieb Richard Vézina <
ml.richard.vez...@gmail.com>:

> UP!
>
> Is py4web has jwt token mechanism??
>
> Evaluating py4web currently (yes getting back to good stuff loved web2py
> and pydal)...
>
> I would need py4web to support jwt (https://jwt.io/). I recall that been
> implement in web2py
>
> Not found anything in the doc about it :
> https://py4web.com/_documentation/static/en/chapter-11.html
>
> Thanks
>
> Richard
>
> On Thu, Feb 20, 2020 at 2:19 PM Val K  wrote:
>
>> As I know py2web already stores _session_token as jwt, no?
>>
>> On Thursday, February 20, 2020 at 10:00:00 PM UTC+3, Kevin Keller wrote:
>>>
>>> With a Spa the routing is done in Javascript in the Browser.
>>>
>>> So Javascript or Vue / React etc need. To check if the user has a access
>>> or id_token and if not redirect to the login page to obtain it.
>>>
>>> Doing crud and be able to secure those crud rest routes will be critical
>>> for productivity.
>>>
>>> So we need a simple jwt token minting engine that at least can spit out
>>> a access token for prototyping and and easy way to switch over to other IAM
>>> solutions with py4web for production that can do the token minting.
>>>
>>> That is something I am currently working on the whole oidc auth part
>>> make it easy and I also want to make it available for web2py.
>>>
>>> I have updated and got the oauth2 login provider working with Okta
>>> yesterday and web2py.
>>>
>>> Will share this. Code asap and sent a push to git to have that provider
>>> updated and at some providers for different IAM solutions for both web2py
>>> and py4web going forward.
>>>
>>> Will try to share an example with py4web asap once I have something
>>> working.
>>>
>>> Will probaly be on the. Weekend.
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thu, 20 Feb 2020, 10:42 Val K,  wrote:
>>>
>>>> check request.content_type - is that 'application/json' ?
>>>>
>>>> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>>>>
>>>>> getting this from py4web as an api.
>>>>> [image: image.png]
>>>>> Is not what i would like to see from a SPA standpoint.
>>>>>
>>>>> Regards
>>>>> António
>>>>>
>>>>>
>>>>> Em qui., 20 de fev. de 2020 às 18:03, Val K 
>>>>> escreveu:
>>>>>
>>>>>> It seems it depends on request.content_type
>>>>>>
>>>>>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>>>>>
>>>>>> --
>>>>>> Resources:
>>>>>> - http://web2py.com
>>>>>> - http://web2py.com/book (Documentation)
>>>>>> - http://github.com/web2py/web2py (Source code)
>>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>>> ---
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "web2py-users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to web...@googlegroups.com.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%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 web...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid

Re: [web2py] py4web jwt ?

2021-02-26 Thread Richard Vézina
UP!

Is py4web has jwt token mechanism??

Evaluating py4web currently (yes getting back to good stuff loved web2py
and pydal)...

I would need py4web to support jwt (https://jwt.io/). I recall that been
implement in web2py

Not found anything in the doc about it :
https://py4web.com/_documentation/static/en/chapter-11.html

Thanks

Richard

On Thu, Feb 20, 2020 at 2:19 PM Val K  wrote:

> As I know py2web already stores _session_token as jwt, no?
>
> On Thursday, February 20, 2020 at 10:00:00 PM UTC+3, Kevin Keller wrote:
>>
>> With a Spa the routing is done in Javascript in the Browser.
>>
>> So Javascript or Vue / React etc need. To check if the user has a access
>> or id_token and if not redirect to the login page to obtain it.
>>
>> Doing crud and be able to secure those crud rest routes will be critical
>> for productivity.
>>
>> So we need a simple jwt token minting engine that at least can spit out a
>> access token for prototyping and and easy way to switch over to other IAM
>> solutions with py4web for production that can do the token minting.
>>
>> That is something I am currently working on the whole oidc auth part make
>> it easy and I also want to make it available for web2py.
>>
>> I have updated and got the oauth2 login provider working with Okta
>> yesterday and web2py.
>>
>> Will share this. Code asap and sent a push to git to have that provider
>> updated and at some providers for different IAM solutions for both web2py
>> and py4web going forward.
>>
>> Will try to share an example with py4web asap once I have something
>> working.
>>
>> Will probaly be on the. Weekend.
>>
>>
>>
>>
>>
>>
>> On Thu, 20 Feb 2020, 10:42 Val K,  wrote:
>>
>>> check request.content_type - is that 'application/json' ?
>>>
>>> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>>>
>>>> getting this from py4web as an api.
>>>> [image: image.png]
>>>> Is not what i would like to see from a SPA standpoint.
>>>>
>>>> Regards
>>>> António
>>>>
>>>>
>>>> Em qui., 20 de fev. de 2020 às 18:03, Val K 
>>>> escreveu:
>>>>
>>>>> It seems it depends on request.content_type
>>>>>
>>>>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>>>>
>>>>> --
>>>>> Resources:
>>>>> - http://web2py.com
>>>>> - http://web2py.com/book (Documentation)
>>>>> - http://github.com/web2py/web2py (Source code)
>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>> ---
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "web2py-users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to web...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%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 web...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com
>>> <https://groups.google.com/d/msgid/web2py/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/1e3387f6-bf14-406f-9c6b-306a06630961%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/1e3387f6-bf14-406f-9c6b-306a06630961%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/CAKk5xSzm%3DeCCd24Z0ZXF%3DtikA5Z_GXUet1SDGeEMPGVH%3DdRt1A%40mail.gmail.com.


Re: [web2py] py4web new docs

2020-11-27 Thread sandeep patel
 @Massimo, Thanks for sharing.

On Sat, Nov 28, 2020 at 11:22 AM Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

>
> https://py4web.com/_documentation/static/en/index.html
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/ac20d92a-252e-4394-8116-0aff1a87201fn%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%2BvcePWmzo6yRwAZFVoTMqSP_6Wb5BqadtadMfXfFiHdZzvJjA%40mail.gmail.com.


[web2py] py4web new docs

2020-11-27 Thread Massimo Di Pierro

https://py4web.com/_documentation/static/en/index.html

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/ac20d92a-252e-4394-8116-0aff1a87201fn%40googlegroups.com.


[web2py] py4web grid

2020-07-13 Thread Massimo Di Pierro
For some people, the lack of a server side form/grid in py4web has been 
problem and reason not to move.
We now have a prototype:

https://github.com/web2py/py4web/issues/228

Could use some help testing and feedback.

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/a57c2b2f-a8c2-4745-8335-86f0e4901d95o%40googlegroups.com.


[web2py] py4web - Deployment on GCloud (aka Google App Engine)

2020-04-12 Thread Andrew W
Hi all,
Not a question but a tip for others experimenting with py4web on GCP App 
Engine.

Following the instructions in the _documentation, after a few failed 
attempts to access my app (with 502 and 404 errors), I modified the deploy 
command in the Makefile by adding the --promote flag to make it :

gcloud app deploy app.yaml --promote


I'm ready to build out my first py4web app !

Might be worth adding this to the script and/or documentation.


Regards

Andrew W



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/1d9e301f-7575-4671-a67b-c38c19a8bb37%40googlegroups.com.


[web2py] [py4web] - how to disable some ayth actions?

2020-03-28 Thread Paolo Caruccio
In py4web is there any way to disable some auth actions? I can't find 
anything in the code about this.

In web2py this is possible via auth.settings.action_disabled

For example:

auth.settings.action_disabled=['register']

prevents the "register" action from working.

Tank 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/877d4abf-70db-464d-aebf-7479c055bc7b%40googlegroups.com.


[web2py] py4web group

2020-03-28 Thread Daniel Guilhermino
Hi/Ciao Massimo,

I know that this question has already been raised, but I believe that for 
the evolution of the number of people who will use py4web, would it not be 
the time to dismember this group?

There is research field that can be used, but this mix of framworks is very 
polluted and confusing, especially for the first users.

Best regards,

Daniel Guilhermino

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/20912102-3e80-4e06-8ac6-13e742e1b685%40googlegroups.com.


[web2py] py4web GAE db datastore connection

2020-03-18 Thread Jacinto Parga
Hi, 

I have deployed an app in GAE and works fine with these  db settings in 
settings.py:

# db settings
APP_FOLDER = os.path.dirname(__file__)
APP_NAME = os.path.split(APP_FOLDER)[-1]
# DB_FOLDER:Sets the place where migration files will be created
#   and is the store location for SQLite databases
DB_FOLDER = os.path.join(APP_FOLDER, "databases")
DB_URI = "sqlite://storage.db"
DB_POOL_SIZE = 1

But it's not connected to google:datastore. If I just change:

# db settings
APP_FOLDER = os.path.dirname(__file__)
APP_NAME = os.path.split(APP_FOLDER)[-1]
# DB_FOLDER:Sets the place where migration files will be created
#   and is the store location for SQLite databases
DB_FOLDER = os.path.join(APP_FOLDER, "databases")
DB_URI = "google:datastore"
DB_POOL_SIZE = 1

It returns a not found error.

How can I configure py4web db connection to datastore?

Thanks

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/51f81107-8c9f-4ce2-8e74-8e5f136e20ea%40googlegroups.com.


Re: [web2py] py4web in Google App Engine route app

2020-03-14 Thread Jacinto Parga
Yes. I've created a new application that is the only one I want to serve. 
In that case how can I  do in py4web the same thing I do with routes.py in 
web2py

Thanks

El lunes, 10 de febrero de 2020, 7:07:02 (UTC+1), Massimo Di Pierro 
escribió:
>
> Your .gitcloudignore appears to be ignoring all of the apps:
>
> apps/filemanager
> apps/filemanager/*
> apps/todo
> apps/todo/*
> apps/examples
> apps/examples/*
> apps/_dashboard
> apps/_dashboard/*
> apps/_scaffold
> apps/_scaffold/*
> apps/_minimal
> apps/_minimal/*
> apps/_default
> apps/_default/*
> apps/_documentation/*
> apps/superheroes
> apps/superheroes/*
>
>
>
> On Wednesday, 5 February 2020 12:38:56 UTC-8, Jacinto Parga wrote:
>>
>> No, thanks.
>>
>> Finally it was a problem with the .gcloudignore
>>
>> I had to get rid off every app but the one I wanted to deploy and the 
>> other unneccesary files to the GAE. The only thing left is that I need to 
>> add the name of the application to route the main domain to the proper app.
>>
>> This is my .gcloudignore
>> # This file specifies files that are *not* uploaded to Google Cloud 
>> Platform
>> # using gcloud. It follows the same syntax as .gitignore, with the 
>> addition of
>> # "#!include" directives (which insert the entries of the given 
>> .gitignore-style
>> # file at that point).
>> #
>> # For more information, run:
>> #   $ gcloud topic gcloudignore
>> #
>> .gcloudignore
>> # If you would like to upload your .git directory, .gitignore file or 
>> files
>> # from your .gitignore file, remove the corresponding line
>> # below:
>> .git
>> .gitignore
>>
>> #Ojo no se puede quitar requirements.txt
>>
>> # Python pycache:
>> __pycache__/
>> # Ignored by the build system
>> /setup.cfg
>>
>> .travis.yml
>> *.pyc
>> *.pyo
>> *~
>> #*
>> *.1
>> *.bak
>> *.bak2
>> *.svn
>> *.w2p
>> *.class
>> *.rej
>> *.orig
>> Thumbs.db
>> .DS_Store
>> ./deposit
>> ./benchmark
>> ./build
>> ./dist
>> ./ssl
>> ./docs
>> ./logs
>> ./*.zip
>> !apps/*
>> apps/filemanager
>> apps/filemanager/*
>> apps/todo
>> apps/todo/*
>> apps/examples
>> apps/examples/*
>> apps/_dashboard
>> apps/_dashboard/*
>> apps/_scaffold
>> apps/_scaffold/*
>> apps/_minimal
>> apps/_minimal/*
>> apps/_default
>> apps/_default/*
>> apps/_documentation/*
>> apps/superheroes
>> apps/superheroes/*
>> apps/*/databases/README*
>> pps/*/databases/*
>> apps/*/uploads/*
>> apps/*/*.py[oc]
>> packages/
>> deployment_tools/*
>> deployment_tools/
>> tests/*
>> tests/
>> README.md
>> test-requirements.txt
>> source-context.json
>> password.txt
>> py4web-start.py
>> setup.py
>>
>>
>> And I'm using the default app.yaml may be this is the problem
>>
>> runtime: python37
>>
>>
>> # Handlers define how to route requests to your application.
>> handlers:
>>
>> - url: .*  # This regex directs all routes to main.bottle
>>   script: auto
>>
>> So I had to write  the name of the application in the navigation bar: 
>>
>> https://myapplication.appspot.com/*aplicationname*
>>
>> In other case I get a not found page.
>>
>> And it goes very very slow, it is only a login page.
>>
>> Some help?
>>
>>
>>
>> El martes, 4 de febrero de 2020, 20:09:59 (UTC+1), Christian Varas 
>> escribió:
>>>
>>> Hi I haven’t tried GAE but maybe is the controller.
>>>
>>> Are you using the decorator ’action()’ to expose the function ?.
>>>
>>> Ex:
>>> @action('some_name')
>>> def some_function():
>>>
>>>   return locals()
>>>
>>> Then you acces like http://IP/your_app/some_name
>>>
>>> Cheers.
>>> Chris.
>>>
>>> El El mar, 4 de feb. de 2020 a la(s) 15:46, Jacinto Parga <
>>> jpa...@gmail.com> escribió:
>>>
 I cannot properly deploy a simple py4web app in GAE. I think it's just 
 a .gcloudignore or a app.yaml configuration issue. The only thing I've got 
 is a not found page.

 [image: minimal-py4web.png]

 Some help about how to route the right app in the google app engine?

 Thanks




 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the Google 
 Groups "web2py-users" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to web...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/web2py/a7ba6f1c-2c53-4f30-8197-9c0b51d3229d%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 

[web2py] py4web: json-response on server errors

2020-03-10 Thread Val K
Hello!
I'd like to discuss my PR  https://github.com/web2py/py4web/pull/123

The reason:
Currently, if you make an ajax request and expect json-response, in case of 
any error on the server, py4web returns a response that is an html page 
with response.status = 200. My PR changes this behavior to the following 
logic - if there is `application / json` in the http_accept-header, a json 
is returned that contains the same information as the html error-page with 
the actual response.status, so the error can be caught using the 
appropriate callback (this is a more common practice)

   

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/afb5d9e4-4a6d-4d74-8bb6-1ac45e35af89%40googlegroups.com.


[web2py] Py4Web fields of type 'upload' not working

2020-03-09 Thread John Bannister
Hi All,

Still struggling a lot with fields of type 'upload'. Whatever I try the 
field remains None. Any help greatly appreciated.

Typical use case is as follows:

Model:
db.define_table('test',
Field('f_name'),
Field('l_name'),
Field('image', 'upload', default='test'))

Controller:
@action('test', method=['GET','POST'])
@action.uses('generic.html', session, db, T)
def test():
page_title = 'Test'
messages=[]
my_dict = request.query.decode()
post_vars = request.forms
form=Form(db.test)
print ('Form vars before are %s' % form.vars)
if form.accepted:
print('inside form accepted')
print ('Form vars are %s' % form.vars)
elif form.errors:
messages.append('form %s has errors: %s ' % (form.form_name, 
form.errors))
return dict(form=form, page_title=page_title, messages=messages)

All fields/form.vars etc are okay except for image which is always None.

All help greatly appreciated
John

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/727d310d-2284-431e-9535-d80693756db0%40googlegroups.com.


[web2py] Py4web working with images

2020-03-07 Thread John Bannister
Hi All,

Has anyone got a working exsmple of working with images in Py4Web 
preferrably with thumbnails as well?

Thanks in advance 
John

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/1fce59dd-ff63-4b5d-83ef-d99363e59f90%40googlegroups.com.


[web2py] Py4web readonly Form

2020-03-06 Thread John Bannister
Hi All,

I have been testing Py4web and have the following to produce basically a 
'view record' option :-

def view_test():
form=Form(db.auth_user, record=1, readonly=True, deletable=False, 
formstyle=FormStyleBulma)
if form.accepted:
redirect(URL('index'))
return dict(form=form)

This will redirect if I remove the readonly=True from the form but 
basically form is just displayed (all fields are readonly) and you can hit 
the submit button as many times as you like and nothing will happen.

Any ideas??

BR
John

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/75b018fb-f3b6-47a4-8b50-fec32d8740ae%40googlegroups.com.


[web2py] py4web - some questions

2020-03-02 Thread lyn2py
Hi,

May I know where is the "right" or "best" place to put my custom modules 
(those I wrote myself) in py4web?

I usually have many controller files in web2py. With py4web, does it mean 
that there will only be 1 controller file and all the controllers go into 
that file only?

Why is there a need to "make install"? (sorry for the noob question) I 
really liked that I can just use web2py out of the box.

Thanks!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0b907636-2179-40e8-8f90-815c595452c9%40googlegroups.com.


[web2py] py4web posting to db

2020-02-28 Thread Maurice Waka
I'm still learning a lot from py4web.especially not being a programmer 
myself, and I appreciate a lot from the help I get from you ALL. 

Anyway, I managed o create the tables and controller functions but I note 
that I'm not able to post to the database, at the same time, I cant see the 
messages on the index page..this code works well in web2py. I hope I have 
posted all relevant info.

My codes are as follows:
Controller:


import requests
from . common import *
from pydal.validators import *
from datetime import datetime, timedelta, date
from py4web.utils.auth import Auth
from py4web.utils.form import Form, FormStyleBulma
from py4web.utils.publisher import Publisher, ALLOW_ALL_POLICY
from .common import db, session, T, cache, auth, logger, authenticated, 
unauthenticated
from py4web import action, request, DAL, Field, Session, Cache, user_in, 
abort, redirect, URL, Translator
from pydal.validators import IS_NOT_EMPTY, IS_INT_IN_RANGE, IS_IN_SET, 
IS_IN_DB, IS_EMAIL, IS_MATCH
from yatl.helpers import A, TEXTAREA, INPUT, TR, TD, TABLE, DIV, LABEL, FORM
, SELECT, OPTION, P, H1, H2, H3, H4, H5, HTML, BODY, META


auth = Auth(session, db)
# (configure here)
auth.enable()


@authenticated()
@action.uses(db, session, T, auth.user)
def index():
codes = []
del codes[:]
r = []
yesterday = datetime.utcnow() - timedelta(days=1)
db(db.answers.modified_on < yesterday).delete()
form = FORM(INPUT(_name='message'), INPUT(_type='submit'))
if request.POST.vars:
r.append(request.POST.message)
codes.append(r[0])
#db.posts.insert(message=codes[0])
rows = db(db.posts.author== auth.user_id).select()
for row in rows:
row.update_record(message=codes[0])
...more code
reports = 'wellness_main.report()' #data from modules
name3 = request.POST.message #string from user
db.answers.insert(quest=name3, message = report())

replies = db(db.answers.author == auth.user_id).select(db.answers.ALL, 
orderby=db.answers.created_on)[-7:-1] # show the last few posts from the 
table
return dict(name3=name3, reports=reports, replies=replies)

Models:

from datetime import datetime, timedelta, date
from py4web import action, request, DAL, Field, Session, Cache, user_in
from py4web.utils.auth import Auth
from py4web import action, request, abort, redirect, URL, Field
from py4web.utils.form import Form, FormStyleBulma
from py4web.utils.publisher import Publisher, ALLOW_ALL_POLICY
from pydal.validators import IS_NOT_EMPTY, IS_INT_IN_RANGE, IS_IN_SET, 
IS_IN_DB, IS_EMAIL, IS_MATCH
from yatl.helpers import INPUT, H1, HTML, BODY, A
from pydal.validators import *
from . common import db, session, T, cache, authenticated, unauthenticated, 
Field




# exposes services necessary to access the db.thing via ajax
publisher = Publisher(db, policy=ALLOW_ALL_POLICY)
# define session and cache objects
session = Session(secret="some secret")
cache = Cache(size=1000)


auth = Auth(session, db)

# (configure here)
auth.enable()


db.define_table('posts',
Field('author', 'reference auth_user', default=auth.user_id, 
writable=False, readable=False),
Field("message", 'text', requires=IS_NOT_EMPTY(), notnull=
False),
auth.signature

)
db.define_table('answers',
Field('author', 'reference auth_user', default=auth.user_id, 
readable=False, writable=False),
Field('quest', 'text', requires=IS_NOT_EMPTY(),),
Field("message", 'text', requires=IS_NOT_EMPTY(),),
Field('posted_on','datetime', default=datetime.utcnow()),
auth.signature
)

View...index.html

N/B
This is part of a long html, js code:


[[for reply in replies:]]

[[=reply.modified_on]]

[[=XML(reply.quest, sanitize=True)]]   
 



[[=reply.posted_on]]





Read answer

[[=XML(reply.message, sanitize=True)]]


 


[[pass]]






-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/e15ac33e-4812-4a0f-b2d0-668eb272bf94%40googlegroups.com.


Re: [web2py] Re: The PyDal/Yatl Web2Py/Py4web Emmet/Weppy Ecosystem

2020-02-27 Thread Jim S
Thanks Kevin, I saw that, but other than the name change seems like not 
much activity.  Any other activity on it?  Seems like a nice framework.

-Jim

On Thursday, February 27, 2020 at 11:47:05 AM UTC-6, Kevin Keller wrote:
>
> Hey Jim, 
>
> Weppy is now re-named to Emmet:
>
> https://github.com/emmett-framework/emmett
>
>
>
> On Thu, Feb 27, 2020 at 6:38 PM Jim S > 
> wrote:
>
>> Kevin
>>
>> I'm curious about your comment on Weppy/Emmet evolving.  Looks like there 
>> has been only 1 commit in the past 16 months or so (it is possible I'm 
>> reading that wrong).  What do you know about their progress.  Also, I'd 
>> love to be able to use PyDAL as classes as used in weppy (while not taking 
>> away the current capabilities).  That would be a great step forward.
>>
>> -Jim
>>
>> On Thursday, February 27, 2020 at 10:23:19 AM UTC-6, Kevin Keller wrote:
>>>
>>> I was thinking, just by how often I go back to Web2Py, what an excellent 
>>> framework it is and
>>> the progress of Py4Web is also exciting, while also noticing how the 
>>> pydal/yatl based framework Weppy/Emmet is evolving, 
>>> that really there is no need anymore to think in terms of the future of 
>>> a single framework. 
>>>
>>> I feel like Web2Py has evolved into its own family sort of like: 
>>>
>>> Web2Py - the opinionated full stack low code enterprise framework
>>> Py4Web - the api first flexible microframework with some batteries 
>>> included
>>> Emmet/Weppy - the opinionated small scale framework
>>>
>>> I myself also used PyDal and Yatl with Flask which also worked nice. 
>>>
>>> I feel like the PyDal/Yatl combination has evolved into its own 
>>> ecosystem that can share a great deal of code
>>> you can easily switch from one to the other depending on your use case 
>>> and can happily co-exist.. no? 
>>>
>>> Almost felt like finding a name for the PyDal/Yatl based type of 
>>> frameworks which contrast the Django/ORM and SQLAlchemy/Almembic world of 
>>> frameworks 
>>> and shine through ease of use compared to those. 
>>>
>>>
>>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/88f6bbdf-770d-4752-ae5a-c688567e1dcf%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/adf146a0-27f0-4106-b7a2-03f0ceb7c55b%40googlegroups.com.


Re: [web2py] Re: The PyDal/Yatl Web2Py/Py4web Emmet/Weppy Ecosystem

2020-02-27 Thread Kevin Keller
Hey Jim,

Weppy is now re-named to Emmet:

https://github.com/emmett-framework/emmett



On Thu, Feb 27, 2020 at 6:38 PM Jim S  wrote:

> Kevin
>
> I'm curious about your comment on Weppy/Emmet evolving.  Looks like there
> has been only 1 commit in the past 16 months or so (it is possible I'm
> reading that wrong).  What do you know about their progress.  Also, I'd
> love to be able to use PyDAL as classes as used in weppy (while not taking
> away the current capabilities).  That would be a great step forward.
>
> -Jim
>
> On Thursday, February 27, 2020 at 10:23:19 AM UTC-6, Kevin Keller wrote:
>>
>> I was thinking, just by how often I go back to Web2Py, what an excellent
>> framework it is and
>> the progress of Py4Web is also exciting, while also noticing how the
>> pydal/yatl based framework Weppy/Emmet is evolving,
>> that really there is no need anymore to think in terms of the future of a
>> single framework.
>>
>> I feel like Web2Py has evolved into its own family sort of like:
>>
>> Web2Py - the opinionated full stack low code enterprise framework
>> Py4Web - the api first flexible microframework with some batteries
>> included
>> Emmet/Weppy - the opinionated small scale framework
>>
>> I myself also used PyDal and Yatl with Flask which also worked nice.
>>
>> I feel like the PyDal/Yatl combination has evolved into its own ecosystem
>> that can share a great deal of code
>> you can easily switch from one to the other depending on your use case
>> and can happily co-exist.. no?
>>
>> Almost felt like finding a name for the PyDal/Yatl based type of
>> frameworks which contrast the Django/ORM and SQLAlchemy/Almembic world of
>> frameworks
>> and shine through ease of use compared to those.
>>
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/88f6bbdf-770d-4752-ae5a-c688567e1dcf%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/CADHCKLR7Fc9pA9J07Ckk2FgSs_C25Q6ixChxHU946XETCRpLnQ%40mail.gmail.com.


[web2py] py4web defining tables

2020-02-27 Thread Val K
There is import db from common, but later there is db = DAL(...) in the same 
file!

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/601d5362-6449-4033-8e8a-7e3410c36b0a%40googlegroups.com.


[web2py] Re: The PyDal/Yatl Web2Py/Py4web Emmet/Weppy Ecosystem

2020-02-27 Thread Jim S
Kevin

I'm curious about your comment on Weppy/Emmet evolving.  Looks like there 
has been only 1 commit in the past 16 months or so (it is possible I'm 
reading that wrong).  What do you know about their progress.  Also, I'd 
love to be able to use PyDAL as classes as used in weppy (while not taking 
away the current capabilities).  That would be a great step forward.

-Jim

On Thursday, February 27, 2020 at 10:23:19 AM UTC-6, Kevin Keller wrote:
>
> I was thinking, just by how often I go back to Web2Py, what an excellent 
> framework it is and
> the progress of Py4Web is also exciting, while also noticing how the 
> pydal/yatl based framework Weppy/Emmet is evolving, 
> that really there is no need anymore to think in terms of the future of a 
> single framework. 
>
> I feel like Web2Py has evolved into its own family sort of like: 
>
> Web2Py - the opinionated full stack low code enterprise framework
> Py4Web - the api first flexible microframework with some batteries included
> Emmet/Weppy - the opinionated small scale framework
>
> I myself also used PyDal and Yatl with Flask which also worked nice. 
>
> I feel like the PyDal/Yatl combination has evolved into its own ecosystem 
> that can share a great deal of code
> you can easily switch from one to the other depending on your use case and 
> can happily co-exist.. no? 
>
> Almost felt like finding a name for the PyDal/Yatl based type of 
> frameworks which contrast the Django/ORM and SQLAlchemy/Almembic world of 
> frameworks 
> and shine through ease of use compared to those. 
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/88f6bbdf-770d-4752-ae5a-c688567e1dcf%40googlegroups.com.


[web2py] The PyDal/Yatl Web2Py/Py4web Emmet/Weppy Ecosystem

2020-02-27 Thread Kevin Keller
I was thinking, just by how often I go back to Web2Py, what an excellent 
framework it is and
the progress of Py4Web is also exciting, while also noticing how the 
pydal/yatl based framework Weppy/Emmet is evolving, 
that really there is no need anymore to think in terms of the future of a 
single framework. 

I feel like Web2Py has evolved into its own family sort of like: 

Web2Py - the opinionated full stack low code enterprise framework
Py4Web - the api first flexible microframework with some batteries included
Emmet/Weppy - the opinionated small scale framework

I myself also used PyDal and Yatl with Flask which also worked nice. 

I feel like the PyDal/Yatl combination has evolved into its own ecosystem 
that can share a great deal of code
you can easily switch from one to the other depending on your use case and 
can happily co-exist.. no? 

Almost felt like finding a name for the PyDal/Yatl based type of frameworks 
which contrast the Django/ORM and SQLAlchemy/Almembic world of frameworks 
and shine through ease of use compared to those. 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/72d1d3fe-fbc4-4011-a13c-ed8b6c4f2071%40googlegroups.com.


[web2py] py4web defining tables

2020-02-27 Thread Maurice Waka
Hello, from this code, I have already defined my table in models as follows:

import os
import datetime as dt
from datetime import datetime, timedelta, date
from py4web import action, request, DAL, Field, Session, Cache, user_in
from py4web.utils.auth import Auth
from py4web import action, request, abort, redirect, URL, Field
from py4web.utils.form import Form, FormStyleBulma
from py4web.utils.publisher import Publisher, ALLOW_ALL_POLICY
from pydal.validators import * #IS_NOT_EMPTY, IS_INT_IN_RANGE, IS_IN_SET, 
IS_IN_DB, IS_EMAIL, IS_MATCH
from pydal.validators import *
from . common import db, session, T, cache, authenticated, unauthenticated, 
Field
from pydal.validators import *


### Define your table below


# exposes services necessary to access the db.thing via ajax
publisher = Publisher(db, policy=ALLOW_ALL_POLICY)
# define session and cache objects
session = Session(secret="some secret")
cache = Cache(size=1000)


# define database and tables
#connection = sqlite.connect('cache.db', timeout=10)
db = DAL("sqlite://xstorage.db", folder=os.path.join(os.path.dirname(
__file__), "databases"))#db = DAL("sqlite://storage.db", 
folder=os.path.join(os.path.dirname(__file__), "databases"))
#db = DAL( "postgres://mauricewaka:b3th32dau2a##@localhost:5432/py4db", 
migrate=False)
auth = Auth(session, db)
# (configure here)
auth.enable()


db.define_table('answers',
Field('author', 'reference auth_user', default=auth.user_id, 
writable=False, readable=False),
Field("message", 'text', requires=IS_NOT_EMPTY(), notnull=
False),
auth.signature
)




In the controllers, this is my code:

@authenticated()
@action.uses(auth.user)
def index():

...some code...
yesterday = dt.datetime.utcnow() - dt.timedelta(days=1)

db(db.answers.modified_on < yesterday).delete()
...some more code



But I get this errors:
Traceback (most recent call last):
 File "/home/maurice/py4web/py4web/core.py", line 551, in wrapper
 ret = func(*func_args, **func_kwargs)
 File "/home/maurice/py4web/py4web/core.py", line 512, in wrapper
 ret = func(*args, **kwargs)
 File "/home/maurice/py4web/py4web/core.py", line 512, in wrapper
 ret = func(*args, **kwargs)
 File "apps/scaffoldx/controllers.py", line 571, in index
 db(db.answers.modified_on < yesterday).delete()
 File "/home/maurice/.local/lib/python3.6/site-packages/pydal/base.py", 
line 763, in __getattr__
 return BasicStorage.__getattribute__(self, key)
AttributeError: 'DAL' object has no attribute 'answers'



What could be wrong here and how can I solve it?

N/B

I have tried to define the table inside the controller code with an error 
coming as : 'table already defined'. When I remove the definition then the 
above error comes.

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/92cd4884-d353-4875-b900-f84f164d32e7%40googlegroups.com.


[web2py] Py4Web "tags" should be SCOPES

2020-02-24 Thread Kevin Keller
Hey, 

I would like to suggest, that if Py4Web is supposed to be an API first 
framework that it adheres to 
modern auth standards right out of the gate. 

Apart from having the ability to provide JWT access tokens and more Oauth2 
plugins then just facebook and google ( all things I started to work on)
I think we need to to think in terms of scopes when it comes to access 
management instead of "tags" for access authorization. 

It is pretty much the same thing, but using the the term scopes and 
adhering to the oauth2 terms and philosophy will make it 
easier for programmers to understand how to secure APIs created with py4web 
faster. 

We also need to the ability to properly parse JWT tokens so that scopes 
included in the token can be matched to what is now called py4web "tags" 
for data authorization. Also, we should be easily able to validate JWT 
tokens offline.

Plus py4web, if it wants to play the API game, needs to be able to extract 
claims from a JWT token in order to contextualize an API call easily. 

I think I have my work cut out for me, but just putting it out there, in 
the hope I can garner some support and understanding for this idea/approach
and maybe someone wants to also help out with this who understands API 
design and OIDC/Oauth2. 

Maybe we can use some library the is there i.e.:

https://requests-oauthlib.readthedocs.io/en/latest/index.html

and if want to mint our own JWT tokens for prototyping:

https://github.com/Refinitiv/bottle-oauthlib

I ll look into that, unless you have a better idea. 




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3a8a0f6a-f64e-4941-892b-9adfaac8216a%40googlegroups.com.


[web2py] PY4WEB request.vars error

2020-02-23 Thread Maurice Waka
New issue with py4web.

Whats the new code for request.vars??

I get this error:


Traceback (most recent call last):
 File "/home/maurice/.local/lib/python3.6/site-packages/bottle.py", line 
1397, in __getattr__
 var = self.environ['bottle.request.ext.%s'%name]
KeyError: 'bottle.request.ext.vars'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/home/maurice/py4web/py4web/core.py", line 551, in wrapper
 ret = func(*func_args, **func_kwargs)
 File "/home/maurice/py4web/py4web/core.py", line 512, in wrapper
 ret = func(*args, **kwargs)
 File "apps/_scaffolds/controllers.py", line 86, in index
 if request.vars:
 File "/home/maurice/.local/lib/python3.6/site-packages/bottle.py", line 
1400, in __getattr__
 raise AttributeError('Attribute %r not defined.' % name)
AttributeError: Attribute 'vars' not defined.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/1bb010ad-fb3a-41bb-ad02-105d4bdce51d%40googlegroups.com.


[web2py] py4web URL helper documentation missing?

2020-02-23 Thread RHC
HI,

Looking at the py4web documentation at 
http://py4web.com/_documentation/static/index.html#chapter-08 I see the 
following where I expected to find details of the URL helper.

URL

The URL helper is documented in [[Chapter 4 URL ../04#URL]]

I go to Chapter 4: 
http://py4web.com/_documentation/static/index.html#chapter-04


but the documentation isn't in there either. I needed to look it up as args 
is reported to be an unexpected keyword (web2py used args judging by some 
of my old code, but py4web uses vars instead it seems by looking at the 
py4web source code).


Regards,


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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f1bd171c-5825-459e-8fbf-6c484bf40858%40googlegroups.com.


Re: [web2py] py4web issue on get requests

2020-02-22 Thread Christian Varas
Hi Torrini,

I don’t know what is causing the error but you can use a local proxy like
burp suite to catch your client request and see what’s wrong with that
request. If is malformed you can see with with this.

Cheers.

El El sáb, 22 de feb. de 2020 a la(s) 01:38, Edoardo Torrini <
edoardo.torr...@gmail.com> escribió:

> Good morning,
>
> I am a software developer and I want to create a project client-server.
> The client is wrote in c# with xamarine and the server on py4web.
> The client create request with some parameters and the server reply with a
> data in json form.
> I use celery for scheduling the request and I create a task for each type
> of requests.
>
> When with the client application I create a request [like the example
> below], the function await.response.Content.ReadAsStringAsync create an
> exception: *unexpected end of stream*
>
> [image: Exception - Xamarine.png]
>
>
> Server side the situation is that I create for each request a DAL and I
> define a table where I took the date to send to the client.
> in this way:
> [image: Controller - py4web.png]
>
> I invoke  the task that reply the json file to the client in this way:
>
> [image: task prd - py4web.png]
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Someone know why the operation create this type of exception, I try using
> a request with chrome but the page was displayed correctly.
> Thanks for the help.
>
> Edoardo Torrini
>
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/a25df1ac-50b3-4033-a661-374577da6281%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%2BuJtGtB6AQxAq6C9rDU%3D7vS1s4Jy1%3Df84AmicV2KL%3DXDYwQ%40mail.gmail.com.


[web2py] py4web issue on get requests

2020-02-21 Thread Edoardo Torrini
Good morning,

I am a software developer and I want to create a project client-server.
The client is wrote in c# with xamarine and the server on py4web.
The client create request with some parameters and the server reply with a 
data in json form.
I use celery for scheduling the request and I create a task for each type 
of requests.

When with the client application I create a request [like the example 
below], the function await.response.Content.ReadAsStringAsync create an 
exception: *unexpected end of stream*

[image: Exception - Xamarine.png]


Server side the situation is that I create for each request a DAL and I 
define a table where I took the date to send to the client.
in this way:
[image: Controller - py4web.png]

I invoke  the task that reply the json file to the client in this way:

[image: task prd - py4web.png] 








































Someone know why the operation create this type of exception, I try using a 
request with chrome but the page was displayed correctly.
Thanks for the help.

Edoardo Torrini




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/a25df1ac-50b3-4033-a661-374577da6281%40googlegroups.com.


Re: [web2py] py4web jwt ?

2020-02-20 Thread Val K
As I know py2web already stores _session_token as jwt, no? 

On Thursday, February 20, 2020 at 10:00:00 PM UTC+3, Kevin Keller wrote:
>
> With a Spa the routing is done in Javascript in the Browser.
>
> So Javascript or Vue / React etc need. To check if the user has a access 
> or id_token and if not redirect to the login page to obtain it.
>
> Doing crud and be able to secure those crud rest routes will be critical 
> for productivity. 
>
> So we need a simple jwt token minting engine that at least can spit out a 
> access token for prototyping and and easy way to switch over to other IAM 
> solutions with py4web for production that can do the token minting. 
>
> That is something I am currently working on the whole oidc auth part make 
> it easy and I also want to make it available for web2py. 
>
> I have updated and got the oauth2 login provider working with Okta 
> yesterday and web2py. 
>
> Will share this. Code asap and sent a push to git to have that provider 
> updated and at some providers for different IAM solutions for both web2py 
> and py4web going forward. 
>
> Will try to share an example with py4web asap once I have something 
> working. 
>
> Will probaly be on the. Weekend. 
>
>
>
>
>
>
> On Thu, 20 Feb 2020, 10:42 Val K, > wrote:
>
>> check request.content_type - is that 'application/json' ?
>>
>> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>>
>>> getting this from py4web as an api. 
>>> [image: image.png]
>>> Is not what i would like to see from a SPA standpoint.
>>>
>>> Regards
>>> António
>>>
>>>
>>> Em qui., 20 de fev. de 2020 às 18:03, Val K  
>>> escreveu:
>>>
>>>> It seems it depends on request.content_type 
>>>>
>>>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>>>
>>>> -- 
>>>> Resources:
>>>> - http://web2py.com
>>>> - http://web2py.com/book (Documentation)
>>>> - http://github.com/web2py/web2py (Source code)
>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "web2py-users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to web...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%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 web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/web2py/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/1e3387f6-bf14-406f-9c6b-306a06630961%40googlegroups.com.


Re: [web2py] py4web jwt ?

2020-02-20 Thread Kevin Keller
With a Spa the routing is done in Javascript in the Browser.

So Javascript or Vue / React etc need. To check if the user has a access or
id_token and if not redirect to the login page to obtain it.

Doing crud and be able to secure those crud rest routes will be critical
for productivity.

So we need a simple jwt token minting engine that at least can spit out a
access token for prototyping and and easy way to switch over to other IAM
solutions with py4web for production that can do the token minting.

That is something I am currently working on the whole oidc auth part make
it easy and I also want to make it available for web2py.

I have updated and got the oauth2 login provider working with Okta
yesterday and web2py.

Will share this. Code asap and sent a push to git to have that provider
updated and at some providers for different IAM solutions for both web2py
and py4web going forward.

Will try to share an example with py4web asap once I have something
working.

Will probaly be on the. Weekend.






On Thu, 20 Feb 2020, 10:42 Val K,  wrote:

> check request.content_type - is that 'application/json' ?
>
> On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>>
>> getting this from py4web as an api.
>> [image: image.png]
>> Is not what i would like to see from a SPA standpoint.
>>
>> Regards
>> António
>>
>>
>> Em qui., 20 de fev. de 2020 às 18:03, Val K  escreveu:
>>
>>> It seems it depends on request.content_type
>>>
>>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to web...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%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/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/CADHCKLTo0Dd0ttzt71c9-ALME%2BeYS0-JkX6nV641eOCbTH780g%40mail.gmail.com.


Re: [web2py] py4web jwt ?

2020-02-20 Thread Val K
check request.content_type - is that 'application/json' ?

On Thursday, February 20, 2020 at 9:28:43 PM UTC+3, Ramos wrote:
>
> getting this from py4web as an api. 
> [image: image.png]
> Is not what i would like to see from a SPA standpoint.
>
> Regards
> António
>
>
> Em qui., 20 de fev. de 2020 às 18:03, Val K  > escreveu:
>
>> It seems it depends on request.content_type 
>>
>> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/9608a9ab-d338-4580-9d02-31b9b9a30782%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/77ac539d-a83e-4931-ae79-424c3a4711fd%40googlegroups.com.


Re: [web2py] py4web jwt ?

2020-02-20 Thread António Ramos
getting this from py4web as an api.
[image: image.png]
Is not what i would like to see from a SPA standpoint.

Regards
António


Em qui., 20 de fev. de 2020 às 18:03, Val K  escreveu:

> It seems it depends on request.content_type
>
> https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/9608a9ab-d338-4580-9d02-31b9b9a30782%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/CAEM0BxMwtYztWzkpacrh9zBdMhU3t1C7budbPu24NkdxXeThww%40mail.gmail.com.


[web2py] py4web jwt ?

2020-02-20 Thread Val K
It seems it depends on request.content_type 
https://github.com/web2py/py4web/blob/e6b3d5e10e15976af153c4a4e6b349a02fe6c2a9/py4web/utils/auth.py#L35

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/9608a9ab-d338-4580-9d02-31b9b9a30782%40googlegroups.com.


[web2py] py4web jwt ?

2020-02-20 Thread Val K
+1 autoredirect should be an option

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/69e76d33-e2d4-4316-9322-e703a431b4b1%40googlegroups.com.


[web2py] py4web

2020-02-20 Thread Val K
You can press "reload apps" in the dashboard

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/aa8ec5cd-a145-4c99-9265-fd34e589254b%40googlegroups.com.


[web2py] py4web jwt ?

2020-02-20 Thread António Ramos
this code  from the docs...

@action('index')
@action.uses(auth.user)def index():

return {"ok":1}

Here @action.uses(auth.user) tells py4web that this action requires a
logged in user and should redirect to login if no user is logged in.



this redirect is good for an full web2py app.

What if i have a SPA in vue ?

In case the user is not logged it it should not redirect to login page
because the apps is a outsider vue spa. How to return an error to vue spa ??

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


[web2py] py4web

2020-02-20 Thread António Ramos
Any time i change controllers.py i have to stop and restart the server. why
??

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


Re: [web2py] py4web: request.now not working

2020-02-19 Thread Maurice Waka
Both do not work.

So I just got this:

 import datetime as dt

default = dt.datetime.utcnow()

On Wed, Feb 19, 2020, 12:49 Alexander Hoch  wrote:

> Try request.now with the function call (). only "default=request.now" and
> "update=request.now"
>
> Am Mi., 19. Feb. 2020 um 10:24 Uhr schrieb Maurice Waka <
> mauricew...@gmail.com>:
>
>> Hello.
>>
>> I'm still stuck at this error:
>>
>> Field('modified_on', 'datetime', default=request.now(), 
>> update=request.now()),
>>   File "/usr/local/lib/python3.6/dist-packages/bottle.py", line 1400, in 
>> __getattr__
>> raise AttributeError('Attribute %r not defined.' % name)
>> AttributeError: Attribute 'now' not defined.
>>
>>
>>
>> Any help out there?
>> 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/4e1fba9b-a388-4846-a101-c40d7557a9b1%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/aAYTHke4pG4/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/CAHAvb9yPqUb%2Bqf7d%2BVjP45Dj3-%3Dr-jGh5jMbVaLFi7MokNG-wQ%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/CALkNK54PVHgZO%2BH3BvR6KrdeLvP%3DFa7JGaE3o%3Dcu-duVeag%3Dsg%40mail.gmail.com.


Re: [web2py] py4web: request.now not working

2020-02-19 Thread Alexander Hoch
Try request.now with the function call (). only "default=request.now" and
"update=request.now"

Am Mi., 19. Feb. 2020 um 10:24 Uhr schrieb Maurice Waka <
mauricew...@gmail.com>:

> Hello.
>
> I'm still stuck at this error:
>
> Field('modified_on', 'datetime', default=request.now(), update=request.now()),
>   File "/usr/local/lib/python3.6/dist-packages/bottle.py", line 1400, in 
> __getattr__
> raise AttributeError('Attribute %r not defined.' % name)
> AttributeError: Attribute 'now' not defined.
>
>
>
> Any help out there?
> 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/4e1fba9b-a388-4846-a101-c40d7557a9b1%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/CAHAvb9yPqUb%2Bqf7d%2BVjP45Dj3-%3Dr-jGh5jMbVaLFi7MokNG-wQ%40mail.gmail.com.


[web2py] py4web: request.now not working

2020-02-19 Thread Maurice Waka
Hello.

I'm still stuck at this error:

Field('modified_on', 'datetime', default=request.now(), update=request.now()),
  File "/usr/local/lib/python3.6/dist-packages/bottle.py", line 1400, in 
__getattr__
raise AttributeError('Attribute %r not defined.' % name)
AttributeError: Attribute 'now' not defined.



Any help out there?
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/4e1fba9b-a388-4846-a101-c40d7557a9b1%40googlegroups.com.


Re: [web2py] py4web psycopg2 error

2020-02-18 Thread Maurice Waka
Thanks.
It's working now.
Regards

On Tue, Feb 18, 2020, 18:31 E L  wrote:

> you need to install psycopg2 package
> pip3 install psycopg2
> or
> pip3 install psycopg2-binary
>
> On Tue, Feb 18, 2020 at 7:52 AM Maurice Waka 
> wrote:
> >
> > SO I start importing/changing from web2py to py4web.
> >   File
> "/home/maurice/.local/lib/python3.6/site-packages/pydal/adapters/base.py",
> line 134, in find_driver
> > "No driver of supported ones %s is available" % str(self.drivers)
> > RuntimeError: No driver of supported ones ('psycopg2',) is available
> >
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/_eAry33WzMo/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/CAEVys%2BSe%3DqfgGq4wd6TSaH2Gf2SspvA363XyJtKkAQEqHXh3yA%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/CALkNK54nVxqf9UYnO41CyeqLd3qdiE35oV2u%3DvUtYBdyXuvwqg%40mail.gmail.com.


Re: [web2py] py4web psycopg2 error

2020-02-18 Thread E L
you need to install psycopg2 package
pip3 install psycopg2
or
pip3 install psycopg2-binary

On Tue, Feb 18, 2020 at 7:52 AM Maurice Waka  wrote:
>
> SO I start importing/changing from web2py to py4web.
>   File 
> "/home/maurice/.local/lib/python3.6/site-packages/pydal/adapters/base.py", 
> line 134, in find_driver
> "No driver of supported ones %s is available" % str(self.drivers)
> RuntimeError: No driver of supported ones ('psycopg2',) is available
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAEVys%2BSe%3DqfgGq4wd6TSaH2Gf2SspvA363XyJtKkAQEqHXh3yA%40mail.gmail.com.


[web2py] py4web google oauth issue

2020-02-18 Thread Eric
When trying to use oauth2 with google I received this error

> Legacy People API has not been used in project X before or it is 
> disabled. Enable it by visiting 
> https://console.developers.google.com/apis/api/legacypeople.googleapis.com/overview?project=X
>  
> then retry. If you enabled this API recently, wait a few minutes for the 
> action to propagate to our systems and retry.
>

That link to goggle just showed an error, and after some searching it seems 
the people api is not available for new oauth2 setups.  

Here are the changes I made for my setup that switches out the people api.
https://github.com/web2py/py4web/pull/120

In addition, there is change for SSO._handle_callback to show errors such 
as what I received above and a way to force https for callback uris.

Eric

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/7e727d8b-773b-49ec-bb46-91feabb3bf3f%40googlegroups.com.


[web2py] py4web psycopg2 error

2020-02-18 Thread Maurice Waka
SO I start importing/changing from web2py to py4web.
On trying to install the index page and try it, I get this error:

Traceback (most recent call last):
  File "/home/maurice/.local/lib/python3.6/site-packages/pydal/base.py", line 
506, in __init__
self._adapter = adapter(**kwargs)
  File 
"/home/maurice/.local/lib/python3.6/site-packages/pydal/adapters/postgres.py", 
line 28, in __call__
return AdapterMeta.__call__(cls, *args, **kwargs)
  File 
"/home/maurice/.local/lib/python3.6/site-packages/pydal/adapters/__init__.py", 
line 41, in __call__
obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
  File 
"/home/maurice/.local/lib/python3.6/site-packages/pydal/adapters/postgres.py", 
line 67, in __init__
after_connection,
  File 
"/home/maurice/.local/lib/python3.6/site-packages/pydal/adapters/base.py", line 
417, in __init__
super(SQLAdapter, self).__init__(*args, **kwargs)
  File 
"/home/maurice/.local/lib/python3.6/site-packages/pydal/adapters/base.py", line 
85, in __init__
self.find_driver()
  File 
"/home/maurice/.local/lib/python3.6/site-packages/pydal/adapters/base.py", line 
134, in find_driver
"No driver of supported ones %s is available" % str(self.drivers)
RuntimeError: No driver of supported ones ('psycopg2',) is available


Files in rivelar

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/1be34521-a19b-4391-8934-c527d3c76a03%40googlegroups.com.


[web2py] py4web translations

2020-02-17 Thread clara
Hi,

I just tried using translations in a template in py4web: [[ =T('some text') 
]]

but it doesn't work. I tried importing T in the template but then I got:

"No module named 'yatl.common'"

Probably I am overlooking something...

Any help will be appreciated! 

Thanks,

Clara

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/598ae9a2-d1a0-404d-abbd-e40bc1dfea69%40googlegroups.com.


[web2py] PY4WEB socketIO

2020-02-17 Thread António Ramos
hello , just asking if py4web will have the ability like flask to have a
socket  as simple as ...
Regards

@socketio.on('my event')def handle_my_custom_event(arg1, arg2, arg3):
print('received args: ' + arg1 + arg2 + arg3)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/CAEM0BxPq1SDn0VNsbLshEmSRij1qde3gy%3D53zMphjw-McU55_w%40mail.gmail.com.


Re: [web2py] Re: web2py/py4web HTML helpers as an independent module

2020-02-16 Thread Massimo Di Pierro
Mind these helpers are a re-implementation of the web2py ones. They are 
very similar but not identical. They are used in py4web.



On Saturday, 15 February 2020 10:05:33 UTC-8, Ramos wrote:
>
> Nice to know!! 
>
> Massimo Di Pierro  escreveu em sáb, 
> 15/02/2020 às 11:29 :
>
>> pip install yatl
>> python
>> >>> from yatl.helpers import A, BUTTON, DIV
>>
>> enjoy. This has been possible for some time.
>>
>> On Friday, 14 February 2020 04:35:41 UTC-8, Ramos wrote:
>>>
>>> Hello, like pydal that is now an independent module , would also be 
>>> interesting to have web2py HTML helpers imported as a independent module 
>>> outside of web2py.
>>> Maybe flask and django developers could use them also...
>>> 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/551a2ad9-438d-4dca-9919-299a858d8649%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/917d63f4-e137-47e2-b476-37ffbf8a8eaa%40googlegroups.com.


Re: [web2py] Re: web2py/py4web HTML helpers as an independent module

2020-02-15 Thread António Ramos
Nice to know!!

Massimo Di Pierro  escreveu em sáb, 15/02/2020
às 11:29 :

> pip install yatl
> python
> >>> from yatl.helpers import A, BUTTON, DIV
>
> enjoy. This has been possible for some time.
>
> On Friday, 14 February 2020 04:35:41 UTC-8, Ramos wrote:
>>
>> Hello, like pydal that is now an independent module , would also be
>> interesting to have web2py HTML helpers imported as a independent module
>> outside of web2py.
>> Maybe flask and django developers could use them also...
>> 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/551a2ad9-438d-4dca-9919-299a858d8649%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/CAEM0BxMV5uWCEr3SfnQA4vjaUGXOBO0HFAK7db46V91ebQYM3Q%40mail.gmail.com.


[web2py] Re: web2py/py4web HTML helpers as an independent module

2020-02-15 Thread Massimo Di Pierro
pip install yatl
python
>>> from yatl.helpers import A, BUTTON, DIV

enjoy. This has been possible for some time.

On Friday, 14 February 2020 04:35:41 UTC-8, Ramos wrote:
>
> Hello, like pydal that is now an independent module , would also be 
> interesting to have web2py HTML helpers imported as a independent module 
> outside of web2py.
> Maybe flask and django developers could use them also...
> 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/551a2ad9-438d-4dca-9919-299a858d8649%40googlegroups.com.


[web2py] py4web: login and redirect to index

2020-02-15 Thread Martin Weissenboeck
Next question:

I have added a new function to controllers.py:

@authenticated()
def index*1*():
user = auth.get_user()
message = T("Hello *1*{first_name}".format(**user))
return dict(message=message, user=user)

A call of 127.0.0.1:8000/myapp/index*1*
requires a login. Ok, that is the expected behavior.
But after the login py4web redirects to *index *and not to *index1*.

What is wrong?
Regards, Martin

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAMcwXCewujrYU%2BHQ6_6wtqhhd4P-ea4nYsmh2gM9XKTnWmRaUQ%40mail.gmail.com.


[web2py] py4web dashboard: username and password

2020-02-15 Thread Martin Weissenboeck
I have created an app "myapp" with the user

   - Username: john
   - Email: john@example.com
   - Password: 123
   - First name: John
   - Last name: Doe


(1) Change username:
Now I want to change the username to "johndoe"
Dashboard headline "App: myapp Database: db Table: auth_user"
I change the username, click on [Save] and [Close]
Seems to be ok.

But 127.0.0.1:8000/myapp again shows the username joe.
And a second click on db.auth_user displays the old values.
Why?

(2) Change password:
How can I change a password using the dashboard?

Regards, Martin

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAMcwXCcZ2Z1NpSiDjp-MKkf2Rgaq7%2BhPzSsfBtt_kaaFktD8TA%40mail.gmail.com.


[web2py] web2py/py4web HTML helpers as an independent module

2020-02-14 Thread António Ramos
Hello, like pydal that is now an independent module , would also be
interesting to have web2py HTML helpers imported as a independent module
outside of web2py.
Maybe flask and django developers could use them also...
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/CAEM0BxP2ViXH90D2PGBbyMpDCcaa_n-B47xTSHBhYkdetw%3DqTw%40mail.gmail.com.


[web2py] py4web Form customization

2020-02-12 Thread Alex Beskopilny
is that possible? 

similar to the web2py

{{=form.custom.begin}}Name: 
{{=form.custom.widget.name}}{{=form.custom.submit}}{{=form.custom.end}}

 form.element('input[name=name]')['_id']='myid'
 form.element('input[name=name]')['_class']='myclass'


Thanks
Alex

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/12c5163a-651d-4761-900a-70e9edc80fb7%40googlegroups.com.


Re: [web2py] Re: web2py / py4web in pypi.org

2020-02-10 Thread Marcelo Huerta
Well, there is an old package in https://pypi.org/project/web2py/,
maybe it should be removed?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/CAB_OKSm5mL%3DLG49CLnsE%2B8PGy5T1%2BGmLp_wVOzeVwKkF8AxvcQ%40mail.gmail.com.


Re: [web2py] py4web nw version and new example

2020-02-09 Thread sandeep patel
Hello Martin,
Three are a couple of ways to try the new version,
You can create a new virtual environment and install the newest version by
pip or if you want to update the version in exiting ENV so you can also
update by using pip command.


Thanks & Regards
Sandeep


On Mon, Feb 10, 2020 at 12:47 PM Martin Weissenboeck 
wrote:

> What is the best way to try this new version?
> Download, unpack and copy over an old one?
> Regards, Martin
>
> Am Mo., 10. Feb. 2020 um 07:13 Uhr schrieb Massimo Di Pierro <
> massimo.dipie...@gmail.com>:
>
>> A new py4web version is out 0.1.20200209.2:
>>
>> - better reload mechanism should avoid come pitfalls and inconsistent
>> state
>> - includes a new example app, a minimalist facebook clone called myfeed
>> (feel free to suggest improvements)
>> - includes a new page "/_dashboard/gitlog/{app_name}" which, for apps
>> that are git projects, allow to check commit history, checkout a commit,
>> and show commits. It is designed more as an educational tool and not as a
>> replacement of normal git commands. Needs documentation.
>>
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.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/bf37cb71-0f66-4b9f-964f-c2efb6acf1e0%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/CAMcwXCfnEHtf%2BRM6do3A7MsHURei10PnYore1H_Fofj4oWHWBw%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%2BvcePXtaCrONWn%3DLRYifW0NcoQetQpLu-tX1aWfWx644hHgzQ%40mail.gmail.com.


Re: [web2py] py4web nw version and new example

2020-02-09 Thread Martin Weissenboeck
What is the best way to try this new version?
Download, unpack and copy over an old one?
Regards, Martin

Am Mo., 10. Feb. 2020 um 07:13 Uhr schrieb Massimo Di Pierro <
massimo.dipie...@gmail.com>:

> A new py4web version is out 0.1.20200209.2:
>
> - better reload mechanism should avoid come pitfalls and inconsistent state
> - includes a new example app, a minimalist facebook clone called myfeed
> (feel free to suggest improvements)
> - includes a new page "/_dashboard/gitlog/{app_name}" which, for apps that
> are git projects, allow to check commit history, checkout a commit, and
> show commits. It is designed more as an educational tool and not as a
> replacement of normal git commands. Needs documentation.
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/bf37cb71-0f66-4b9f-964f-c2efb6acf1e0%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/CAMcwXCfnEHtf%2BRM6do3A7MsHURei10PnYore1H_Fofj4oWHWBw%40mail.gmail.com.


[web2py] py4web nw version and new example

2020-02-09 Thread Massimo Di Pierro
A new py4web version is out 0.1.20200209.2:

- better reload mechanism should avoid come pitfalls and inconsistent state
- includes a new example app, a minimalist facebook clone called myfeed 
(feel free to suggest improvements)
- includes a new page "/_dashboard/gitlog/{app_name}" which, for apps that 
are git projects, allow to check commit history, checkout a commit, and 
show commits. It is designed more as an educational tool and not as a 
replacement of normal git commands. Needs documentation.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/bf37cb71-0f66-4b9f-964f-c2efb6acf1e0%40googlegroups.com.


Re: [web2py] py4web in Google App Engine route app

2020-02-09 Thread Massimo Di Pierro
Your .gitcloudignore appears to be ignoring all of the apps:

apps/filemanager
apps/filemanager/*
apps/todo
apps/todo/*
apps/examples
apps/examples/*
apps/_dashboard
apps/_dashboard/*
apps/_scaffold
apps/_scaffold/*
apps/_minimal
apps/_minimal/*
apps/_default
apps/_default/*
apps/_documentation/*
apps/superheroes
apps/superheroes/*



On Wednesday, 5 February 2020 12:38:56 UTC-8, Jacinto Parga wrote:
>
> No, thanks.
>
> Finally it was a problem with the .gcloudignore
>
> I had to get rid off every app but the one I wanted to deploy and the 
> other unneccesary files to the GAE. The only thing left is that I need to 
> add the name of the application to route the main domain to the proper app.
>
> This is my .gcloudignore
> # This file specifies files that are *not* uploaded to Google Cloud 
> Platform
> # using gcloud. It follows the same syntax as .gitignore, with the 
> addition of
> # "#!include" directives (which insert the entries of the given 
> .gitignore-style
> # file at that point).
> #
> # For more information, run:
> #   $ gcloud topic gcloudignore
> #
> .gcloudignore
> # If you would like to upload your .git directory, .gitignore file or files
> # from your .gitignore file, remove the corresponding line
> # below:
> .git
> .gitignore
>
> #Ojo no se puede quitar requirements.txt
>
> # Python pycache:
> __pycache__/
> # Ignored by the build system
> /setup.cfg
>
> .travis.yml
> *.pyc
> *.pyo
> *~
> #*
> *.1
> *.bak
> *.bak2
> *.svn
> *.w2p
> *.class
> *.rej
> *.orig
> Thumbs.db
> .DS_Store
> ./deposit
> ./benchmark
> ./build
> ./dist
> ./ssl
> ./docs
> ./logs
> ./*.zip
> !apps/*
> apps/filemanager
> apps/filemanager/*
> apps/todo
> apps/todo/*
> apps/examples
> apps/examples/*
> apps/_dashboard
> apps/_dashboard/*
> apps/_scaffold
> apps/_scaffold/*
> apps/_minimal
> apps/_minimal/*
> apps/_default
> apps/_default/*
> apps/_documentation/*
> apps/superheroes
> apps/superheroes/*
> apps/*/databases/README*
> pps/*/databases/*
> apps/*/uploads/*
> apps/*/*.py[oc]
> packages/
> deployment_tools/*
> deployment_tools/
> tests/*
> tests/
> README.md
> test-requirements.txt
> source-context.json
> password.txt
> py4web-start.py
> setup.py
>
>
> And I'm using the default app.yaml may be this is the problem
>
> runtime: python37
>
>
> # Handlers define how to route requests to your application.
> handlers:
>
> - url: .*  # This regex directs all routes to main.bottle
>   script: auto
>
> So I had to write  the name of the application in the navigation bar: 
>
> https://myapplication.appspot.com/*aplicationname*
>
> In other case I get a not found page.
>
> And it goes very very slow, it is only a login page.
>
> Some help?
>
>
>
> El martes, 4 de febrero de 2020, 20:09:59 (UTC+1), Christian Varas 
> escribió:
>>
>> Hi I haven’t tried GAE but maybe is the controller.
>>
>> Are you using the decorator ’action()’ to expose the function ?.
>>
>> Ex:
>> @action('some_name')
>> def some_function():
>>
>>   return locals()
>>
>> Then you acces like http://IP/your_app/some_name
>>
>> Cheers.
>> Chris.
>>
>> El El mar, 4 de feb. de 2020 a la(s) 15:46, Jacinto Parga <
>> jpa...@gmail.com> escribió:
>>
>>> I cannot properly deploy a simple py4web app in GAE. I think it's just a 
>>> .gcloudignore or a app.yaml configuration issue. The only thing I've got is 
>>> a not found page.
>>>
>>> [image: minimal-py4web.png]
>>>
>>> Some help about how to route the right app in the google app engine?
>>>
>>> Thanks
>>>
>>>
>>>
>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "web2py-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to web...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/web2py/a7ba6f1c-2c53-4f30-8197-9c0b51d3229d%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/909062c0-bfd7-4dd2-a0b6-badc8213c404%40googlegroups.com.


[web2py] Re: web2py / py4web in pypi.org

2020-02-09 Thread Massimo Di Pierro
py4web yes. I just deployed a new version. web2py was never really 
distributed using pypi. 

On Tuesday, 4 February 2020 07:14:49 UTC-8, Marcelo Huerta wrote:
>
>
> Are there plans to include the latest versions of the frameworks in 
> pypi.org? I see that pypi.org has a web2py 2.1.1.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/21a13312-4918-435b-a688-caeaa1cd6dac%40googlegroups.com.


Re: [web2py] py4web in Google App Engine route app

2020-02-05 Thread Jacinto Parga
No, thanks.

Finally it was a problem with the .gcloudignore

I had to get rid off every app but the one I wanted to deploy and the other 
unneccesary files to the GAE. The only thing left is that I need to add the 
name of the application to route the main domain to the proper app.

This is my .gcloudignore
# This file specifies files that are *not* uploaded to Google Cloud Platform
# using gcloud. It follows the same syntax as .gitignore, with the addition 
of
# "#!include" directives (which insert the entries of the given 
.gitignore-style
# file at that point).
#
# For more information, run:
#   $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

#Ojo no se puede quitar requirements.txt

# Python pycache:
__pycache__/
# Ignored by the build system
/setup.cfg

.travis.yml
*.pyc
*.pyo
*~
#*
*.1
*.bak
*.bak2
*.svn
*.w2p
*.class
*.rej
*.orig
Thumbs.db
.DS_Store
./deposit
./benchmark
./build
./dist
./ssl
./docs
./logs
./*.zip
!apps/*
apps/filemanager
apps/filemanager/*
apps/todo
apps/todo/*
apps/examples
apps/examples/*
apps/_dashboard
apps/_dashboard/*
apps/_scaffold
apps/_scaffold/*
apps/_minimal
apps/_minimal/*
apps/_default
apps/_default/*
apps/_documentation/*
apps/superheroes
apps/superheroes/*
apps/*/databases/README*
pps/*/databases/*
apps/*/uploads/*
apps/*/*.py[oc]
packages/
deployment_tools/*
deployment_tools/
tests/*
tests/
README.md
test-requirements.txt
source-context.json
password.txt
py4web-start.py
setup.py


And I'm using the default app.yaml may be this is the problem

runtime: python37


# Handlers define how to route requests to your application.
handlers:

- url: .*  # This regex directs all routes to main.bottle
  script: auto

So I had to write  the name of the application in the navigation bar: 

https://myapplication.appspot.com/*aplicationname*

In other case I get a not found page.

And it goes very very slow, it is only a login page.

Some help?



El martes, 4 de febrero de 2020, 20:09:59 (UTC+1), Christian Varas escribió:
>
> Hi I haven’t tried GAE but maybe is the controller.
>
> Are you using the decorator ’action()’ to expose the function ?.
>
> Ex:
> @action('some_name')
> def some_function():
>
>   return locals()
>
> Then you acces like http://IP/your_app/some_name
>
> Cheers.
> Chris.
>
> El El mar, 4 de feb. de 2020 a la(s) 15:46, Jacinto Parga <
> jpa...@gmail.com > escribió:
>
>> I cannot properly deploy a simple py4web app in GAE. I think it's just a 
>> .gcloudignore or a app.yaml configuration issue. The only thing I've got is 
>> a not found page.
>>
>> [image: minimal-py4web.png]
>>
>> Some help about how to route the right app in the google app engine?
>>
>> Thanks
>>
>>
>>
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/a7ba6f1c-2c53-4f30-8197-9c0b51d3229d%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/942c9a41-020a-488b-9783-dcbeb8fdbb86%40googlegroups.com.


Re: [web2py] py4web in Google App Engine route app

2020-02-04 Thread Christian Varas
Hi I haven’t tried GAE but maybe is the controller.

Are you using the decorator ’action()’ to expose the function ?.

Ex:
@action('some_name')
def some_function():

  return locals()

Then you acces like http://IP/your_app/some_name

Cheers.
Chris.

El El mar, 4 de feb. de 2020 a la(s) 15:46, Jacinto Parga 
escribió:

> I cannot properly deploy a simple py4web app in GAE. I think it's just a
> .gcloudignore or a app.yaml configuration issue. The only thing I've got is
> a not found page.
>
> [image: minimal-py4web.png]
>
> Some help about how to route the right app in the google app engine?
>
> Thanks
>
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/a7ba6f1c-2c53-4f30-8197-9c0b51d3229d%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%2BuJtjDF5iq78NtUcd%3DLT_ax3pL50aX69CYbYmMtYoj4cHzg%40mail.gmail.com.


[web2py] py4web in Google App Engine route app

2020-02-04 Thread Jacinto Parga
I cannot properly deploy a simple py4web app in GAE. I think it's just a 
.gcloudignore or a app.yaml configuration issue. The only thing I've got is 
a not found page.

[image: minimal-py4web.png]

Some help about how to route the right app in the google app engine?

Thanks



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a7ba6f1c-2c53-4f30-8197-9c0b51d3229d%40googlegroups.com.


[web2py] web2py / py4web in pypi.org

2020-02-04 Thread Marcelo Huerta

Are there plans to include the latest versions of the frameworks in 
pypi.org? I see that pypi.org has a web2py 2.1.1.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b317a5b5-30b1-46ff-9d91-35e803f6ae73%40googlegroups.com.


[web2py] py4web - delete an app?

2020-02-03 Thread Martin Weissenboeck
Ok, I have learned how to create an app.
But I did not find any button to remove an app.
I can delete the directory of the app, but should not be there a button on
the dashboard for that?
Or is it well hidden?

Regards, Martin

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAMcwXCeyTvV0XjHVJWGLRQuo%2BfsQfmN45jy_1RBLrdz4Nyx5yQ%40mail.gmail.com.


Re: [web2py] py4web questions

2020-01-21 Thread Massimo Di Pierro
See my answer 

https://groups.google.com/d/msg/web2py/cgg6M7B_wkI/lWd-Ytt3DQAJ

On Monday, 20 January 2020 22:55:28 UTC-8, Bruno Sarverry wrote:
>
> Hello John! did you solve it? I have the same problem.
>
> El jueves, 26 de septiembre de 2019, 6:05:52 (UTC-3), John Bannister 
> escribió:
>>
>> Hi  Massimo, 
>>
>> Have one more question which may or may not be related. 
>>
>> I have multiple controllers all including the same layout.html. In the 
>> layout.html the navbar should display the user logged in (or not). I see in 
>> the _scaffold app the login menu is created using globals().get('user') 
>> which works fine if we are returning the user=auth.get_user() to the 
>> template.
>>
>> Question is do I need to return user=auth.get_user() from each action or 
>> is there some way of accessing the user/login information from the 
>> templates and in particular layout.html? 
>>
>> And one more which is how to deal with images in py4web? I have tried to 
>> upload an image using field of type upload using standard Form. When I look 
>> at the record again or try to edit it says no image selected. Guess there 
>> is the equivalent of download missing somewhere. Any help appreciated.
>>
>> John 
>> -Original Message- 
>> From: web...@googlegroups.com [mailto:web...@googlegroups.com] On Behalf 
>> Of Massimo Di Pierro 
>> Sent: 26 September 2019 09:02 
>> To: web2py-users 
>> Subject: [web2py] py4web questions 
>>
>> Good question. I will try post a tutorial in the next few days. But the 
>> idea is you associate tags to a user and then give permissions based on the 
>> tags. The tag API is very simple so I recommend you meanwhile look at the 
>> source. 
>>
>> -- 
>> Resources: 
>> - http://web2py.com 
>> - http://web2py.com/book (Documentation) 
>> - http://github.com/web2py/web2py (Source code) 
>> - https://code.google.com/p/web2py/issues/list (Report Issues) 
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group. 
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web...@googlegroups.com. 
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/web2py/b6009627-7b67-405f-a98e-1dbcb5dbb1e2%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/b594d875-42fd-48c1-bd38-6c42e316ed14%40googlegroups.com.


Re: [web2py] py4web - using session object in a template

2020-01-21 Thread Massimo Di Pierro
Lazy is good. You can turn it to your advantage with this:

import functools
def my_awesome_decorator(path=None, method=['GET','POST'], 
requires_login=False):
def wrapper(func, path=path, method=method, 
requires_login=requires_login):
path = path or func.__name__
template = func.__name__+'.html'
fixtures = [template, db, session, auth]
if requires_login: fixtures.append(auth.user)
@action(path, method=method)
@action.uses(*fixtures)
@functools.wraps(func)
def tmp(*a, **b):
d = func(*a, **b)
if isinstance(d, dict):
 d['session'] = dict(session.local.data)
 if requires_login: d['user'] = auth.get_user()
return d
return tmp
return wrapper

@my_awesome_decorator('test')
def index():
return {}



On Tuesday, 21 January 2020 05:39:51 UTC-8, Jim S wrote:
>
> Thanks Massimo.  I was hoping to avoid having to pass something to the 
> view every time.  I'm lazy, right?  I'm assuming that this is the same if I 
> used response instead of session.  In web2py you didn't have to pass 
> response to the view, it was automatically available.
>
> -Jim
>
> On Tue, Jan 21, 2020 at 1:00 AM Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> I would recommend you do something like this
>>
>> @action('index')
>> @action.uses('index.html', session)
>> def index():
>> ...
>> return dict(session=dict(session))
>>
>> This will pass a shallow copy of the session to the view. You will be 
>> free to read from the session in index.html but you should not write it.
>>
>>
>>
>> On Friday, 17 January 2020 12:34:43 UTC-8, Jim S wrote:
>>>
>>> I should re-state my problem.  With web2py I wasn't using session, but 
>>> response.  I added a couple of attributes that always got added to the 
>>> response object.  Not sure how to mimic that in py4web, or would I even 
>>> want to?
>>>
>>> -Jim
>>>
>>> On Fri, Jan 17, 2020 at 11:16 AM Jim S  wrote:
>>>
 Hi

 I'm trying to pass a session variable to layout.html but it tells me 
 that session is not available:

 NameError: name 'session' is not defined

 I use this technique in web2py to send a page title to layout.html 
 without having to pass it in the returned dict from the controller.

 Obviously I'm being lazy using this technique.  Will this work with 
 py4web or is it best for me to pass in explicitly in each controller?

 -Jim

 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.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/cgg6M7B_wkI/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/8848279b-e889-4b9b-90a6-664813a47b89%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/cgg6M7B_wkI/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/06f7bcfe-4a9f-42a0-a5ec-a686edf6513e%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/db45f1c5-81de-44ce-b75e-fea9116920b9%40googlegroups.com.


Re: [web2py] py4web - using session object in a template

2020-01-21 Thread Massimo Di Pierro
Lazy is good. You can turn it to your advantage with this:

import functools
def my_awesome_validator(path=None, method=['GET','POST'], 
requires_login=False):
def wrapper(func, path=path, method=method):
path = path or func.__name__
template = func.__name__+'.html'
fixtures = [template, db, session, auth]
if requires_login: fixtures.append(auth.user)
@action(path, method=method)
@action.uses(*fixtures)
@functools.wraps(func)
def tmp(*a, **b):
d = func(*a, **b)
if isinstance(d, dict): d['session'] = dict(session.local.data)
return d
return tmp
return wrapper

@my_awesome_validator('test')
def index():
return locals()



On Tuesday, 21 January 2020 05:39:51 UTC-8, Jim S wrote:
>
> Thanks Massimo.  I was hoping to avoid having to pass something to the 
> view every time.  I'm lazy, right?  I'm assuming that this is the same if I 
> used response instead of session.  In web2py you didn't have to pass 
> response to the view, it was automatically available.
>
> -Jim
>
> On Tue, Jan 21, 2020 at 1:00 AM Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> I would recommend you do something like this
>>
>> @action('index')
>> @action.uses('index.html', session)
>> def index():
>> ...
>> return dict(session=dict(session))
>>
>> This will pass a shallow copy of the session to the view. You will be 
>> free to read from the session in index.html but you should not write it.
>>
>>
>>
>> On Friday, 17 January 2020 12:34:43 UTC-8, Jim S wrote:
>>>
>>> I should re-state my problem.  With web2py I wasn't using session, but 
>>> response.  I added a couple of attributes that always got added to the 
>>> response object.  Not sure how to mimic that in py4web, or would I even 
>>> want to?
>>>
>>> -Jim
>>>
>>> On Fri, Jan 17, 2020 at 11:16 AM Jim S  wrote:
>>>
 Hi

 I'm trying to pass a session variable to layout.html but it tells me 
 that session is not available:

 NameError: name 'session' is not defined

 I use this technique in web2py to send a page title to layout.html 
 without having to pass it in the returned dict from the controller.

 Obviously I'm being lazy using this technique.  Will this work with 
 py4web or is it best for me to pass in explicitly in each controller?

 -Jim

 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.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/cgg6M7B_wkI/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/8848279b-e889-4b9b-90a6-664813a47b89%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/cgg6M7B_wkI/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/06f7bcfe-4a9f-42a0-a5ec-a686edf6513e%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/0a522553-0a4c-4404-94c7-bf264f026f34%40googlegroups.com.


[web2py] py4web - form field default - appears to not be working for me

2020-01-21 Thread Jim S
Sorry for all the py4web noob questions

I have the following:

search_text = 'test'
form = Form([Field('search',
   length=50,
   default=search_text)],
form_name='search_form',
formstyle=FormStyleBulma,
keep_values=True)

I can't get the default search_text to appear in the field.  

Anything obvious I'm missing?

-Jim

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/38721f9b-bf73-47be-bb3d-0d6396cc2281%40googlegroups.com.


[web2py] py4web - name of form - add classes to form

2020-01-21 Thread Jim S
I'm using Form from:

from py4web.utils.form import Form

I want to add some classes to the  tag that is generated.  In web2py 
I can add _class='field is-horizontal' when creating the instance and the 
classes will be passed along.

Optionally I could add some css/javascript that could modify the classes.  
However, then I need to be able to reference the form.  I assumed I could 
do that with the form_name argument, but that doesn't add a name or id to 
the form element.  It is used on some of the children, but not on the form 
itself.

How can I add classes to the form and to the elements inside the form?

-Jim

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/fe01bcb5-4b4d-40a7-9974-6aa0a95dae48%40googlegroups.com.


[web2py] py4web - method not allowed

2020-01-21 Thread Val K
Try method=... instead of methodS

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/0cf7cd8e-645b-4473-bd81-fb1d2d3263a9%40googlegroups.com.


[web2py] py4web - method not allowed

2020-01-21 Thread Jim S
I'm getting the following when I click on the submit button on my form:

Error: 405 Method Not Allowed

Sorry, the requested URL 
'http://127.0.0.1:8000/py4web_test/administration/links' caused an error:

Method not allowed.

My controller code:

@action('administration/links', methods=['GET', 'POST'])
@action.uses('grid.html', session, db, auth.user)
def links():
url_path = 'administration/links'
page['sub_title'] = A('LINKS', _href=URL(url_path))

form = Form([Field('search', length=50)], formstyle=FormStyleBulma)

query = db.link.id > 0
fields = [db.link.id, db.link.name, db.link.table_name, db.link.
permission_name, db.link.method]

grid = Grid(url_path, query, fields=fields,
search_form=form,
create_url=URL('administration/link/0'),
edit_url=URL('administration/link'),
delete_url=URL('administration/link/delete'))

return dict(page=page, grid=grid, form=form)

I'm guessing there is something obvious I'm missing.  Can anyone see it?  
Any help would be appreciated.

-Jim


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/49338241-2ca3-4068-9b2a-dde4d95a0bfe%40googlegroups.com.


Re: [web2py] py4web - using session object in a template

2020-01-21 Thread Jim Steil
Thanks Massimo.  I was hoping to avoid having to pass something to the view
every time.  I'm lazy, right?  I'm assuming that this is the same if I used
response instead of session.  In web2py you didn't have to pass response to
the view, it was automatically available.

-Jim

On Tue, Jan 21, 2020 at 1:00 AM Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> I would recommend you do something like this
>
> @action('index')
> @action.uses('index.html', session)
> def index():
> ...
> return dict(session=dict(session))
>
> This will pass a shallow copy of the session to the view. You will be free
> to read from the session in index.html but you should not write it.
>
>
>
> On Friday, 17 January 2020 12:34:43 UTC-8, Jim S wrote:
>>
>> I should re-state my problem.  With web2py I wasn't using session, but
>> response.  I added a couple of attributes that always got added to the
>> response object.  Not sure how to mimic that in py4web, or would I even
>> want to?
>>
>> -Jim
>>
>> On Fri, Jan 17, 2020 at 11:16 AM Jim S  wrote:
>>
>>> Hi
>>>
>>> I'm trying to pass a session variable to layout.html but it tells me
>>> that session is not available:
>>>
>>> NameError: name 'session' is not defined
>>>
>>> I use this technique in web2py to send a page title to layout.html
>>> without having to pass it in the returned dict from the controller.
>>>
>>> Obviously I'm being lazy using this technique.  Will this work with
>>> py4web or is it best for me to pass in explicitly in each controller?
>>>
>>> -Jim
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.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/cgg6M7B_wkI/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/8848279b-e889-4b9b-90a6-664813a47b89%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/cgg6M7B_wkI/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/06f7bcfe-4a9f-42a0-a5ec-a686edf6513e%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/CAERBpoBR4dAaBXrTPqPVM5936OTSs%3DUpKTr03DJF7W2KuJWdSQ%40mail.gmail.com.


Re: [web2py] py4web - using session object in a template

2020-01-20 Thread Massimo Di Pierro
I would recommend you do something like this

@action('index')
@action.uses('index.html', session)
def index():
...
return dict(session=dict(session))

This will pass a shallow copy of the session to the view. You will be free 
to read from the session in index.html but you should not write it.



On Friday, 17 January 2020 12:34:43 UTC-8, Jim S wrote:
>
> I should re-state my problem.  With web2py I wasn't using session, but 
> response.  I added a couple of attributes that always got added to the 
> response object.  Not sure how to mimic that in py4web, or would I even 
> want to?
>
> -Jim
>
> On Fri, Jan 17, 2020 at 11:16 AM Jim S  wrote:
>
>> Hi
>>
>> I'm trying to pass a session variable to layout.html but it tells me that 
>> session is not available:
>>
>> NameError: name 'session' is not defined
>>
>> I use this technique in web2py to send a page title to layout.html 
>> without having to pass it in the returned dict from the controller.
>>
>> Obviously I'm being lazy using this technique.  Will this work with 
>> py4web or is it best for me to pass in explicitly in each controller?
>>
>> -Jim
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.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/cgg6M7B_wkI/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/8848279b-e889-4b9b-90a6-664813a47b89%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/06f7bcfe-4a9f-42a0-a5ec-a686edf6513e%40googlegroups.com.


Re: [web2py] py4web questions

2020-01-20 Thread Bruno Sarverry
Hello John! did you solve it? I have the same problem.

El jueves, 26 de septiembre de 2019, 6:05:52 (UTC-3), John Bannister 
escribió:
>
> Hi  Massimo, 
>
> Have one more question which may or may not be related. 
>
> I have multiple controllers all including the same layout.html. In the 
> layout.html the navbar should display the user logged in (or not). I see in 
> the _scaffold app the login menu is created using globals().get('user') 
> which works fine if we are returning the user=auth.get_user() to the 
> template.
>
> Question is do I need to return user=auth.get_user() from each action or 
> is there some way of accessing the user/login information from the 
> templates and in particular layout.html? 
>
> And one more which is how to deal with images in py4web? I have tried to 
> upload an image using field of type upload using standard Form. When I look 
> at the record again or try to edit it says no image selected. Guess there 
> is the equivalent of download missing somewhere. Any help appreciated.
>
> John 
> -Original Message- 
> From: web...@googlegroups.com  [mailto:
> web...@googlegroups.com ] On Behalf Of Massimo Di Pierro 
> Sent: 26 September 2019 09:02 
> To: web2py-users 
> Subject: [web2py] py4web questions 
>
> Good question. I will try post a tutorial in the next few days. But the 
> idea is you associate tags to a user and then give permissions based on the 
> tags. The tag API is very simple so I recommend you meanwhile look at the 
> source. 
>
> -- 
> Resources: 
> - http://web2py.com 
> - http://web2py.com/book (Documentation) 
> - http://github.com/web2py/web2py (Source code) 
> - https://code.google.com/p/web2py/issues/list (Report Issues) 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group. 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web...@googlegroups.com . 
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/web2py/b6009627-7b67-405f-a98e-1dbcb5dbb1e2%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/3dcd57f6-5e68-4af3-b207-6a0e95f235a1%40googlegroups.com.


Re: [web2py] py4web - auto-reload

2020-01-20 Thread Jim Steil
Thank you very much.  I will look into this.

What I was hoping for was an auto-reload the way Flask does it.  If you're
in a dev environment it auto-reloads for you, no extra work on my part.

But, I'll check this out, it should save me quite a few extra keystrokes

-Jim

On Mon, Jan 20, 2020 at 10:02 AM António Ramos  wrote:

> in 2014 i did this "live reload thing" with web2py
> https://www.youtube.com/watch?v=zt5gnKk40Zw
>
> Em seg., 20 de jan. de 2020 às 15:57, António Ramos 
> escreveu:
>
>> I bet it can be done with  https://gruntjs.com/   or  https://gulpjs.com/   
>> or
>> the new kid  https://parceljs.org/
>>
>>
>>
>> Em dom., 19 de jan. de 2020 às 17:40, Jim S 
>> escreveu:
>>
>>> Is there a way to get py4web to auto-reload when the source for an app
>>> has changed?
>>>
>>> -Jim
>>>
>>> --
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.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/fd7d32e7-d82d-4bb5-ad63-7ad4d3f0b4c0%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/L9WQj5MaM-c/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/CAEM0BxOuXJZ4btQFYQmN%3D1F3dZcqOOLKnCmJVPdirqdMW6dV-Q%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/CAERBpoBV9D1%2BCp9Ut3twJ-CC2S6F3xxN17ZU%2BUW_kbrn4rmXbQ%40mail.gmail.com.


Re: [web2py] py4web - auto-reload

2020-01-20 Thread António Ramos
in 2014 i did this "live reload thing" with web2py
https://www.youtube.com/watch?v=zt5gnKk40Zw

Em seg., 20 de jan. de 2020 às 15:57, António Ramos 
escreveu:

> I bet it can be done with  https://gruntjs.com/   or  https://gulpjs.com/   or
> the new kid  https://parceljs.org/
>
>
>
> Em dom., 19 de jan. de 2020 às 17:40, Jim S 
> escreveu:
>
>> Is there a way to get py4web to auto-reload when the source for an app
>> has changed?
>>
>> -Jim
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.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/fd7d32e7-d82d-4bb5-ad63-7ad4d3f0b4c0%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/CAEM0BxOuXJZ4btQFYQmN%3D1F3dZcqOOLKnCmJVPdirqdMW6dV-Q%40mail.gmail.com.


Re: [web2py] py4web - auto-reload

2020-01-20 Thread António Ramos
I bet it can be done with  https://gruntjs.com/   or  https://gulpjs.com/   or
the new kid  https://parceljs.org/



Em dom., 19 de jan. de 2020 às 17:40, Jim S  escreveu:

> Is there a way to get py4web to auto-reload when the source for an app has
> changed?
>
> -Jim
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/fd7d32e7-d82d-4bb5-ad63-7ad4d3f0b4c0%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/CAEM0BxMnXjVccNzURAwfd90f7j0QyduC72b4KH7eDqXcJG-fgw%40mail.gmail.com.


[web2py] Py4web: ¿Practical example step by step?

2020-01-20 Thread Yuver Parra

Good morning and thanks in advance for sharing your knowledge in this group.
Do any of you have a practical example where you can follow step by step 
learning from the installation of py4web to the setting up of a site?

Thanks for the reply.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/1b79e789-4dd0-4e42-8274-1e934edba087%40googlegroups.com.


[web2py] py4web routing and parameter passing

2020-01-19 Thread Jim S
Given this excerpt from the py4web documentation:

The request object

>From py4web you can import request

from py4web import request

@action('paint')
def paint():
if 'color' in request.query
   return 'Painting in %s' % request.query.get('color')
return 'You did not specify a color'

This action can be accessed at:

http://localhost:8000/myapp/paint?color=red

Notice that the request object is the a Bottle request object


My controller signature looks like this:

@action('administration/links', method=['GET', 'POST'])
@action.uses('list.html', session, db, auth.user)
def links():
current_page_number = request.query.get('page') if 'page' in request.query 
else 1

But, when I try to access:

http://127.0.0.1:8000/py4web_test/link?page=2

I get a 404 error. - WARNING:tornado.access:404 GET 
/py4web_test/link?page=2 (127.0.0.1) 1.79ms

I'm not sure what I'm doing wrong.  Is there a way to tell it that you have 
an optional parameter that may or may not be passed in?

-Jim




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/26966e99-0c9e-4599-95c3-a5556b8027f3%40googlegroups.com.


[web2py] py4web - auto-reload

2020-01-19 Thread Jim S
Is there a way to get py4web to auto-reload when the source for an app has 
changed?

-Jim

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/fd7d32e7-d82d-4bb5-ad63-7ad4d3f0b4c0%40googlegroups.com.


[web2py] py4web - javascript references in html files

2020-01-19 Thread Jim S
I'm wondering why in py4web you're not using the URL function to specify 
the location of .js files.  This can be seen in layout.html and auth.html.  
I also see that at the top of layout.html that you define:



I recall this being the best way to define them in web2py.

Comments?

-Jim

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/dfccaf2e-c7ae-42e1-843e-e366d17e00f9%40googlegroups.com.


[web2py] py4web roadmap

2020-01-17 Thread Jim S
I'm wondering if there is a roadmap or list of features that you intend to 
add to py4web.

I'm wondering if we're going to see something similar to SQLFORM.grid.  I'm 
primarily looking for something that would build a filterable 'list' table 
of records in a table, along with pagination support.


-Jim

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/13ab062a-fe7f-4283-a94a-6cbf02097316%40googlegroups.com.


Re: [web2py] py4web - using session object in a template

2020-01-17 Thread Jim Steil
I should re-state my problem.  With web2py I wasn't using session, but
response.  I added a couple of attributes that always got added to the
response object.  Not sure how to mimic that in py4web, or would I even
want to?

-Jim

On Fri, Jan 17, 2020 at 11:16 AM Jim S  wrote:

> Hi
>
> I'm trying to pass a session variable to layout.html but it tells me that
> session is not available:
>
> NameError: name 'session' is not defined
>
> I use this technique in web2py to send a page title to layout.html without
> having to pass it in the returned dict from the controller.
>
> Obviously I'm being lazy using this technique.  Will this work with py4web
> or is it best for me to pass in explicitly in each controller?
>
> -Jim
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/cgg6M7B_wkI/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/8848279b-e889-4b9b-90a6-664813a47b89%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/CAERBpoBQPW5KvAs00YWV2LNDgFDWchQs5XH4%3DPkgYTp4VskoMQ%40mail.gmail.com.


[web2py] py4web - using session object in a template

2020-01-17 Thread Jim S
Hi

I'm trying to pass a session variable to layout.html but it tells me that 
session is not available:

NameError: name 'session' is not defined

I use this technique in web2py to send a page title to layout.html without 
having to pass it in the returned dict from the controller.

Obviously I'm being lazy using this technique.  Will this work with py4web 
or is it best for me to pass in explicitly in each controller?

-Jim

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/8848279b-e889-4b9b-90a6-664813a47b89%40googlegroups.com.


[web2py] Py4web Auth Equivalent

2019-12-27 Thread John Bannister
Hi All,
I have played with py4web for a while now and one thing I cannot get my 
head around is how to set up the equivalent web2py auth groups, memberships 
in py4web?

Are there any examples or documentation on how to use tags to set up the 
equivalent?

Thanks in advance
John 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/1acef142-5b23-4023-947d-e9b3b263c293%40googlegroups.com.


[web2py] py4web and celery

2019-12-26 Thread Massimo Di Pierro
I posted an example of possible use of celery with py4web (in _scaffold) 
but I am not too happy about it.

db._adapter.reconnect() should be automatic and 'apps._scaffold.tasks' 
feels clunky.

Anyway, the example shows how you can define tasks and they can import 
anything they need from the app.
Works well for me but help me test it some more.

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/d14e7c19-1311-40e3-80b4-b5db4b39daa3%40googlegroups.com.


[web2py] py4web won't create apps

2019-12-25 Thread Scott Hunter
I installed py4web via pip on a MacBook Pro running Catalina; it runs fine, 
and I can create new apps (by "hand"), but the dashboard & default apps 
don't get created, even if I run it with the -c flag.

I'd be happy to dig into *why*, since this does not seem to be a common 
problem, but would like some direction as to where to look.

- Scott

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/f64adcc3-2b56-4bcb-a5a6-b7b850bbe09a%40googlegroups.com.


[web2py] py4web sample errors

2019-12-24 Thread JSalvat
Very simple Form and Grid sample to show some errors:

In Grid: decimal field  does not show /  allow input.

In Form: date and time widgets not working

Mainly copied from examples, Showing what was modified:

models.py

import os
from py4web import DAL, Field
from pydal.validators import *
# define database and tables
db = DAL('sqlite://storage.db', 
folder=os.path.join(os.path.dirname(__file__), 'databases'))

# simple table example
db.define_table(
'sam_table',
Field('samString', 'string', length=10,  unique=True, required=True,
  requires = [IS_LENGTH(10, 4), IS_SLUG(maxlen=10,
  check=True, error_message='Only alphanumeric characters and 
non-repeated dashes.')],
  comment='Unique identifier.'),
Field('samText', 'text', comment='Enter a description text.'),
Field('samBool', 'boolean', comment='Are you interested in py4web ?'),
Field('samDate', 'date', required=True,
  requires = [IS_NOT_EMPTY(), IS_DATE()],
  comment='Enter a valid sample date.'),
Field('samTime', 'time',
  requires = IS_TIME(), comment='Enter a valid sample time.'),
Field('samInteger', 'integer', default=0,
  requires = IS_INT_IN_RANGE(0, , error_message='Must be 
integer between 0 and .'),
  comment='Enter a valid sample integer.'),
Field('samDecimal', 'decimal(4,2)', default=0.0,
  requires = IS_DECIMAL_IN_RANGE(0, 35.0, dot='.'),
  comment='Enter a decimal between 0 and 35.'),
)

if not db(db.sam_table).count():
db.sam_table.insert(
samString='2011',
samText='This record was inserted when first time create-table.',
samBool=True,
samDate='2011-12-24',
samTime='11:45:00',
samInteger=1234,
samDecimal=21.50)
db.commit()

__init__.py

import os
from py4web import *
from py4web.utils.form import Form, FormStyleBulma
from py4web.utils.publisher import Publisher, ALLOW_ALL_POLICY
from pydal.validators import *
from . models import db

session = Session(secret='mysecret')

T = Translator(os.path.join(os.path.dirname(__file__), 'translations'))

publisher = Publisher(db, policy=ALLOW_ALL_POLICY)

@action('index')
@action.uses('index.html')
def index():
return {}

# exposed as /sample/create_form or /sample/update_form/
@action('create_form', method=['GET','POST'])
@action('update_form/', method=['GET','POST'])
@action.uses('form.html', db, session)
def sample_form(id=None):
form = Form(db.sam_table, id, deletable=False, formstyle=FormStyleBulma)
rows = db(db.sam_table).select()
return dict(form=form, rows=rows)

# exposed as /sample/grid
@action('grid')
@action.uses('grid.html')
def sample_grid():
return dict(grid=publisher.grid(db.sam_table))

form.html

[[extend 'layout.html']]

Sample Form

[[=form]]

Rows


  [[for row in rows:]]
  [[=row.id]]: [[=row.samString]] ( [[=row.samBool]] )
  [[pass]]



Have not tested translations yet.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/2970f12a-8c03-4936-b66e-f802cc70dc5e%40googlegroups.com.


[web2py] py4web - cannot get logged in

2019-12-19 Thread Jim S
python3 -m pip install --upgrade py4web
py4web-start apps

Entered my password

Went to http://127.0.0.1:8000/_dashboard

I am asked for a password - no matter what I do, I can't get past this page.

At first I was getting this error:

ERROR:root:Traceback (most recent call last):
  File "/home/jim/.local/lib/python3.7/site-packages/py4web/core.py", line 
473, in wrapper
ret = func(*func_args, **func_kwargs)
  File "/home/jim/.local/lib/python3.7/site-packages/py4web/core.py", line 
439, in wrapper
ret = func(*args, **kwargs)
  File "apps/_dashboard/__init__.py", line 56, in login
valid = password and CRYPT()(password)[0] == os.environ[
'PY4WEB_PASSWORD']
  File "/usr/lib/python3.7/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'PY4WEB_PASSWORD'

I created the environment variable and stored my plain text password 
there.  Now this error is gone, but still not working.

I can see that password.txt was created in the directory from which I 
initiated the py4web-start command.

I restart py4web and the password still doesn't work.

I deleted password.txt and restarted - was asked for the password and I 
entered it.

Still no luck.  

I've had py4web running successfully in the past.  Just now sure what has 
happened now that is preventing me from logging in.

-Jim


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/0ccea3e0-1730-48ea-b9c8-efacf260ec7d%40googlegroups.com.


[web2py] py4web and webkit

2019-12-14 Thread leone

Unable to use _dashboard using webkit by python gi.repository.

** Message: 08:21:43.542: console message: 
http://localhost:8000/_dashboard/static/js/index.js @5: SyntaxError: 
Unexpected token '>'

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/0186bdac-b321-46fe-a138-986252c21511%40googlegroups.com.


[web2py] py4web and Eclipse/PyDev

2019-11-13 Thread David Zejda
Hi to all,

to start experimenting with py4web in Eclipse/PyDev on Debian Linux I did 
the following. 
Maybe someone will find it useful. 

Debugging is not working yet for me, an advice would be welcome.

1) Set-up the virtual environment for web4py with libraries managed by pip 
(to avoid mixing with system-wide python libraries installed by the Debian 
packaging system):

sudo apt-get install virtualenvwrapper
pip3 install --user --upgrade virtualenvwrapper
mkvirtualenv -p /usr/bin/python3 /opt/python3env/py4web
cd /opt/python3env/py4web/bin

2) Install py4web by pip.

./pip3 install py4web
./python3 -c "from pydal.validators import CRYPT; 
open('/opt/py4web/password.txt','w').write(str(CRYPT()(input('password:'))[0]))"

Test if it is working:

./py4web-start /opt/py4web -p /opt/py4web/password.txt

3) Create a new PyDev project for the whole py4web apps directory:

Start Eclipse, create a new PyDev project with the source directory /opt/py4web 


Define the interpreter /opt/python3env/py4web/bin/python3 for the project; 
in its definition at first add the system libraries:

/opt/python3env/py4web/lib/python3.7 
/opt/python3env/py4web/lib/python3.7/lib-dynload 
/opt/python3env/py4web/lib/python3.7/site-packages

As a result, PyDev complained: "It seems that the Python /Lib folder (which 
contains the standard library) was not found /selected during the instal 
process. This folder (which contains files such as threading.py and 
traceback.py) is required for PyDev to function properly ...". To solve it, 
at first I tried symlinking the mentioned files:

ln -s /usr/lib/python3.7/threading.py 
/opt/python3env/py4web/lib/threading.py
ln -s /usr/lib/python3.7/traceback.py 
/opt/python3env/py4web/lib/traceback.py

The complaint has disappeared and I have not noticed any other apparent 
problems. However, to be sure that everything needed is available, later I 
added the whole /usr/lib/python3.7 in libraries instead of the symlinked 
files.
Because only system libraries are imported and not site-packages, hopefully 
this second solution won't break the virtualenv separation from the system 
environment.

4) Enable launching py4web from Eclipse:

Copy web4py starting script to the apps directory:

cp /opt/python3env/py4web/bin/py4web-start /opt/py4web/py4web-start.py

Define new run configuration for py4web-start.py with the arguments 
"/opt/py4web 
-p /opt/py4web/password.txt".

Now I can start py4web from Eclipse and read its output in the Eclipse 
console.

5) PyDev Debugging:

However, for now, I got stuck in making the PyDev debugger working. It 
complains:

pydev debugger: starting (pid: 27370)
Traceback (most recent call last):
  File "", line 983, in _find_and_load
  File "", line 967, in _find_and_load_unlocked
  File "", line 677, in _load_unlocked
  File "", line 728, in exec_module
  File "", line 219, in 
_call_with_frames_removed
  File 
"/opt/python3env/py4web/lib/python3.7/site-packages/py4web/__init__.py", 
line 1, in 
from . core import (
  File "", line 983, in _find_and_load
  File "", line 152, in __exit__
  File "", line 107, in release
RuntimeError: cannot release un-acquired lock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 983, in _find_and_load
  File "", line 953, in _find_and_load_unlocked
  File "", line 219, in 
_call_with_frames_removed
  File "", line 983, in _find_and_load
  File "", line 152, in __exit__
  File "", line 107, in release
RuntimeError: cannot release un-acquired lock

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/home/zejdad/.p2/pool/plugins/org.python.pydev.core_7.4.0.201910251334/pysrc/pydevd.py",
 
line 3090, in 
main()
  File 
"/home/zejdad/.p2/pool/plugins/org.python.pydev.core_7.4.0.201910251334/pysrc/pydevd.py",
 
line 3083, in main
globals = debugger.run(setup['file'], None, None, is_module)
  File 
"/home/zejdad/.p2/pool/plugins/org.python.pydev.core_7.4.0.201910251334/pysrc/pydevd.py",
 
line 2154, in run
return self._exec(is_module, entry_point_fn, module_name, file, 
globals, locals)
  File 
"/home/zejdad/.p2/pool/plugins/org.python.pydev.core_7.4.0.201910251334/pysrc/pydevd.py",
 
line 2161, in _exec
pydev_imports.execfile(file, globals, locals)  # execute the script
  File 
"/home/zejdad/.p2/pool/plugins/org.python.pydev.core_7.4.0.201910251334/pysrc/_pydev_imps/_pydev_execfile.py",
 
line 25, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/opt/py4web/py4web-start.py", line 3, in 
from py4web.core import main
  File "", line 983, in _find_and_load
  File "", line 152, in __exit__
  File "", line 107, in release
RuntimeError: cannot release un-acquired lock

With 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 

[web2py] py4web - will it inherit web2py structures ?

2019-10-13 Thread 'graham' via web2py-users
I used web2py some years ago and produced a program generator 
(http://www.web2pyslices.com/slice/show/2060/generator-for-web2py) which met 
with universal disinterest...

However someone has asked whether it could work with py4web and so I have had a 
quick look at it. There are minor Python 3 issues which are easily fixed but 
when I start to look at the web2py interface I immediately come across a 
problem: the code makes us of the 'current' structure, in particular it uses 
current.request to obtain the POST data and there appears to be no such 
structure  in py4web.

I have checked the py4web documentation and it does say in the PyDAL chapter, 
under ;'Model-less applications' "...and provide necessary access to global 
scope via the current object (as described in Chapter 4)." but Chapter 4 does 
not contain any details. Perhaps this contains a lot of text from the web2py 
docs and will have corrections and more py4web content included later.

Obviously this is not of any real relevance to py4web itself but I just 
wondered whether it is intended that 'current' or an equivalent is or will be 
available in py4web or is there any simple (because I don't want to take up too 
much of your time) work around.

Thanks

graham

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/1164053993.550846.1570971137263%40mail.yahoo.com.


[web2py] py4web

2019-10-10 Thread Kevin Fonseca
hi, i would like to now what will happen with web2py when py4web is 
implemented?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/4312c5ab-2fab-4e51-9914-352bf8d400ca%40googlegroups.com.


[web2py] Py4web - DB legacy db

2019-10-02 Thread Ari Lion BR Sp
Hi Massimo,

Great evolution this new framework.
Wanted to load legacy DataBase - and Dont Know how to load an old table as  
we use to do in web2py.

I have tryed to put migrate=True , fake_migrate=True 
But no success.



Thank you so much
Best regards
Ari - Brazil



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/3f87f694-ae12-4624-b320-b184d6ab215e%40googlegroups.com.


[web2py] py4web T examples

2019-10-01 Thread Massimo Di Pierro
Posted a couple of pluralization and internationalization examples:
https://github.com/web2py/py4web/blob/master/apps/examples/__init__.py#L45

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/d037d57e-62ad-49d8-8a1f-916673c9b625%40googlegroups.com.


[web2py] Py4Web

2019-10-01 Thread greenpoise
Wow, I am impressed so far. I like it better than web2py. It gives 
developers more flexibility. Great job. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/76bfff39-0b8d-475b-9e1d-f684e96cc818%40googlegroups.com.


[web2py] Py4web - ideas you had , ideas you stole

2019-10-01 Thread António Ramos
Hello Massimo , i´m curious if you are making a new presentation like the
one bellow for py4web.
https://pycon-2012-notes.readthedocs.io/en/latest/web2py.html

Regards

Antonio

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.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/CAEM0BxOeK777HwnurxY-x0Nc2RM8o3cf888OKh9NzH%2BrWpg9dg%40mail.gmail.com.


  1   2   >