[web2py] Re: appconfig.ini versus models/0.py

2018-01-26 Thread Yi Liu
email settings now in AppConfig.ini not 0.py

Took me an hour to figure out. Hope this post can save other people 's time.

On Wednesday, March 29, 2017 at 10:33:22 PM UTC-7, Nico de Groot wrote:
>
> The 0.db solution  is the old approach. Nothing very wrong with it, but 
> the new approach is more user configurable. And it is cacheable. Model 
> files are processed at every request, 0.db slows it down a little.
>
> Nico de Groot 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Does web2py support reCAPTCHA v2?

2018-01-26 Thread Yi Liu
For anyone comes to this thread from Google, to be explicit:

use Recaptcha2() instead of Recaptcha()

use_ssl option is gone.

The book needs to be updated, if I or somebody has time. v1 is no longer 
supported.

On Wednesday, July 29, 2015 at 2:04:59 AM UTC-7, Niphlod wrote:
>
> there's recaptcha "v2" 
> https://github.com/web2py/web2py/blob/master/gluon/tools.py#L971
>
> On Saturday, July 25, 2015 at 10:06:54 PM UTC+2, Chris wrote:
>>
>> I recently got an email notifying me that Google is upgrading its captcha 
>> to the new "no CAPTCHA" version. Does web2py support that by default? I 
>> tried searching in the mailing list but couldn't find the right keywords. 
>> Thanks!
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: web2py IDE

2018-01-26 Thread Jim Steil
PyCharm Community is free.

-Jim

On Fri, Jan 26, 2018 at 12:57 PM, Andrea Fae'  wrote:

> Thanks a lot, but I'd like free IDE, without cost.
>
>
> Il giorno venerdì 26 gennaio 2018 13:32:14 UTC+1, Jim S ha scritto:
>>
>> Great post Mirek!
>>
>> I can confirm that paid PyCharm does work better with web2py than the
>> Community version. What I like about PyCharm is that in addition to a
>> Python IDE, you also get a good editor for HTML, javascript, CSS and a nice
>> database editor if you're using the paid version.
>>
>> If not using the paid version or using some other IDE that isn't
>> web2py-aware, see this section of the book:
>>
>> http://web2py.com/books/default/chapter/29/14/other-recipes#
>> Using-general-purpose-IDEs-with-web2py
>>
>> -Jim
>>
>> On Thursday, January 25, 2018 at 5:08:47 PM UTC-6, Mirek Zvolský wrote:
>>>
>>> If you use a simple editor only, it is similar as the work with web2py
>>> integrated environment. You can just create and edit python files.
>>> Of course the suitable editor must be special for Python writting: It
>>> must at least convert the Tab into 4 spaces. And work with utf-8.
>>>
>>> If you want more, then use some Python IDE.
>>> What means more? Intellisense, Find strings through all projects folders
>>> and files, Find usages of defined fuction or class (in all files), Go to
>>> function or class definitions through click on their call/usage, ...
>>> You have about 30 different Python IDE's to choose your best. I have no
>>> good knowledge about all of them. I just have worked short time with
>>> Eclipse and now about 3 years with PyCharm.
>>> From my opinion when I compare Eclipse and PyCharm, then PyCharm is much
>>> much better. I speak about stability and speed. I cannot compare
>>> properties, because I still use just basics from PyCharm. Example: I still
>>> debug with the command line "from pdb import set_trace; set_trace()"
>>> instead to use the Python integrated debugger.
>>> However I believe PyCharm solution is excellent in such areas too. At
>>> least I hear some experienced developers to say so.
>>>
>>> PyCharm has the free ("community") edition. And has a payed edition. I
>>> use the free edition.
>>> Web2py is special Python software - model+controller+view run in same
>>> scope, which was earlier prepared by Web2py internals. It makes things a
>>> little easier for you because you have some useful things already imported
>>> (request, response, session, html helpers, names from model). This is crazy
>>> for the Python purists because they say: this is completly bad; this is not
>>> Python, when you have inside the file some names from outside which are not
>>> imported. I think, for the developer itself it is not so much bad. Because
>>> we have here the limited number of well known and often used names and the
>>> developer know from where these names come.
>>>
>>> However it is serious problem for the IDE. If you have nice pure Python
>>> code, where the names are from the current file or they are imported, then
>>> for the IDE is easy to find name references in other files.
>>> Here I am not sure if following is true (could somebody confirm it?),
>>> but I think: Payed PyCharm version has improved support for Web2py to help
>>> find the references, but free version hasn't such support. That means you
>>> cannot work with Web2py excellent in the free version. Instead you still
>>> work very poor, not much better as in the basics editors. Yes, a little
>>> better. Clicking or rightclicking the name can find the reference in same
>>> file. But to search the whole project, you cannot do this. You are however
>>> able to search the name as string through all files of the project. Which
>>> is fast too, but not so fast as Ctrl+click or RightClick+FindUsages.
>>>
>>> I think you will make no mistake when you learn to work with PyCharm.
>>> Regardless the possibilities can be (for Web2py) limited with regard to the
>>> previous.
>>>
>>> I don't know about Windows IDE's (Visual Studio) and probably they can
>>> be good for you if you work with other programming languages in same IDE
>>> too (if you already know such IDE).
>>> However PyCharm belongs to the family of JetBrains company IDE's. So you
>>> can use same environment in other programming languages too. However not
>>> everything from JetBrains is for free.
>>>
>>> And of course there is other way: A hard way for the beginning but
>>> during 6 months I think you will be happy. Install double boot
>>> Windows+Linux (even better, if you know Linux has not some fatal problem
>>> with your hardware, then remove Windows and install Linux only). Then use
>>> Python+VirtualEnv+PyCharm.
>>> VirtualEnv is not absolutely neccessary. However you should understand,
>>> that more and more parts of Linux system are written in Python.
>>> Example: You will use Debian on your notebook (which I can recommend
>>> (but of course there is a lot of good possibilities): Debian Stable for
>>> highest 

Re: [web2py] Re: web2py IDE

2018-01-26 Thread Andrea Fae'
Is there available a debugger too?

Il giorno venerdì 26 gennaio 2018 20:04:42 UTC+1, Ramos ha scritto:
>
> for free 
> Sublime Text 3 + w2p plugin
>
> Work and gives you a web2py console and some other stuff
>
> Regards
>
> 2018-01-26 18:57 GMT+00:00 Andrea Fae' :
>
>> Thanks a lot, but I'd like free IDE, without cost.
>>
>>
>> Il giorno venerdì 26 gennaio 2018 13:32:14 UTC+1, Jim S ha scritto:
>>>
>>> Great post Mirek!
>>>
>>> I can confirm that paid PyCharm does work better with web2py than the 
>>> Community version. What I like about PyCharm is that in addition to a 
>>> Python IDE, you also get a good editor for HTML, javascript, CSS and a nice 
>>> database editor if you're using the paid version.
>>>
>>> If not using the paid version or using some other IDE that isn't 
>>> web2py-aware, see this section of the book:
>>>
>>>
>>> http://web2py.com/books/default/chapter/29/14/other-recipes#Using-general-purpose-IDEs-with-web2py
>>>
>>> -Jim
>>>
>>> On Thursday, January 25, 2018 at 5:08:47 PM UTC-6, Mirek Zvolský wrote:

 If you use a simple editor only, it is similar as the work with web2py 
 integrated environment. You can just create and edit python files.
 Of course the suitable editor must be special for Python writting: It 
 must at least convert the Tab into 4 spaces. And work with utf-8.

 If you want more, then use some Python IDE.
 What means more? Intellisense, Find strings through all projects 
 folders and files, Find usages of defined fuction or class (in all files), 
 Go to function or class definitions through click on their call/usage, ...
 You have about 30 different Python IDE's to choose your best. I have no 
 good knowledge about all of them. I just have worked short time with 
 Eclipse and now about 3 years with PyCharm.
 From my opinion when I compare Eclipse and PyCharm, then PyCharm is 
 much much better. I speak about stability and speed. I cannot compare 
 properties, because I still use just basics from PyCharm. Example: I still 
 debug with the command line "from pdb import set_trace; set_trace()" 
 instead to use the Python integrated debugger.
 However I believe PyCharm solution is excellent in such areas too. At 
 least I hear some experienced developers to say so.

 PyCharm has the free ("community") edition. And has a payed edition. I 
 use the free edition.
 Web2py is special Python software - model+controller+view run in same 
 scope, which was earlier prepared by Web2py internals. It makes things a 
 little easier for you because you have some useful things already imported 
 (request, response, session, html helpers, names from model). This is 
 crazy 
 for the Python purists because they say: this is completly bad; this is 
 not 
 Python, when you have inside the file some names from outside which are 
 not 
 imported. I think, for the developer itself it is not so much bad. Because 
 we have here the limited number of well known and often used names and the 
 developer know from where these names come.

 However it is serious problem for the IDE. If you have nice pure Python 
 code, where the names are from the current file or they are imported, then 
 for the IDE is easy to find name references in other files.
 Here I am not sure if following is true (could somebody confirm it?), 
 but I think: Payed PyCharm version has improved support for Web2py to help 
 find the references, but free version hasn't such support. That means you 
 cannot work with Web2py excellent in the free version. Instead you still 
 work very poor, not much better as in the basics editors. Yes, a little 
 better. Clicking or rightclicking the name can find the reference in same 
 file. But to search the whole project, you cannot do this. You are however 
 able to search the name as string through all files of the project. Which 
 is fast too, but not so fast as Ctrl+click or RightClick+FindUsages.

 I think you will make no mistake when you learn to work with PyCharm. 
 Regardless the possibilities can be (for Web2py) limited with regard to 
 the 
 previous.

 I don't know about Windows IDE's (Visual Studio) and probably they can 
 be good for you if you work with other programming languages in same IDE 
 too (if you already know such IDE).
 However PyCharm belongs to the family of JetBrains company IDE's. So 
 you can use same environment in other programming languages too. However 
 not everything from JetBrains is for free.

 And of course there is other way: A hard way for the beginning but 
 during 6 months I think you will be happy. Install double boot 
 Windows+Linux (even better, if you know Linux has not some fatal problem 
 with your hardware, then remove Windows and install Linux only). Then use 
 

Re: [web2py] Re: web2py IDE

2018-01-26 Thread António Ramos
for free
Sublime Text 3 + w2p plugin

Work and gives you a web2py console and some other stuff

Regards

2018-01-26 18:57 GMT+00:00 Andrea Fae' :

> Thanks a lot, but I'd like free IDE, without cost.
>
>
> Il giorno venerdì 26 gennaio 2018 13:32:14 UTC+1, Jim S ha scritto:
>>
>> Great post Mirek!
>>
>> I can confirm that paid PyCharm does work better with web2py than the
>> Community version. What I like about PyCharm is that in addition to a
>> Python IDE, you also get a good editor for HTML, javascript, CSS and a nice
>> database editor if you're using the paid version.
>>
>> If not using the paid version or using some other IDE that isn't
>> web2py-aware, see this section of the book:
>>
>> http://web2py.com/books/default/chapter/29/14/other-recipes#
>> Using-general-purpose-IDEs-with-web2py
>>
>> -Jim
>>
>> On Thursday, January 25, 2018 at 5:08:47 PM UTC-6, Mirek Zvolský wrote:
>>>
>>> If you use a simple editor only, it is similar as the work with web2py
>>> integrated environment. You can just create and edit python files.
>>> Of course the suitable editor must be special for Python writting: It
>>> must at least convert the Tab into 4 spaces. And work with utf-8.
>>>
>>> If you want more, then use some Python IDE.
>>> What means more? Intellisense, Find strings through all projects folders
>>> and files, Find usages of defined fuction or class (in all files), Go to
>>> function or class definitions through click on their call/usage, ...
>>> You have about 30 different Python IDE's to choose your best. I have no
>>> good knowledge about all of them. I just have worked short time with
>>> Eclipse and now about 3 years with PyCharm.
>>> From my opinion when I compare Eclipse and PyCharm, then PyCharm is much
>>> much better. I speak about stability and speed. I cannot compare
>>> properties, because I still use just basics from PyCharm. Example: I still
>>> debug with the command line "from pdb import set_trace; set_trace()"
>>> instead to use the Python integrated debugger.
>>> However I believe PyCharm solution is excellent in such areas too. At
>>> least I hear some experienced developers to say so.
>>>
>>> PyCharm has the free ("community") edition. And has a payed edition. I
>>> use the free edition.
>>> Web2py is special Python software - model+controller+view run in same
>>> scope, which was earlier prepared by Web2py internals. It makes things a
>>> little easier for you because you have some useful things already imported
>>> (request, response, session, html helpers, names from model). This is crazy
>>> for the Python purists because they say: this is completly bad; this is not
>>> Python, when you have inside the file some names from outside which are not
>>> imported. I think, for the developer itself it is not so much bad. Because
>>> we have here the limited number of well known and often used names and the
>>> developer know from where these names come.
>>>
>>> However it is serious problem for the IDE. If you have nice pure Python
>>> code, where the names are from the current file or they are imported, then
>>> for the IDE is easy to find name references in other files.
>>> Here I am not sure if following is true (could somebody confirm it?),
>>> but I think: Payed PyCharm version has improved support for Web2py to help
>>> find the references, but free version hasn't such support. That means you
>>> cannot work with Web2py excellent in the free version. Instead you still
>>> work very poor, not much better as in the basics editors. Yes, a little
>>> better. Clicking or rightclicking the name can find the reference in same
>>> file. But to search the whole project, you cannot do this. You are however
>>> able to search the name as string through all files of the project. Which
>>> is fast too, but not so fast as Ctrl+click or RightClick+FindUsages.
>>>
>>> I think you will make no mistake when you learn to work with PyCharm.
>>> Regardless the possibilities can be (for Web2py) limited with regard to the
>>> previous.
>>>
>>> I don't know about Windows IDE's (Visual Studio) and probably they can
>>> be good for you if you work with other programming languages in same IDE
>>> too (if you already know such IDE).
>>> However PyCharm belongs to the family of JetBrains company IDE's. So you
>>> can use same environment in other programming languages too. However not
>>> everything from JetBrains is for free.
>>>
>>> And of course there is other way: A hard way for the beginning but
>>> during 6 months I think you will be happy. Install double boot
>>> Windows+Linux (even better, if you know Linux has not some fatal problem
>>> with your hardware, then remove Windows and install Linux only). Then use
>>> Python+VirtualEnv+PyCharm.
>>> VirtualEnv is not absolutely neccessary. However you should understand,
>>> that more and more parts of Linux system are written in Python.
>>> Example: You will use Debian on your notebook (which I can recommend
>>> (but of course there is a 

Re: [web2py] .represent

2018-01-26 Thread Andrea Fae'
for me it's worst than before!
what is other_table? Why you don't use row? I don't understand...I'm sorry

Il giorno venerdì 26 gennaio 2018 10:50:49 UTC+1, Massimiliano ha scritto:
>
> The first argument of the represent function is the field value.
> So in the the second example the `id` arg is the other_id value.
>
> Maybe the example could be more clear in this way:
>
> db.mytable.other_id.represent = lambda id, row: db.other_table[id].other_field
>
>
> On Fri, Jan 26, 2018 at 10:24 AM, Andrea Fae'  > wrote:
>
>> "Represent" from web2py book
>>
>> But what exactly are the relationship between "other_id" and "is" in the 
>> second example?
>> And in the third from what is get the variable "value"?
>> Thank you
>>
>> .represent can be None or can point to a function that takes a field 
>> value and returns an alternate representation for the field value.
>>
>> Examples:
>>
>> 1
>> 2
>> 3
>>
>> db.mytable.name.represent = lambda name, row: 
>> name.capitalize()db.mytable.other_id.represent = lambda id, row: 
>> row.myfielddb.mytable.some_uploadfield.represent = lambda value, row: A('get 
>> it', _href=URL('download', args=value))
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Massimiliano
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: mobile menu not working?

2018-01-26 Thread Yi Liu
Thank you. I will make sure I check github in the future.

On Friday, January 26, 2018 at 10:08:50 AM UTC-8, Paolo Caruccio wrote:
>
> Please try the solution in  https://github.com/web2py/web2py/issues/1828
>
> 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py IDE

2018-01-26 Thread Andrea Fae'
Thanks a lot, but I'd like free IDE, without cost.


Il giorno venerdì 26 gennaio 2018 13:32:14 UTC+1, Jim S ha scritto:
>
> Great post Mirek!
>
> I can confirm that paid PyCharm does work better with web2py than the 
> Community version. What I like about PyCharm is that in addition to a 
> Python IDE, you also get a good editor for HTML, javascript, CSS and a nice 
> database editor if you're using the paid version.
>
> If not using the paid version or using some other IDE that isn't 
> web2py-aware, see this section of the book:
>
>
> http://web2py.com/books/default/chapter/29/14/other-recipes#Using-general-purpose-IDEs-with-web2py
>
> -Jim
>
> On Thursday, January 25, 2018 at 5:08:47 PM UTC-6, Mirek Zvolský wrote:
>>
>> If you use a simple editor only, it is similar as the work with web2py 
>> integrated environment. You can just create and edit python files.
>> Of course the suitable editor must be special for Python writting: It 
>> must at least convert the Tab into 4 spaces. And work with utf-8.
>>
>> If you want more, then use some Python IDE.
>> What means more? Intellisense, Find strings through all projects folders 
>> and files, Find usages of defined fuction or class (in all files), Go to 
>> function or class definitions through click on their call/usage, ...
>> You have about 30 different Python IDE's to choose your best. I have no 
>> good knowledge about all of them. I just have worked short time with 
>> Eclipse and now about 3 years with PyCharm.
>> From my opinion when I compare Eclipse and PyCharm, then PyCharm is much 
>> much better. I speak about stability and speed. I cannot compare 
>> properties, because I still use just basics from PyCharm. Example: I still 
>> debug with the command line "from pdb import set_trace; set_trace()" 
>> instead to use the Python integrated debugger.
>> However I believe PyCharm solution is excellent in such areas too. At 
>> least I hear some experienced developers to say so.
>>
>> PyCharm has the free ("community") edition. And has a payed edition. I 
>> use the free edition.
>> Web2py is special Python software - model+controller+view run in same 
>> scope, which was earlier prepared by Web2py internals. It makes things a 
>> little easier for you because you have some useful things already imported 
>> (request, response, session, html helpers, names from model). This is crazy 
>> for the Python purists because they say: this is completly bad; this is not 
>> Python, when you have inside the file some names from outside which are not 
>> imported. I think, for the developer itself it is not so much bad. Because 
>> we have here the limited number of well known and often used names and the 
>> developer know from where these names come.
>>
>> However it is serious problem for the IDE. If you have nice pure Python 
>> code, where the names are from the current file or they are imported, then 
>> for the IDE is easy to find name references in other files.
>> Here I am not sure if following is true (could somebody confirm it?), but 
>> I think: Payed PyCharm version has improved support for Web2py to help find 
>> the references, but free version hasn't such support. That means you cannot 
>> work with Web2py excellent in the free version. Instead you still work very 
>> poor, not much better as in the basics editors. Yes, a little better. 
>> Clicking or rightclicking the name can find the reference in same file. But 
>> to search the whole project, you cannot do this. You are however able to 
>> search the name as string through all files of the project. Which is fast 
>> too, but not so fast as Ctrl+click or RightClick+FindUsages.
>>
>> I think you will make no mistake when you learn to work with PyCharm. 
>> Regardless the possibilities can be (for Web2py) limited with regard to the 
>> previous.
>>
>> I don't know about Windows IDE's (Visual Studio) and probably they can be 
>> good for you if you work with other programming languages in same IDE too 
>> (if you already know such IDE).
>> However PyCharm belongs to the family of JetBrains company IDE's. So you 
>> can use same environment in other programming languages too. However not 
>> everything from JetBrains is for free.
>>
>> And of course there is other way: A hard way for the beginning but during 
>> 6 months I think you will be happy. Install double boot Windows+Linux (even 
>> better, if you know Linux has not some fatal problem with your hardware, 
>> then remove Windows and install Linux only). Then use 
>> Python+VirtualEnv+PyCharm.
>> VirtualEnv is not absolutely neccessary. However you should understand, 
>> that more and more parts of Linux system are written in Python.
>> Example: You will use Debian on your notebook (which I can recommend (but 
>> of course there is a lot of good possibilities): Debian Stable for highest 
>> stability or Debian Testing for newer software versions (which is probably 
>> good for the developers machine). In Debian (and I think all other Linux 

[web2py] Re: mobile menu not working?

2018-01-26 Thread Paolo Caruccio
Please try the solution in  https://github.com/web2py/web2py/issues/1828

Regards.

Il giorno venerdì 26 gennaio 2018 18:18:18 UTC+1, Yi Liu ha scritto:
>
> Dear all,
>
> I have latest web2py running at trialert.com
>
> Both my barebone app and welcome app at trialert.com/welcome have problem 
> with mobile theme. The mobile menu at top right corner does not work, not 
> clickable.
>
> Best, Yi
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] mobile menu not working?

2018-01-26 Thread Yi Liu
Dear all,

I have latest web2py running at trialert.com

Both my barebone app and welcome app at trialert.com/welcome have problem 
with mobile theme. The mobile menu at top right corner does not work, not 
clickable.

Best, Yi

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py IDE

2018-01-26 Thread Jim S
Great post Mirek!

I can confirm that paid PyCharm does work better with web2py than the 
Community version. What I like about PyCharm is that in addition to a 
Python IDE, you also get a good editor for HTML, javascript, CSS and a nice 
database editor if you're using the paid version.

If not using the paid version or using some other IDE that isn't 
web2py-aware, see this section of the book:

http://web2py.com/books/default/chapter/29/14/other-recipes#Using-general-purpose-IDEs-with-web2py

-Jim

On Thursday, January 25, 2018 at 5:08:47 PM UTC-6, Mirek Zvolský wrote:
>
> If you use a simple editor only, it is similar as the work with web2py 
> integrated environment. You can just create and edit python files.
> Of course the suitable editor must be special for Python writting: It must 
> at least convert the Tab into 4 spaces. And work with utf-8.
>
> If you want more, then use some Python IDE.
> What means more? Intellisense, Find strings through all projects folders 
> and files, Find usages of defined fuction or class (in all files), Go to 
> function or class definitions through click on their call/usage, ...
> You have about 30 different Python IDE's to choose your best. I have no 
> good knowledge about all of them. I just have worked short time with 
> Eclipse and now about 3 years with PyCharm.
> From my opinion when I compare Eclipse and PyCharm, then PyCharm is much 
> much better. I speak about stability and speed. I cannot compare 
> properties, because I still use just basics from PyCharm. Example: I still 
> debug with the command line "from pdb import set_trace; set_trace()" 
> instead to use the Python integrated debugger.
> However I believe PyCharm solution is excellent in such areas too. At 
> least I hear some experienced developers to say so.
>
> PyCharm has the free ("community") edition. And has a payed edition. I use 
> the free edition.
> Web2py is special Python software - model+controller+view run in same 
> scope, which was earlier prepared by Web2py internals. It makes things a 
> little easier for you because you have some useful things already imported 
> (request, response, session, html helpers, names from model). This is crazy 
> for the Python purists because they say: this is completly bad; this is not 
> Python, when you have inside the file some names from outside which are not 
> imported. I think, for the developer itself it is not so much bad. Because 
> we have here the limited number of well known and often used names and the 
> developer know from where these names come.
>
> However it is serious problem for the IDE. If you have nice pure Python 
> code, where the names are from the current file or they are imported, then 
> for the IDE is easy to find name references in other files.
> Here I am not sure if following is true (could somebody confirm it?), but 
> I think: Payed PyCharm version has improved support for Web2py to help find 
> the references, but free version hasn't such support. That means you cannot 
> work with Web2py excellent in the free version. Instead you still work very 
> poor, not much better as in the basics editors. Yes, a little better. 
> Clicking or rightclicking the name can find the reference in same file. But 
> to search the whole project, you cannot do this. You are however able to 
> search the name as string through all files of the project. Which is fast 
> too, but not so fast as Ctrl+click or RightClick+FindUsages.
>
> I think you will make no mistake when you learn to work with PyCharm. 
> Regardless the possibilities can be (for Web2py) limited with regard to the 
> previous.
>
> I don't know about Windows IDE's (Visual Studio) and probably they can be 
> good for you if you work with other programming languages in same IDE too 
> (if you already know such IDE).
> However PyCharm belongs to the family of JetBrains company IDE's. So you 
> can use same environment in other programming languages too. However not 
> everything from JetBrains is for free.
>
> And of course there is other way: A hard way for the beginning but during 
> 6 months I think you will be happy. Install double boot Windows+Linux (even 
> better, if you know Linux has not some fatal problem with your hardware, 
> then remove Windows and install Linux only). Then use 
> Python+VirtualEnv+PyCharm.
> VirtualEnv is not absolutely neccessary. However you should understand, 
> that more and more parts of Linux system are written in Python.
> Example: You will use Debian on your notebook (which I can recommend (but 
> of course there is a lot of good possibilities): Debian Stable for highest 
> stability or Debian Testing for newer software versions (which is probably 
> good for the developers machine). In Debian (and I think all other Linux 
> distributions) Python2 and Python3 are already installed (because part of 
> system and lot of software use them) and packaging system has lot of 
> python2-xxx or python3-xxx packages which are installed together 

Re: [web2py] .represent

2018-01-26 Thread Massimiliano
The first argument of the represent function is the field value.
So in the the second example the `id` arg is the other_id value.

Maybe the example could be more clear in this way:

db.mytable.other_id.represent = lambda id, row: db.other_table[id].other_field


On Fri, Jan 26, 2018 at 10:24 AM, Andrea Fae'  wrote:

> "Represent" from web2py book
>
> But what exactly are the relationship between "other_id" and "is" in the
> second example?
> And in the third from what is get the variable "value"?
> Thank you
>
> .represent can be None or can point to a function that takes a field value
> and returns an alternate representation for the field value.
>
> Examples:
>
> 1
> 2
> 3
>
> db.mytable.name.represent = lambda name, row: 
> name.capitalize()db.mytable.other_id.represent = lambda id, row: 
> row.myfielddb.mytable.some_uploadfield.represent = lambda value, row: A('get 
> it', _href=URL('download', args=value))
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Massimiliano

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] .represent

2018-01-26 Thread Andrea Fae'
"Represent" from web2py book

But what exactly are the relationship between "other_id" and "is" in the 
second example?
And in the third from what is get the variable "value"?
Thank you

.represent can be None or can point to a function that takes a field value 
and returns an alternate representation for the field value.

Examples:

1
2
3

db.mytable.name.represent = lambda name, row: 
name.capitalize()db.mytable.other_id.represent = lambda id, row: 
row.myfielddb.mytable.some_uploadfield.represent = lambda value, row: A('get 
it', _href=URL('download', args=value))

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.