[web2py] How to sort a smartgrid with your own custom sorted id list

2020-06-18 Thread rāma
Hi all,

How to sort a smartgrid with your own custom sorted id list?

Say I have a id list of the query and I have a sorting functions that 
returns a sorted id list, how would I make smartgrid to commit to the 
ordering instead of sorting by ids by default?

Thanks,
rama

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/a078772b-0d41-4993-8df7-b9e5c223e9d0o%40googlegroups.com.


[web2py] docker for web2py with conda running on nginx

2019-11-04 Thread rāma
Dear web2py community,

I am sharing my docker container that has pandas, numpy and scikit-learn 
preinstalled via docker running on nginx.

https://hub.docker.com/r/rnjv/conda-web2py

docker pull rnjv/conda-web2py

Best,
rāma

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/e6fd8c31-f533-468d-b9ec-56a833616862%40googlegroups.com.


Re: [web2py] Web2py Windows edition with 3.x Interpreter

2019-06-14 Thread rāma
Hi Dave,

Nico is right here. I used pip to pre-package modules for easier 
distribution. Not really a DLL but works. The only downside is that 
distributing the app can be really large.

On Friday, 14 June 2019 00:31:50 UTC+8, Dave S wrote:
>
>
>
> On Monday, April 29, 2019 at 8:15:09 PM UTC-7, rāma wrote:
>>
>> Hi Nico,
>>
>> Thanks for your inputs.
>>
>> I've actually run windows py2.7 binary with modules within site-packages, 
>> and pip can be leveraged by setting your target folder like this: 
>>
>> pip install -t site-packages 
>>
>> for the benefit of other readers. It's just that pandas didn't quite work 
>> for me in py2.7 and ported my code to python 3.5+.
>>
>>>
>>>>  
> Hi, rāma --
>
> I'm interested in how you got pip installed with python as a DLL.  I want 
> to play around with Pillow.
>
> /dps
>
>

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


[web2py] Re: nssm does not work

2019-06-06 Thread rāma
Thank you Dave and Niphlod for your responses. It helped me troubleshoot my 
issues. Forum useful as always!

On Wednesday, 5 June 2019 16:54:53 UTC+8, Niphlod wrote:
>
> what happened may differ from what you thought it should happen which may 
> differ from what needs to happen.
>
> said that, nssm just bootstrap the process. the fact that you have a 
> service up&running may already indicate that everything is running smoothly 
> but if you wanna do a check, open the task manager, go to details, see if 
> there's a web2py running (it may be useful to select the column holding the 
> command line)
>
> On Monday, June 3, 2019 at 8:58:02 AM UTC+2, rāma wrote:
>>
>> I am using the latest version of NSSM - the Non-Sucking Service Manager; 
>> both 2.24 and the prelease build 2.2.4-101 .
>>
>> Unfortunately for me, NSSM sucked big time and trying to get it working 
>> with web2py was an utter waste of time.
>>
>> Tried
>> -K; nothing and tried
>> -X; nothing anyways
>>
>> Env:
>> Python3.7
>> Windows 10
>>
>> Can anyone advise what is supposed to happen after issuing -K app1 ? A 
>> windows pop-up or the local webserver starts ? There is no outcome clearly 
>> explained in any material I have gone through so far.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/c8187c4b-17c8-4e84-b52d-510182b7f35b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: new free toys

2019-06-03 Thread rāma
Can the taskutils be used to replace nssm with web2py?

On Wednesday, 27 January 2016 13:49:26 UTC+8, Massimo Di Pierro wrote:
>
> # a library to convert units and propagate errors in math
> https://github.com/mdipierro/buckingham
>
> # a library to automatically install modules when imported
> https://github.com/mdipierro/autoinstaller
>
> # a multithreaded task scheduler (originally created for a crawler)
> https://github.com/mdipierro/taskutils
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/97caf055-a5f5-4d22-8bf2-f94b2201202e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] nssm does not work

2019-06-02 Thread rāma
I am using the latest version of NSSM - the Non-Sucking Service Manager; 
both 2.24 and the prelease build 2.2.4-101 .

Unfortunately for me, NSSM sucked big time and trying to get it working 
with web2py was an utter waste of time.

Tried
-K; nothing and tried
-X; nothing anyways

Env:
Python3.7
Windows 10

Can anyone advise what is supposed to happen after issuing -K app1 ? A 
windows pop-up or the local webserver starts ? There is no outcome clearly 
explained in any material I have gone through so far.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/57c77e5c-7467-4275-8f1c-e34320c8568b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Electron, NWjs or Netralinojs and web2py

2019-05-23 Thread rāma
Hi,

Is there anyone working on packaging web2py as an webview app?

Is it easily deployable with these kits?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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/f53f9374-d9ee-45e2-aa29-04988789172e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Add button to smartgrid?

2019-05-21 Thread rāma
Or better:

links=dict(meter_list=[lambda row:
   A(
   [SPAN(_class="menu-icon fa fa-paper-plane"),
SPAN("Go To "+str(row.id), _class="buttontext 
button", _title="GoTo")]
   , _href="TEST", _class="button btn btn-default 
btn-secondary")]
   ))


you can get the row properties into your button. But, what I am not sure is 
how to control where it appears in the table. Right now, by default, it 
appears before table referencing links.

On Tuesday, 21 May 2019 15:52:57 UTC+8, rāma wrote:
>
> I used:
>
> for x in grid.elements('td.row_buttons'):
> x.insert(4, A(
> [SPAN(_class="menu-icon fa fa-paper-plane"), SPAN("Go To", 
> _class="buttontext button", _title="GoTo")]
> , _href="TEST", _class="button btn btn-default btn-secondary"))
>
>
> This is specific to my needs, you may not want those span and class 
> attributes. It creates a Go To button after view, edit, and delete if its 
> turned on.
>
> On Thursday, 27 June 2013 02:42:26 UTC+8, Jim S wrote:
>>
>> Where in the smartgrid do you need to add it?  Can you just have a custom 
>> view?  Maybe post some code or pics to show what you're trying to 
>> accomplish.
>>
>> -Jim
>>
>>
>> On Wednesday, June 26, 2013 10:51:02 AM UTC-5, Tom Russell wrote:
>>>
>>> I need to add a button to the smartgrid but not like doing create=True 
>>> because I have a form factory that has 2 other tables associated with the 
>>> one. I know in html I can simply add a line for a button but since I am not 
>>> using html for this how would I add a button to that page to reference my 
>>> own view?
>>>
>>> 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/08edeae4-0ee0-4ec8-b045-1a7b2b8c06fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Add button to smartgrid?

2019-05-21 Thread rāma
I used:

for x in grid.elements('td.row_buttons'):
x.insert(4, A(
[SPAN(_class="menu-icon fa fa-paper-plane"), SPAN("Go To", 
_class="buttontext button", _title="GoTo")]
, _href="TEST", _class="button btn btn-default btn-secondary"))


This is specific to my needs, you may not want those span and class 
attributes. It creates a Go To button after view, edit, and delete if its 
turned on.

On Thursday, 27 June 2013 02:42:26 UTC+8, Jim S wrote:
>
> Where in the smartgrid do you need to add it?  Can you just have a custom 
> view?  Maybe post some code or pics to show what you're trying to 
> accomplish.
>
> -Jim
>
>
> On Wednesday, June 26, 2013 10:51:02 AM UTC-5, Tom Russell wrote:
>>
>> I need to add a button to the smartgrid but not like doing create=True 
>> because I have a form factory that has 2 other tables associated with the 
>> one. I know in html I can simply add a line for a button but since I am not 
>> using html for this how would I add a button to that page to reference my 
>> own view?
>>
>> 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/b2f16592-a375-41d9-9dfd-7a549b25a628%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: Future of web2py

2019-05-02 Thread rāma
ONE month!? Sounds super exciting.

On Thursday, 2 May 2019 15:16:21 UTC+8, Massimo Di Pierro wrote:
>
> yes. for my prospective it is very close to be done. we have:
>
> [x] more than x10 faster than web2py
> [x] pydal (same as web2py)
> [x] routing (like bottle or flask)
> [x] T
> [x] helpers (99% compatible with a web2py)
> [x] template (same as web2py)
> [x] sessions (in cookies, db, redis, memcache) (need more testing)
> [90%] forms (very similar to web2py)
> [50%] _dashboard (equivalent of admin)
> [0%] grid
> [0%] appadmin replacement
> [0%] auth
>
> The last 3 will very different from web2py. grid will be more JS based. 
> appadmin will use the grid and be based on some variation collection/json 
> and/or graphql support for pydal. auth will be replaced by plugguble 
> modules and a simple database structure. groups will be replaced by generic 
> hierarchical tags. Maybe I will be done in one more month. 
>
> I could use some help adding missing functions to _dashboard.
>
> On Tuesday, 30 April 2019 13:46:04 UTC-7, villas wrote:
>>
>> Check this out: 
>> https://github.com/web2py/web3py
>>
>> Search this current group for recent posts on 'web3py'.
>>
>> Regards, D
>>
>>
>>
>> On Tuesday, 30 April 2019 18:35:04 UTC+1, Gabor Nyul wrote:
>>>
>>> We are talking for about 2 years now about a possible web3py and other 
>>> possible addons to it.
>>> What do you think, when we can get the first insight of it? If at all...
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] Web2py Windows edition with 3.x Interpreter

2019-04-29 Thread rāma
Hi Nico,

Thanks for your inputs.

I've actually run windows py2.7 binary with modules within site-packages, 
and pip can be leveraged by setting your target folder like this: pip 
install -t site-packages . Just for the benefit of other 
readers. It's just that pandas didn't quite work for me in py2.7 and ported 
my code to python 3.5+.

It is convenient to distribute your app and whole web2py as a binary or as 
a client for desktop users. If we were to package with pynsist with 
webview: https://github.com/takluyver/pynsist/tree/master/examples/pywebview it 
can act *like *a standalone binary app on Windows or Mac masking the local 
web address. I also see a value in this as a way forward to have python 
based program running like a program locally on a client rather in the 
cloud wherever necessary cloud sync can be employed. I have not been 
successful with pynsist though.

Best,
rama

On Monday, 29 April 2019 20:49:49 UTC+8, Nico Zanferrari wrote:
>
> Hi rama,
>
> first of all, note that the shell.py fix will resolve only the 'cosmethic' 
> problem of the help command (and "copyright", "credits" , "license" 
> commands) that doesn't work in the interactive shell. But it will not 
> change the import problem in any way.
>
>
> According to the manual, if you run web2py *from source* you can import 
> from it any python module that is in the PYTHONPATH (sys.path) - which is 
> automatically changed by web2py in order to include also 
> web2py/site-packages (globally) and web2py/application/yourapp/modules 
> (inside yourapp). 
> The last one is preferred if you are planning to distribute the app or you 
> are experimenting with different versions of the same module. It also has 
> higher priority and can even be accessed by other apps as 
> web2py/application/anotherapp/modules.
>
> If you run web2py *from the compiled binary*, any system-wide folder will 
> be ignored - only what's down the web2py folder will be available. Modules 
> can be placed on the folders: web2py, web2py/site-packages (globally for 
> all the apps) and web2py/application/yourapp/modules (inside yourapp). You 
> can check it by yourself with the interactive shell and the simple 
> helloworld.py module.
>
> What's different and problematic in the 'running from binary' is that you 
> cannot use pip (or similar) for installing modules inside. You instead have 
> to pip-install them on a full system (that has python of the same version 
> of the binary one) and manually copy the related files inside the binary 
> folders. For complex module like pandas, you also have to copy all the 
> files for the related pre-requisites - and possibly test them one by one.
>
Unfortunately, this could fail - expecially if the modules have binary 
> files. In this case, the last resort is to try to compile the binary 
> version by yourself from a working web2py source - following the 
> instructions on my repository and specifying your additional needed 
> modules. Maybe PyInstaller will play the module dependency game better than 
> you ;-)
>
>
> I've also copied these advices on this howto page 
> <https://github.com/nicozanf/web2py-pyinstaller/blob/master/HOWTO-modules.md> 
> for 
> future reference - feel free to correct me if I was wrong somewhere!
>
>
> Cheers,
> Nico 
>
>
> Il giorno lun 29 apr 2019 alle ore 04:24 rāma  > ha scritto:
>
>> Hi Nico,
>>
>> Thank you for the insights. I am actually importing a number of modules 
>> within the controllers fyi, not only via shell.
>>
>> Would patching shell.py fix the behaviour application wide?
>>
>> Do you suggest I pip install into site-packages again instead of copying 
>> from my source version? I suspect that it's not going to fix it.
>>
>> Folder structure:
>> web2py
>>|_site-packages <- here's where my modules are
>>
>> I am trying to package and bundle the whole web2py for work as an app 
>> solution and for test release soon.
>> Your experimental binaries would definitely help me to do early test with 
>> users while waiting for the official binaries. I could do some quick 
>> patches on web2py if required too, please advise how.
>>
>> Best,
>> rama
>>
>> On Monday, 29 April 2019 05:30:55 UTC+8, Nico Zanferrari wrote:
>>>
>>> I've found why the help command (and "copyright", "credits" , 
>>> "license")  it's missing. It's due to the fact that PyInstaller replaces 
>>> the original python module 'site'  with a fake one 
>>> <https://github.com/pyinstaller/pyinstaller/blob/develop

Re: [web2py] Web2py Windows edition with 3.x Interpreter

2019-04-28 Thread rāma
Hi Nico,

Thank you for the insights. I am actually importing a number of modules 
within the controllers fyi, not only via shell.

Would patching shell.py fix the behaviour application wide?

Do you suggest I pip install into site-packages again instead of copying 
from my source version? I suspect that it's not going to fix it.

Folder structure:
web2py
   |_site-packages <- here's where my modules are

I am trying to package and bundle the whole web2py for work as an app 
solution and for test release soon.
Your experimental binaries would definitely help me to do early test with 
users while waiting for the official binaries. I could do some quick 
patches on web2py if required too, please advise how.

Best,
rama

On Monday, 29 April 2019 05:30:55 UTC+8, Nico Zanferrari wrote:
>
> I've found why the help command (and "copyright", "credits" , 
> "license")  it's missing. It's due to the fact that PyInstaller replaces 
> the original python module 'site'  with a fake one 
> <https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/fake-modules/site.py>
>  
> that contains this comment:
>
>
> "This is a fake 'site' module available in default Python Library.
>
> The real 'site' does some magic to find paths to other possible
> Python modules. We do not want this behaviour for frozen applications.
>
> Fake 'site' makes PyInstaller to work with distutils and to work inside
> virtualenv environment."
>
> It's possible to change this behaviour on gluon/shell.py by adding the 
> missing code - I'm setting up a PR for this ;-)
>
> Nico
>
>
> Il giorno dom 28 apr 2019 alle ore 19:45 Nico Zanferrari <
> nico...@gmail.com > ha scritto:
>
>> Hi rāma, 
>>
>> in fact we are both wrong and the console is working fine!
>> I've tested it with a simple module (the simplest one, helloword.py , see 
>> https://stackoverflow.com/questions/15746675/how-to-write-a-python-module-package)
>>   
>> and it can be regularly imported if it's placed on the main folder or on  
>> the site-packages one. So, it seems that your problem is strictly related 
>> to copying the pandas module.
>>
>> But indeed the interactive console is not so perfect. It's  somehow 
>> missing the help command (and "copyright", "credits" , "license"), and this 
>> happens with PyInstaller on PY2/PY3 with Windows and Mac even with the 
>> simple 2-lines program:
>>
>> import code
>> code.interact() 
>>
>> Nico
>>
>> Il giorno sab 27 apr 2019 alle ore 13:45 rāma > > ha scritto:
>>
>>> Any quick fix will be appreciated though.
>>>
>>> On Friday, 26 April 2019 15:30:57 UTC+8, Massimo Di Pierro wrote:
>>>>
>>>> Yes. The plan is to provide the following executable from the official 
>>>> web page:
>>>>
>>>> OS web2py for py2.7, web2py for py3.7, web3py for py3.7 (WIP)
>>>> WINDOWS web2py for py2.7, web2py for py3.7, web3py for py3.7 (WIP)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thursday, 25 April 2019 22:02:37 UTC-7, rāma wrote:
>>>>>
>>>>> This is wonderful. And, something I would love to be adopted to the 
>>>>> official repo.
>>>>>
>>>>> Thanks for this!
>>>>>
>>>>> On Sunday, 3 March 2019 19:24:38 UTC+8, Nico Zanferrari wrote:
>>>>>>
>>>>>> Good morning!
>>>>>>
>>>>>> I'm proud to say that I've succeeded in building the Windows 64 bit 
>>>>>> binary with python 3.7.2 using pyinstaller !  Grab it from 
>>>>>> https://github.com/nicozanf/web2py-pyinstaller 
>>>>>>
>>>>>> There are some little gothas, but it seems to work fine:
>>>>>> - in the console I've got many errors like 
>>>>>> 'ERROR:Rocket.Errors.Thread-2:Tried to send "500 Server Error" to client 
>>>>>> but received socket error'. They disappear as soon as I've disabled IPv6 
>>>>>> and rebooted. There are users that report also to fix similar problems 
>>>>>> by 
>>>>>> adding the hostname on the hosts file
>>>>>> - psycopg2 is placed in a folder by itself, instead than in the root 
>>>>>> folder
>>>>>> - in the currently official b

Re: [web2py] Web2py Windows edition with 3.x Interpreter

2019-04-27 Thread rāma
Any quick fix will be appreciated though.

On Friday, 26 April 2019 15:30:57 UTC+8, Massimo Di Pierro wrote:
>
> Yes. The plan is to provide the following executable from the official web 
> page:
>
> OS web2py for py2.7, web2py for py3.7, web3py for py3.7 (WIP)
> WINDOWS web2py for py2.7, web2py for py3.7, web3py for py3.7 (WIP)
>
>
>
>
>
>
>
>
>
> On Thursday, 25 April 2019 22:02:37 UTC-7, rāma wrote:
>>
>> This is wonderful. And, something I would love to be adopted to the 
>> official repo.
>>
>> Thanks for this!
>>
>> On Sunday, 3 March 2019 19:24:38 UTC+8, Nico Zanferrari wrote:
>>>
>>> Good morning!
>>>
>>> I'm proud to say that I've succeeded in building the Windows 64 bit 
>>> binary with python 3.7.2 using pyinstaller !  Grab it from 
>>> https://github.com/nicozanf/web2py-pyinstaller 
>>>
>>> There are some little gothas, but it seems to work fine:
>>> - in the console I've got many errors like 
>>> 'ERROR:Rocket.Errors.Thread-2:Tried to send "500 Server Error" to client 
>>> but received socket error'. They disappear as soon as I've disabled IPv6 
>>> and rebooted. There are users that report also to fix similar problems by 
>>> adding the hostname on the hosts file
>>> - psycopg2 is placed in a folder by itself, instead than in the root 
>>> folder
>>> - in the currently official binary build (with pyhton 2.7) there are 
>>> also two binaries: web2py_no_console.exe and web2py_on_gevent.exe. They 
>>> don't run correctly, and don't seem to be so important for me so I've 
>>> decided to skip their generation.
>>> - Macintosh compatibility is needed, but I cannot work on it
>>>
>>> Please, help with testing it! I'll make a PR on the official web2py 
>>> repository after some feedback.
>>>
>>> Cheers,
>>> Nico
>>>
>>> Il giorno mer 27 feb 2019 alle ore 12:03 Nico Zanferrari <
>>> nico...@gmail.com> ha scritto:
>>>
>>>> Hi,
>>>>
>>>> this is a big problem also from my point of view and I've already 
>>>> opened issue 2027 <https://github.com/web2py/web2py/issues/2027> . 
>>>> However it's not so easy to achieve this goal, because you've to switch to 
>>>> 3.x + go 64 bit + change the *freezer* program (py2exe and bbfreeze do 
>>>> not work with python >= 3.5). I'm playing with pyinstaller, but I'm not 
>>>> promising anything. And also a binary Mac version is needed (I only have a 
>>>> Win box), plus testing everything.
>>>>
>>>> Cheers,
>>>> Nico 
>>>>
>>>> Il giorno mer 27 feb 2019 alle ore 11:45 elisha bere <
>>>> elish...@gmail.com> ha scritto:
>>>>
>>>>> Hie, 
>>>>>
>>>>> Is it possible to change from 2.7 to 3.x in my web2py app
>>>>>
>>>>> On 17 Feb 2019 20:57, "Jitun John"  wrote:
>>>>>
>>>>>> "It requires Python 2.6 (no more supported), Python 2.7 (stable) or 
>>>>>> Python 3.5+ (*recommended for new projects*) already installed on 
>>>>>> your system. 
>>>>>> There are also *binary packages for Windows* and Mac OS X.* They 
>>>>>> include the Python 2.7 interpreter* so you do not need to have it 
>>>>>> pre-installed."
>>>>>>
>>>>>> Sorry for my ignorance, I am assuming "Python 2.7 interpreter" as 
>>>>>> "python27.dll" and "pywintypes27.dll" files.
>>>>>>
>>>>>> I recently moved my app from 2.x to 3.x using PyCharm IDE and the app 
>>>>>> works fine when using IDE on 3.7 python.
>>>>>> But when I try to compile it to .exe (using .iss file + hstart.exe), 
>>>>>> I cant use the existing web2py_win.zip file.
>>>>>>
>>>>>> Gives me " unsupported pickle protocol: 
>>>>>> 3"
>>>>>>
>>>>>> As we are recommending new projects on 3.x, Is it possible for the 
>>>>>> next version to have a 3.x interpreter ?
>>>>>> or if we have a workaround, I am happy to try it.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> -- 
>>>>>> Resources:
>>>>>

Re: [web2py] Web2py Windows edition with 3.x Interpreter

2019-04-25 Thread rāma
I tested this just now. I can't seem to import pandas.

raise ImportError("No module named %s" % modules_prefix)
ImportError: No module named applications.dqma.modules.pandas


I have a previous web2py from source and have all module in my 
site-packages which I copied over to this 64-bit version. I used a conda 
environment running of pycharm in my original version and made sure all the 
site-packages modules or not preinstalled in the conda environment.

Please help.

On Friday, 26 April 2019 13:02:37 UTC+8, rāma wrote:
>
> This is wonderful. And, something I would love to be adopted to the 
> official repo.
>
> Thanks for this!
>
> On Sunday, 3 March 2019 19:24:38 UTC+8, Nico Zanferrari wrote:
>>
>> Good morning!
>>
>> I'm proud to say that I've succeeded in building the Windows 64 bit 
>> binary with python 3.7.2 using pyinstaller !  Grab it from 
>> https://github.com/nicozanf/web2py-pyinstaller 
>>
>> There are some little gothas, but it seems to work fine:
>> - in the console I've got many errors like 
>> 'ERROR:Rocket.Errors.Thread-2:Tried to send "500 Server Error" to client 
>> but received socket error'. They disappear as soon as I've disabled IPv6 
>> and rebooted. There are users that report also to fix similar problems by 
>> adding the hostname on the hosts file
>> - psycopg2 is placed in a folder by itself, instead than in the root 
>> folder
>> - in the currently official binary build (with pyhton 2.7) there are also 
>> two binaries: web2py_no_console.exe and web2py_on_gevent.exe. They don't 
>> run correctly, and don't seem to be so important for me so I've decided to 
>> skip their generation.
>> - Macintosh compatibility is needed, but I cannot work on it
>>
>> Please, help with testing it! I'll make a PR on the official web2py 
>> repository after some feedback.
>>
>> Cheers,
>> Nico
>>
>> Il giorno mer 27 feb 2019 alle ore 12:03 Nico Zanferrari <
>> nico...@gmail.com> ha scritto:
>>
>>> Hi,
>>>
>>> this is a big problem also from my point of view and I've already opened 
>>> issue 
>>> 2027 <https://github.com/web2py/web2py/issues/2027> . However it's not 
>>> so easy to achieve this goal, because you've to switch to 3.x + go 64 bit + 
>>> change the *freezer* program (py2exe and bbfreeze do not work with 
>>> python >= 3.5). I'm playing with pyinstaller, but I'm not promising 
>>> anything. And also a binary Mac version is needed (I only have a Win box), 
>>> plus testing everything.
>>>
>>> Cheers,
>>> Nico 
>>>
>>> Il giorno mer 27 feb 2019 alle ore 11:45 elisha bere  
>>> ha scritto:
>>>
>>>> Hie, 
>>>>
>>>> Is it possible to change from 2.7 to 3.x in my web2py app
>>>>
>>>> On 17 Feb 2019 20:57, "Jitun John"  wrote:
>>>>
>>>>> "It requires Python 2.6 (no more supported), Python 2.7 (stable) or 
>>>>> Python 3.5+ (*recommended for new projects*) already installed on 
>>>>> your system. 
>>>>> There are also *binary packages for Windows* and Mac OS X.* They 
>>>>> include the Python 2.7 interpreter* so you do not need to have it 
>>>>> pre-installed."
>>>>>
>>>>> Sorry for my ignorance, I am assuming "Python 2.7 interpreter" as 
>>>>> "python27.dll" and "pywintypes27.dll" files.
>>>>>
>>>>> I recently moved my app from 2.x to 3.x using PyCharm IDE and the app 
>>>>> works fine when using IDE on 3.7 python.
>>>>> But when I try to compile it to .exe (using .iss file + hstart.exe), I 
>>>>> cant use the existing web2py_win.zip file.
>>>>>
>>>>> Gives me " unsupported pickle protocol: 
>>>>> 3"
>>>>>
>>>>> As we are recommending new projects on 3.x, Is it possible for the 
>>>>> next version to have a 3.x interpreter ?
>>>>> or if we have a workaround, I am happy to try it.
>>>>>
>>>>> 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)
>>>>> --- 
>>

Re: [web2py] Web2py Windows edition with 3.x Interpreter

2019-04-25 Thread rāma
This is wonderful. And, something I would love to be adopted to the 
official repo.

Thanks for this!

On Sunday, 3 March 2019 19:24:38 UTC+8, Nico Zanferrari wrote:
>
> Good morning!
>
> I'm proud to say that I've succeeded in building the Windows 64 bit binary 
> with python 3.7.2 using pyinstaller !  Grab it from 
> https://github.com/nicozanf/web2py-pyinstaller 
>
> There are some little gothas, but it seems to work fine:
> - in the console I've got many errors like 
> 'ERROR:Rocket.Errors.Thread-2:Tried to send "500 Server Error" to client 
> but received socket error'. They disappear as soon as I've disabled IPv6 
> and rebooted. There are users that report also to fix similar problems by 
> adding the hostname on the hosts file
> - psycopg2 is placed in a folder by itself, instead than in the root folder
> - in the currently official binary build (with pyhton 2.7) there are also 
> two binaries: web2py_no_console.exe and web2py_on_gevent.exe. They don't 
> run correctly, and don't seem to be so important for me so I've decided to 
> skip their generation.
> - Macintosh compatibility is needed, but I cannot work on it
>
> Please, help with testing it! I'll make a PR on the official web2py 
> repository after some feedback.
>
> Cheers,
> Nico
>
> Il giorno mer 27 feb 2019 alle ore 12:03 Nico Zanferrari <
> nico...@gmail.com > ha scritto:
>
>> Hi,
>>
>> this is a big problem also from my point of view and I've already opened 
>> issue 
>> 2027  . However it's not 
>> so easy to achieve this goal, because you've to switch to 3.x + go 64 bit + 
>> change the *freezer* program (py2exe and bbfreeze do not work with 
>> python >= 3.5). I'm playing with pyinstaller, but I'm not promising 
>> anything. And also a binary Mac version is needed (I only have a Win box), 
>> plus testing everything.
>>
>> Cheers,
>> Nico 
>>
>> Il giorno mer 27 feb 2019 alle ore 11:45 elisha bere > > ha scritto:
>>
>>> Hie, 
>>>
>>> Is it possible to change from 2.7 to 3.x in my web2py app
>>>
>>> On 17 Feb 2019 20:57, "Jitun John" > 
>>> wrote:
>>>
 "It requires Python 2.6 (no more supported), Python 2.7 (stable) or 
 Python 3.5+ (*recommended for new projects*) already installed on your 
 system. 
 There are also *binary packages for Windows* and Mac OS X.* They 
 include the Python 2.7 interpreter* so you do not need to have it 
 pre-installed."

 Sorry for my ignorance, I am assuming "Python 2.7 interpreter" as 
 "python27.dll" and "pywintypes27.dll" files.

 I recently moved my app from 2.x to 3.x using PyCharm IDE and the app 
 works fine when using IDE on 3.7 python.
 But when I try to compile it to .exe (using .iss file + hstart.exe), I 
 cant use the existing web2py_win.zip file.

 Gives me " unsupported pickle protocol: 3"

 As we are recommending new projects on 3.x, Is it possible for the next 
 version to have a 3.x interpreter ?
 or if we have a workaround, I am happy to try it.

 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 .
 For more options, visit https://groups.google.com/d/optout.

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

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


[web2py] Protecting admin with a 404

2018-08-06 Thread rāma
Hi web2py community,

I am thinking of protecting my admin area with a secret var.

I tried to put

if request.controller == 'admin':
reponse.flash = request['vars']
#raise HTTP(404, "page looking for does not exist")

But I can't seem to get a proper response. I even tried inspecting the 
appadmin.

Any idea how to insert a secret key on your admin vars to show the password 
prompt if incorrect it should prompt a 404.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Multi language SEO fro web2py rewrite rules example please

2018-08-03 Thread rāma
Arghh ... I have not been reading the book properly. Thanks for this.

I would just like to use the subdomain method. However, how would you do it 
for country? I don't think we have default_country.

On Wednesday, 1 August 2018 22:43:31 UTC+8, Anthony wrote:
>
> On Tuesday, July 31, 2018 at 11:36:53 PM UTC-4, rāma wrote:
>>
>>
>> Based on recommendations of a muli-lingual site here: 
>> https://stackoverflow.com/a/16624252 
>> <https://www.google.com/url?q=https%3A%2F%2Fstackoverflow.com%2Fa%2F16624252&sa=D&sntz=1&usg=AFQjCNHSCMigSBQASFloGqmaR450yl_6QQ>
>>
>
> There are multiple recommendations there -- which are you looking to 
> support?
>
> Anyway, if using the parameter-based rewrite system, web2py supports 
> adding the language as the first element of the URL path (i.e., the 
> "sub-directories" recommendation from the above link), as explained here: 
> http://web2py.com/books/default/chapter/29/04/the-core#Parameter-based-system
> .
>
> Anthony
>

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


[web2py] Multi language SEO fro web2py rewrite rules example please

2018-07-31 Thread rāma

Based on recommendations of a muli-lingual site here: 
https://stackoverflow.com/a/16624252

Does anyone have it implemented in web2py?

Appreciate if you have existing URL rewrites for me to try out.

Thanks!

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


[web2py] Re: SQLFORM widget IS_IN_SET translation

2018-07-31 Thread rāma
Thank you!

On Wednesday, 25 July 2018 19:58:48 UTC+8, Anthony wrote:
>
> You can specify labels associated with the values of an IS_IN_SET 
> validator in one of three ways:
>
> values = ['list', 'of', 'values']
>
> # As a dictionary in {value: label, ...} form:
> IS_IN_SET({value: T(value) for value in values})
>
> # As a list of tuples in (value, label) form:
> IS_IN_SET([(value, T(value)) for value in values])
>
> # Using the "labels" argument.
> IS_IN_SET(values, labels=[T(value) for value in values])
>
> Anthony
>
> On Wednesday, July 25, 2018 at 12:40:12 AM UTC-4, rāma wrote:
>>
>>
>> I could do this in SQLFORM readonly mode:
>>
>> https://groups.google.com/forum/#!topic/web2py/KnEaFsRRHL4
>>
>> However, how do you make SQLFORM to show the translations in edit mode. 
>> Do you have to modify the widget? How?
>>
>> Thank you.
>>
>

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


[web2py] Re: info: represent when IS_IN_SET multiple is set to True

2018-07-25 Thread rāma
Obsoleted by Anthony's answer: 
https://groups.google.com/d/msg/web2py/pY36w84ovgQ/lA5vepMRBgAJ

On Wednesday, 25 July 2018 12:29:32 UTC+8, rāma wrote:
>
> Just to share with everyone for a record here. Tried searching and 
> couldn't find anything easily.
>
> If you're using the T function for translations and you need to represent 
> an IS_IN_SET value using represent, here is the way to do it:
>
> represent = lambda f, r: ', '.join(str(T(i)) for i in r.field_name))
>
> This happened to work for me.
>
> Cheers,
> rāma
>

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


[web2py] SQLFORM widget IS_IN_SET translation

2018-07-24 Thread rāma

I could do this in SQLFORM readonly mode:

https://groups.google.com/forum/#!topic/web2py/KnEaFsRRHL4

However, how do you make SQLFORM to show the translations in edit mode. Do 
you have to modify the widget? How?

Thank you.

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


[web2py] info: represent when IS_IN_SET multiple is set to True

2018-07-24 Thread rāma
Just to share with everyone for a record here. Tried searching and couldn't 
find anything easily.

If you're using the T function for translations and you need to represent 
an IS_IN_SET value using represent, here is the way to do it:

represent= lambda f, r: [T(i.languages) for i in r])

This happened to work for me.

Cheers,
rāma

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: wrapping long text lengths in grid/smartgrid

2017-07-23 Thread rāma
Still no solution?

On Wednesday, 5 October 2011 19:37:39 UTC+8, Anthony wrote:
>
> I think if you specify a much longer maxtextlength, the text will 
> ultimately wrap, but it may cause the column to be much wider than you 
> want. Maybe all the th's and td's should include column-specific classes so 
> we can use CSS to control the width and other attributes of each column.
>
> Anthony
>
> On Wednesday, October 5, 2011 2:26:49 AM UTC-4, spyker wrote:
>>
>> On 3 October 2011 20:02, Massimo Di Pierro  wrote:
>>
>>> maxtextlengths={'tablename.fieldname':20},  # per field
>>> maxtextlength=20,  # default
>>>
>>>
>> It would be nice to have a possibility to wrap text in a column.
>>
>> Regards
>> Johann
>> -- 
>>  May grace and peace be yours in abundance through the full knowledge of 
>> God and of Jesus our Lord!  His divine power has given us everything we 
>> need for life and godliness through the full knowledge of the one who 
>> called us by his own glory and excellence. 
>> 2 Pet. 1:2b,3a
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] JWT refresh not working as expected?

2016-06-23 Thread rāma
Hi,
I followed the instruction:

 3) Use it!
Now API users can obtain a token with

http://.../app/default/user/jwt?username=...&password=

(returns json object with a token attribute)
API users can refresh an existing token with

http://.../app/default/user/jwt?token=...


Everytime I try to refresh the retrieved token (via 
http://.../app/default/user/jwt?token=), I get the error "token is 
expired". Besides that, the issued token can't seemed to be used to 
authenticate at all (json response is to redirect).

I changed the expiration parameter to a large number in models and later 
removed it, could it be that? I also had switched authenticating with 
username/email. I thought I had JWT working earlier today.

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


[web2py] Re: Is creating a token-based auth and still using auth and session globals possible?

2016-06-19 Thread rāma
Has there been updates on this. I am working on using web2py as a backend 
for my mobile app. Where there are no privileged cookies to track, is 
Niphlod's solution the best so far Dave Lypka suggested a few modification 
to the source, which I am not comfortable doing unless really necessary.

On Tuesday, 15 September 2015 09:19:30 UTC+8, Massimo Di Pierro wrote:
>
> This reminds me. Niphlod's code should go into web2py soon.
>
> On Monday, 14 September 2015 13:26:00 UTC-5, Dave S wrote:
>>
>>
>>
>> On Saturday, September 12, 2015 at 5:02:28 PM UTC-7, Darko Colic wrote:
>>>
>>> Hello,
>>> I'm trying to use web2py to build a JSON based API (not REST though) for 
>>> a mobile and single-page-application client.
>>>
>>> I wonder if there is a simple way to use Web2py internals like auth and 
>>> session global object for such a case?
>>>
>>> For example, in regular web-based app web2py "magically" restore a user 
>>> and a session using cookies. In API environment it is not possible. Would 
>>> it be possible instead to generate a token upon a login and then associate 
>>> auth and session objects with that token. Then on every API function that 
>>> requires login perform a decoration function to look up a token that client 
>>> sends and restore auth and session objects associated with it, and later 
>>> use it in the function as we would in a normal web-based app. Is there a 
>>> way to do that?
>>>
>>>
>>>
>>
>> Niphlod has a token package (in "alpha" testing, I think) that implements 
>> JWT for Web2Py.  I don't know if that would do what you want, but it should 
>> do most of it.
>>
>> From his post on the developer's list, here's his quick sample:
>>
>> As per "original" demand of covering one-time-issued tokens, the "jti" 
>>> claim is the standard, and can be easily implemented, imagining to store 
>>> valid tokens in a database table:
>>>
>>> db.define_table('jwt_tokens', Field('token'), Field('user_id'), Field(
>>> 'inserted_on', 'datetime', default=request.now))
>>>
>>> def myadditional_payload(payload):
>>>  res = db(db.jwt_tokens.user_id == payload['user']['id']).select(
>>> orderby=~db.jwt_tokens.inserted_on).first()
>>>  payload['jti'] = res.token
>>>  return payload
>>>
>>> def mybefore_authorization(tokend):
>>>  res = db(
>>> (db.jwt_tokens.user_id == tokend['user']['id']) & 
>>> (db.jwt_tokens.token == tokend['jti'])
>>>  ).select().first()
>>>  if not res:
>>>  raise HTTP(400, u'Invalid JWT jti claim')
>>>
>>> myjwt = Web2pyJwt('secret', auth, 
>>>   additional_payload=additional_payload, 
>>>   before_authorization=mybefore_authorization)
>>>
>>
>> > https://groups.google.com/d/msg/web2py-developers/dXfUrHNI5Sg/gqNa3kXsCQAJ> 
>>
>>
>>
>> Look for reports on testing of the package soon.
>>
>> /dps
>>
>>

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


[web2py] Re: project hire

2015-05-27 Thread rāma
Looking for something like this too

On Sunday, 15 March 2015 22:34:06 UTC+8, pumplerod wrote:
>
> The web2py support page lists experts4solutions as a group to inquire 
> about consulting or development, however, their home page has no method of 
> contact?  My coding chops are really just good enough to get me into 
> trouble and I'm interested in hiring someone that could create at least 
> some of the underlying components for the web application I'm trying to 
> build. 
>
> Primarily, I'm looking for OrientDB integration into web2py's DAL which 
> I'm more than happy to contribute back into the community.  Depending on 
> cost I'm sure there are many other components I could use help with.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] autoroutes not working as expected on subdomain

2013-03-27 Thread rāma
Hi everyone,

Long since I last posted. I just came across autoroutes script and after 
adding my domain and subdomain in the config, it does not seem to be 
routing to the app. However, only the first route works.

I need test.domain.co -> /myapp/

Is this expected or autoroutes are only designed for multiple domains.

-- 

--- 
You received this message because you are subscribed to the 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/groups/opt_out.




[web2py] Re: tab separated csv file

2013-01-07 Thread rāma
I think the import button should have a delimiter field makes things easier.

On Thursday, 12 March 2009 00:08:27 UTC+8, mdipierro wrote:
>
> There is no configuration parameter to do so. You mat create your own 
> csv serializer. look into the python csv module. 
>
> On Mar 11, 10:01 am, Marco Prosperi  
> wrote: 
> > hello everybody, 
> > how can I change the following function (defined in appadmin.py 
> > controller) so that the downloaded file has tab separated values 
> > instead of comma separated? Or do I have to change some settings 
> > somewhere? 
> > 
> > thanks in advance, 
> > Marco 
> > 
> > def csv(): 
> > import gluon.contenttype 
> > response.headers['Content-Type'] = \ 
> > gluon.contenttype.contenttype('.csv') 
> > db = get_database(request) 
> > query = get_query(request) 
> > if not query: 
> > return None 
> > response.headers['Content-disposition'] = \ 
> > 'attachment; filename=%s_%s.csv'\ 
> >  % tuple(request.vars.query.split('.')[:2]) 
> > return str(db(query).select())

-- 





[web2py] Re: impersonate any user

2011-05-12 Thread rāma
Has this been fixed?

[web2py] Re: query question

2011-05-05 Thread rāma
the loop is wrong. The below will be it.

list=[]

for row in query:

list.append([row.things.title, row.photos_things.photo_id.image])



[web2py] Re: query question

2011-05-05 Thread rāma
I think this should be it:

query=db((db.things.id>0)&(db.photos_things.id==db.photos_things.thing_id)).select()

for row in query:

list = [row.things.title, row.photos_things.photo_id.image]



[web2py] counting the contains in joins

2011-04-26 Thread rāma
Dear all,

We certainly can do this

count = db.person.field.count()
for row in db(db.person.field==db.dog.owner).select(db.person.name, count, 
groupby=db.person.field):
print row.person.name, row[count]

but what if we have a person.field of type list:string. I know the field has 
a 'contains' method but how to attach the count method following after that?

Thank you

Rama


[web2py] web2py on recent updates feels slow

2011-02-28 Thread rāma
I updated web2py from 1.91XX to 1.92XX felt the speed improved a
little which was previously worse. but now facing the same issue. This
speed I'm talking about is when editing the app using the admin which
also recently started affecting page load while loading the backend (a
noticeable lag 1~2 sec on visiting the 'edit' page of my large app).

Probably it's just me or my windows box. Anyone here experiencing the
same?

Platform: WindowsXPstarted affecting

Regards,
Rama


[web2py] SQLFORM factory field name problem

2011-02-28 Thread rāma
SQLFORM factory field name with underscore doesn't submit properly in
the below case:

SQLFORM.factory(Field('fieldname', - Submit OK

SQLFORM.factory(Field('select_fieldname', - Submit failed got a
None returned I think.

just to add: form catches the session as well.

Regards,
Rama


[web2py] SQLFORM factory field name problem

2011-02-28 Thread rāma
SQLFORM factory field with underscore in them doesn't seem to submit
properly for the below case:


[web2py] weird slash problem

2011-02-07 Thread rāma
Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 188, in restricted
exec ccode in environment
  File "C:\web2py\applications\beta/views\default/user.html", line
136, in 
TypeError: 'str' object does not support item assignment

Posting this because it started affecting my appplication functions as
well. More info: Some of my view's "edit controller" link has this
weird slashing problem thus the error in "invalid request" appears.

Platform: Windows.


[web2py] Querying fields with a list record

2011-01-30 Thread rāma
Can't do this anymore in the newer version. Any substitutes?

both fields has requires=IS_IN_SET with multiple=True

{{=A('('+str(db((~db.pm.deleted_by.contains(user_id))&(~db.pm.read_by.contains(user_id))).count())
+')',_href='#',_class='mail')}}

Searched around and found that it can be done this way:
 db.pm.like("%|"+str(user_id)+"|%") to look for the pipe char '|' and
the sandwiched number.

So maybe the above is not the conventional way of doing it but if the
former is any faster, I would like to hear a solution. Please comment.


[web2py] Datepicker to UTC time

2011-01-05 Thread rāma
Does/Can web2py store tzinfo in the datetime by the datepicker so that
we can do time conversion easily to server time or UTC time. Time
conversion was hell for me for the past two days.

How is this issue typically approached?

For my case, it has to be accurate as tasks are scheduled client side
so that it is accurately executed as per server time in UTC (on GAE
actually). Atm, I'm using a timedelta offest hack based on my client's
fixed timezone. Weirdly I have to provide a minus 20 minutes on top of
the +8 hours to approximately synchronise to the server time.

I know, its bad and its a hack.


[web2py] Re: syntax checker won't let me save this

2010-12-23 Thread rāma
Simple mistake. Sorry!

On Dec 23, 2:05 pm, rāma  wrote:
> I tried to construct a validator:
>
> db.sender.keywords.requires = IS_IN_DB(db( db.auth_user.id=user_id ),
> db.userkeywords.keyword)
>
> I was able to do this in previous versions.
>
> Please help.


[web2py] syntax checker won't let me save this

2010-12-22 Thread rāma
I tried to construct a validator:

db.sender.keywords.requires = IS_IN_DB(db( db.auth_user.id=user_id ),
db.userkeywords.keyword)

I was able to do this in previous versions.

Please help.


[web2py] Re: insert records using dictionary

2010-12-20 Thread rāma
Cool!! Thanks

On Dec 20, 11:23 pm, mdipierro  wrote:
> db.table.insert(**dictionary)
>
> On Dec 20, 9:19 am, rāma  wrote:
>
>
>
> > Hi all,
>
> > I'm aware that you can bulk insert using a dictionary but is there a
> > way to :
> > dictionary={'field1':'value','field2':'value' ...}
> > db.table.insert(dictionary)
>
> > It would be really easy if I can do this.


[web2py] insert records using dictionary

2010-12-20 Thread rāma
Hi all,

I'm aware that you can bulk insert using a dictionary but is there a
way to :
dictionary={'field1':'value','field2':'value' ...}
db.table.insert(dictionary)

It would be really easy if I can do this.


[web2py] Re: how to read headers

2010-12-19 Thread rāma
Thanks a bunch! Its working

On Dec 20, 2:32 pm, mdipierro  wrote:
> they are in request.env
>
> so header called blablabla would be in request.env.http_blablabla
>
> On Dec 20, 12:09 am, rāma  wrote:
>
>
>
> > This is rather daunting. An sms gateway put their variables in their
> > header rather than urlencode it. I am not sure how to get my app to
> > fetch the header variables from the request sent by the server.
>
> > I tried mimicking using urllib2 by sending headers to my app. But,
> > request.headers always return None.
>
> > Please help.


[web2py] how to read headers

2010-12-19 Thread rāma
This is rather daunting. An sms gateway put their variables in their
header rather than urlencode it. I am not sure how to get my app to
fetch the header variables from the request sent by the server.

I tried mimicking using urllib2 by sending headers to my app. But,
request.headers always return None.

Please help.


[web2py] A quick Q on blocked urls by auth

2010-11-13 Thread rāma
How do you get the initial url which initiated the redirect to a login
screen. I need to build a dictionary for custom login errors based on
these urls. Can this information be accessed from the login view?


[web2py] Re: Learning Management System survey

2010-11-10 Thread rāma
Interesting thread glad I found it by searching the group because this
is what I am doing currently. However, the LMS is designed to be a
prototype trial though. I will be testing the beta LMS with a bunch of
students next week. I will be interested to help too in this project.

On Nov 8, 2:45 pm, mdipierro  wrote:
> At my school we have two systems:
>
> 1) peoplesoft (PS) which we use to manage accounting and class
> enrollments
> 2) the learning management system (LMS)
>
> The LMS gets enrollments from PS.
>
> This is because enrollments must be tied to accounting. There are
> rules on how students are billed, drop dates with full refunds, drop
> dates with partial refund, etc.
>
> Cloudcourse seems to do well that part that we now handle with PS but
> it is not an LMS and it not integrated with any accounting software.
>
> Enrollments must also have full revision history and I do not think
> cloudcourse does that. If a student changes its status, it must be
> possible to see what was its status at any moment in time.
>
> Massimo
>
> On Nov 8, 12:18 am, noel  wrote:
>
>
>
> > what do you think about google cloudcourse?
>
> > On Nov 5, 9:09 pm, Tom Atkins  wrote:
>
> > > I can volunteer time and input for the LMS idea.  I'm not experienced 
> > > enough
> > > with Python and web2py yet to contribute good code but can help with
> > > frontend UI, design, jQuery and documentation.
>
> > > Assuming the project would have a Free license?
>
> > > I'd be happy to register, host, set up and manage a dedicated site for the
> > > project.  The site could reference a bitbucket Hg repository (issue 
> > > tracking
> > > there), have a demo, download links (including plugins and themes), a 
> > > forum
> > > for users and developers (I'd be happy to moderate), documentation etc.
>
> > > In daydreaming time I have spent many hours trying to come up with a name
> > > for such a system. Because there is already 'desire2learn' in the market
> > > it's probably not good to use the '2' in the middle again like web2py. I 
> > > am
> > > fully behind Massimo's focus on the user.  As such the universally 
> > > accepted
> > > term 'Learning Management System' 
> > > (seehttp://en.wikipedia.org/wiki/Learning_management_system) is very 
> > > appropriate
> > > - so how about calling it 'elemes'? get it?!
>
> > > 'elemes.com' and 'elemes.org' are available.  I'd be happy to buy these 
> > > and
> > > provide hosting for a site for the project if people think this might be a
> > > good name? (You could change it later - but it'd get us started with a 
> > > place
> > > to discuss requirements, design criteria and goals away from the web2py
> > > list.)
>
> > > Thoughts?
>
> > > On 3 November 2010 22:35, mdipierro  wrote:
>
> > > > We need to assemble a team.


[web2py] crud create double submission

2010-08-10 Thread rāma
I think I have a double submission problem on crud create. I am using
a redirect in the view instead of the next attribute because I have to
evaluate certain variable conditions. Haven't tried in other
situations. I don't know if anyone can confirm this.


[web2py] Re: create native functions

2010-07-19 Thread rāma
Usually you create a function in the model so that it is available
throughout the view and and controllers.

On Jul 20, 1:57 am, Luis Díaz  wrote:
> how I can create your own functions, style MENU () or URL ()?
>
> I want to call them from any (controllers, view) without import
> with local_import
>
> as they like web2py native code
>
> --
> Díaz Luis
> TSU Analisis de Sistemas
> Universidad de Carabobo


[web2py] Re: Optional form field and its validation

2010-07-19 Thread rāma
Thank you for the blazing fast response.

I didn't find that in the book hope its noted somewhere to be added
later.

Rāma

On Jul 20, 1:33 am, mdipierro  wrote:
> IS_EMPTY_OR(IS_EMAIL())
>
> On Jul 19, 12:23 pm, rāma  wrote:
>
>
>
> > Hi,
>
> > How do I get the form to validate right.
> > I want to validate an email field ONLY IF it is filled in. IS_EMAIL()
> > doesn't meet my requirement as it enforces validation simply by
> > submitting.
>
> > IS_NOT_REQUIRED() validator? ;-)
>
> > Rāma


[web2py] Optional form field and its validation

2010-07-19 Thread rāma
Hi,

How do I get the form to validate right.
I want to validate an email field ONLY IF it is filled in. IS_EMAIL()
doesn't meet my requirement as it enforces validation simply by
submitting.

IS_NOT_REQUIRED() validator? ;-)

Rāma


[web2py] Re: inserting attributes into form.custom.begin

2010-07-06 Thread rāma
form['_class']='small'
Doesn't work with custom forms. :-(

On Jul 7, 1:07 am, "mr.freeze"  wrote:
> That doesn't work for me in the console. What am I doing wrong?:
>
> >>> form = SQLFORM(db.things)
> >>> form['_class'] = 'small'
> >>> form.custom.begin.xml()
>
> ''
>
> On Jul 6, 11:14 am, mdipierro  wrote:
>
>
>
> > form['_class']='small'
>
> > On 6 Lug, 09:33, rāma  wrote:
>
> > > How do I insert attributes ie _class="small" into a custom form tag.
> > > Should look like below at the end of the day.
> > > ' > > class="small">'
>
> > > I didn't find any attribute function in form.custom.begin to insert
> > > the above.


[web2py] inserting attributes into form.custom.begin

2010-07-06 Thread rāma
How do I insert attributes ie _class="small" into a custom form tag.
Should look like below at the end of the day.
''

I didn't find any attribute function in form.custom.begin to insert
the above.


[web2py] Working example of Google WebSearch AJAX API anyone

2010-05-02 Thread rāma
Hi,

Does anyone has a working example of the Google WebSearch AJAX API. I
need to count the returning hits for a particular keyword on
GoogleScholar.

Pls share.

If anyone has it in PHP etc do share. I will try to port it to web2py.


[web2py] Re: library app

2010-01-28 Thread rāma
oops i missed it out of excitement!

On Jan 29, 6:03 am, mdipierro  wrote:
> reddit is down. I repost a direct link:
>
> http://we2py.com/library
>
> It would be great if one of you adopts this code and turn it into a
> production system (perhaps linking amazon to automatically update book
> info from ISBN and making the interface more customizable).
>
> On Jan 28, 3:53 pm, mdipierro  wrote:
>
>
>
> > It is there. There is a download link at the top of the search page.
> > It requires web2py to open it.
>
> > On Jan 28, 3:45 pm, rāma  wrote:
>
> > > Have/Can you released the source? Would love to look at it.
>
> > > On Jan 29, 5:27 am, mdipierro  wrote:
>
> > > > Technically all models and controller is 168 lines of code (including
> > > > scaffolding code).
>
> > > > The default layout is 94 lines of html and the rest of views amount to
> > > > 72 lines total.
>
> > > > Massimo
>
> > > > On Jan 28, 3:08 pm, rāma  wrote:
>
> > > > > Wow that's an amazing site in 200 lines code !
>
> > > > > On Jan 29, 4:28 am, mdipierro  wrote:
>
> > > > > >http://www.reddit.com/r/Python/comments/av2r8/creating_school_library...

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: library app

2010-01-28 Thread rāma
Have/Can you released the source? Would love to look at it.

On Jan 29, 5:27 am, mdipierro  wrote:
> Technically all models and controller is 168 lines of code (including
> scaffolding code).
>
> The default layout is 94 lines of html and the rest of views amount to
> 72 lines total.
>
> Massimo
>
> On Jan 28, 3:08 pm, rāma  wrote:
>
>
>
> > Wow that's an amazing site in 200 lines code !
>
> > On Jan 29, 4:28 am, mdipierro  wrote:
>
> > >http://www.reddit.com/r/Python/comments/av2r8/creating_school_library...

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: library app

2010-01-28 Thread rāma
Wow that's an amazing site in 200 lines code !

On Jan 29, 4:28 am, mdipierro  wrote:
> http://www.reddit.com/r/Python/comments/av2r8/creating_school_library...

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.