Re: [web2py] Re: please help us test trunk web2py

2018-03-18 Thread Paolo Valleri
@nbush would you open an issue on https://github.com/web2py/web2py/issues.
It seems that languages files were wrongly updated into decoded messages.
see
https://github.com/web2py/web2py/commit/9263f8c4c3be7dd3ac0d1e9948c23b52f10db0d0#diff-59abf7aaebbac65b540eaebf36870ec6

 Paolo

2018-03-11 20:45 GMT+01:00 Nbush :

> @Paolo
> in apps welcome
> in models/db.py add
>
> T.force('ru')
>
> go admin db
>
> ../welcome/appadmin/select/db?query=db.auth_user.id>0
>
> oops
> Internal errorTicket issued: welcome/178.176.112.38.2018-03-11.19-36-21.
> 63a51c38-0dec-4c13-aa02-3bf882b632e5
> 
>
> If the browser language is English, everything works fine
>
>
> воскресенье, 11 марта 2018 г., 13:47:04 UTC+3 пользователь Paolo написал:
>
>> @nbush, could you post a code snippet to reproduce the error? Which
>> web2py version have you tested?
>>
>> On Wednesday, March 7, 2018 at 11:31:14 PM UTC+1, Nbush wrote:
>>>
>>> Pluralizaiton error. (test on python 2.7.13)
>>>
>>>  'ascii' codec can't decode byte
>>> 0xd0 in position 0: ordinal not in range(128)
>>> Function argument list
>>>
>>> (self=,
>>> message='%{!\xd0\xb2\xd1\x8b\xd0\xb1\xd1\x80\xd0\xb0\xd0\xbd\xd0\xb0[0]}
>>> 1 %{\xd0\xb7\xd0\xb0\xd0\xbf\xd0\xb8\xd1\x81\xd1\x8c[0]}', symbols=(1,))
>>> Code listing
>>>
>>> 929.
>>> 930.
>>> 931.
>>> 932.
>>> 933.
>>> 934.
>>>
>>> 935.
>>> 936.
>>> 937.
>>> 938.
>>>
>>> part = regex_plural_dict.sub(sub_dict, s)
>>> if part == s:
>>> return m.group(0)
>>> return part
>>> message = message % symbols
>>> message = regex_plural.sub(sub_plural, message)
>>>
>>> return message
>>>
>>> def translate(self, message, symbols):
>>> """
>>>
>>> Variables
>>> message '%{!\xd0\xb2\xd1\x8b\xd0\xb1\xd1\x80\xd0\xb0\xd0\xbd\xd0\xb0[0]}
>>> 1 %{\xd0\xb7\xd0\xb0\xd0\xbf\xd0\xb8\xd1\x81\xd1\x8c[0]}'
>>> global regex_plural <_sre.SRE_Pattern object>
>>> regex_plural.sub 
>>> sub_plural 
>>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/qN5RR-QuhbQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@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.


Re: [web2py] Re: 50x performance improvement for web2py in TechEmpower Web Framework Benchmarks

2017-12-05 Thread Paolo Valleri
Anthony, is it possible to add py3 to the tests suite (for both standard
and optimized apps) ?

 Paolo

2016-11-22 14:55 GMT+01:00 Mark Graves :

> That is truly strange.  Seems to be a distinct confound.
>
> Greatly appreciated work.
>
>
>
> On Tue, Nov 22, 2016 at 7:27 AM, Anthony  wrote:
>
>> On Tuesday, November 22, 2016 at 8:16:16 AM UTC-5, Mark Graves wrote:
>>>
>>> If I'm reading that correctly, doesn't that show web2py standard and
>>> optimized  top 3?
>>>
>>> Wouldn't that suggest a massive performance difference cloud vs
>>> baremetal?
>>>
>>
>> On all the tasks, all the frameworks do better on bare metal than on
>> Azure -- the only exception is web2py on the 20-update requests of the
>> "Data updates" task, and that appears to be due to some kind of errors
>> being generated, not a general cloud vs. bare metal performance difference.
>> Beyond that, I don't have much idea what was happening there.
>>
>> 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 a topic in the
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/web2py/I6wii5TFERY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> web2py+unsubscr...@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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/I6wii5TFERY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: web2py 2.15.0b1

2017-07-10 Thread Paolo Valleri
Massimo, regarding minification see 
https://github.com/web2py/web2py/pull/1658, hopefully it fixed the reported 
issue.

On Monday, July 10, 2017 at 10:28:44 AM UTC+2, Massimo Di Pierro wrote:
>
> Thanks for reporting these issues.
>
> I think except for minification they have all been resolved. and a new 
> beta version is released.
>
>
> On Thursday, 6 July 2017 22:37:02 UTC-5, 黄祥 wrote:
>>
>> the error traceback about routes in application is fixed with
>> *applications/test/routes.py*
>> from *gluon.*fileutils import abspath
>> from *gluon.*languages import read_possible_languages
>>
>> but the same problem is still exist, (no error occured but the result is 
>> not expected), what i expect is something like in book said 
>> http://127.0.0.1:8000/test/en/controller/function
>>
>> how i can achieve using web2py way?
>>
>> ref: 
>> http://web2py.com/books/default/chapter/29/04/the-core#Parameter-based-system
>>
>> thanks and best regards,
>> stifan
>>
>

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


Re: [web2py] db structure graphical analysis tool

2017-07-08 Thread Paolo Valleri
Hi Jurgis,
web2py master has recently switched from pygraphviz to a js based solution. 
I would suggest you to adapt your change with current master branch and 
then publish a PR for an integration.

Paolo

On Friday, July 7, 2017 at 3:35:35 PM UTC+2, Ramos wrote:
>
> +1 good job
>
> 2017-07-07 12:19 GMT+01:00 Jurgis Pralgauskis  >:
>
>> Hi, 
>>
>> in our DB we have ~300 tables. So I hacked into graph_model to filter 
>>  shown tables/fields. 
>> It was very helpfull for me when I joined the project with so many tables.
>> The most common use case -- searching for possible join-paths between two 
>> tables, but also can filter by (fragments of) tablenames.
>>
>> It shows SVG by default (less memory consumption than png), 
>> and tables are hyperlinked to their admin pages.
>>
>> Also made beta plugin 
>> 
>>  (the 
>> code is quite dirty and  not optimal, but does the job : ).  
>> src: controller 
>> ,
>>  
>> view 
>> 
>>  
>> screenshot 
>> 
>>
>> Would be glad if someone finds it usefull :)
>> ps.: what is the best way to distribute it? http://www.web2pyslices.com/ 
>> seems to be frozen for 1 year..
>>
>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


[web2py] Re: web2py 2.15.0b1

2017-07-06 Thread Paolo Valleri
Hi Stifan,
regarding _before_insert open an issue on https://github.com/web2py/pydal 
with the example you posted
for the other issues, open an issue on https://github.com/web2py/web2py

Paolo

On Thursday, July 6, 2017 at 2:20:25 AM UTC+2, 黄祥 wrote:
>
> tried to build from scratch with minimal code for test before insert 
> callback problem :
> *1. create new web2py app*
> *2. models/db_test.py*
> def before_insert_test(f):
> f['field1'] = 'field1'
>
> db.define_table('table0', 
> Field('field0', notnull = True, required = True), 
> Field('field1', notnull = True, required = True) )
>
> db.table0._before_insert.append(before_insert_test)
>
> *3. controllers/install.py*
> def index():
> db.table0.insert(field0 = 'field0')
>
> *4. error result*
> Traceback (most recent call last):
>   File "/Users/MacBookPro/site/web2py/gluon/restricted.py", line 219, in 
> restricted
> exec(ccode, environment)
>   File 
> "/Users/MacBookPro/site/web2py/applications/test/controllers/install.py", 
> line 6, in 
>   File "/Users/MacBookPro/site/web2py/gluon/globals.py", line 406, in 
> 
> self._caller = lambda f: f()
>   File 
> "/Users/MacBookPro/site/web2py/applications/test/controllers/install.py", 
> line 4, in index
> db.table0.insert(field0 = 'field0')
>   File 
> "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/objects.py", line 
> 731, in insert
> row = self._fields_and_values_for_insert(fields)
>   File 
> "/Users/MacBookPro/site/web2py/gluon/packages/dal/pydal/objects.py", line 
> 709, in _fields_and_values_for_insert
> 'Table: missing required field: %s' % name)
> RuntimeError: Table: missing required field: field1
>
> *5. temporary solution*
> i know there are 2 temporary solutions for this:
> 1. remove notnull=True and required=True
> 2. set the value for required value, e.g. field1 during insert
>
> *6. question*
> the same code work in previous stable version (2.14.6-stable), is it a 
> problem or normal in web2py latest version?
>
> thanks and best regards,
> stifan
>

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


Re: [web2py] Re: [REMEMBER_ME] Not working

2017-05-05 Thread Paolo Valleri
I've just tried welcome app with current master branch and 'remember me'
worked well. Would you test it as well?

 Paolo

2017-05-05 11:32 GMT+02:00 <sunda.am...@gmail.com>:

> Please help me
>
>
> Le mercredi 3 mai 2017 17:14:10 UTC+2, Paolo Valleri a écrit :
>>
>> which web2py version are you using?
>> would you post the html of the 'remember me' input tag
>>
>> Paolo
>>
>> On Wednesday, May 3, 2017 at 10:31:23 AM UTC+2, sunda...@gmail.com wrote:
>>>
>>> Hello Anthony,
>>>
>>> Yeah but even if i took it off, it doesnt work at all ... or even when i
>>> wrote 3600*24*30 ...
>>>
>>>
>>>
>>>
>>> Le mardi 2 mai 2017 18:37:28 UTC+2, Anthony a écrit :
>>>>
>>>> On Tuesday, May 2, 2017 at 12:29:19 PM UTC-4, sunda...@gmail.com wrote:
>>>>>
>>>>> Hello,
>>>>> This is actually my first question ever in a forum, and i hope it will
>>>>> be helpull. I am working in a company and the framework which i am using 
>>>>> is
>>>>> web2py.
>>>>> The "Remember me" is absolutly not working. i put that in my db.py :
>>>>>
>>>>> auth.settings.long_expiration = 3600
>>>>>
>>>>
>>>> You have the long_expiration set to the same default time as the
>>>> standard expiration (one hour), so you won't notice any different behavior.
>>>>
>>>> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/to
> pic/web2py/Z30XLTQzYi0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: [REMEMBER_ME] Not working

2017-05-03 Thread Paolo Valleri
which web2py version are you using?
would you post the html of the 'remember me' input tag

Paolo

On Wednesday, May 3, 2017 at 10:31:23 AM UTC+2, sunda...@gmail.com wrote:
>
> Hello Anthony,
>
> Yeah but even if i took it off, it doesnt work at all ... or even when i 
> wrote 3600*24*30 ...
>
>
>
>
> Le mardi 2 mai 2017 18:37:28 UTC+2, Anthony a écrit :
>>
>> On Tuesday, May 2, 2017 at 12:29:19 PM UTC-4, sunda...@gmail.com wrote:
>>>
>>> Hello, 
>>> This is actually my first question ever in a forum, and i hope it will 
>>> be helpull. I am working in a company and the framework which i am using is 
>>> web2py. 
>>> The "Remember me" is absolutly not working. i put that in my db.py : 
>>>
>>> auth.settings.long_expiration = 3600
>>>
>>
>> You have the long_expiration set to the same default time as the standard 
>> expiration (one hour), so you won't notice any different behavior.
>>
>> Anthony
>>
>

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


[web2py] Re: update_or_insert only returns id if created not updated

2017-04-19 Thread Paolo Valleri
Actually I don't know if pydal is supposed to be backward compatible.

On Wednesday, April 19, 2017 at 1:04:45 AM UTC+2, Anthony wrote:
>
> On Tuesday, April 18, 2017 at 3:33:31 PM UTC-4, Paolo Valleri wrote:
>>
>> It should work. Try to open an issue on https://github.com/web2py/pydal 
>> or a pull request with the necessary change
>> it could be something like, 
>>
>>  new_id = record[self._id.name]
>>
>
> We can't do that, as it would break backward compatibility. I suppose you 
> could add an option or create an alternative method.
>
> Anthony
>  
>

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


[web2py] Re: update_or_insert only returns id if created not updated

2017-04-18 Thread Paolo Valleri
It should work. Try to open an issue on https://github.com/web2py/pydal or 
a pull request with the necessary change
it could be something like, 

 new_id = record[self._id.name]

Paolo

On Tuesday, April 18, 2017 at 12:58:22 PM UTC+2, Ramos wrote:
>
> why?
>
> https://github.com/web2py/pydal/blob/4b30558e7d75da152ac6a003991e9add1b68c235/pydal/objects.py#L795
>
> I could and need to use the id in case of update...
>
>
> 
>  Sem 
> vírus. www.avast.com 
> 
>  
> <#CAEM0BxPk8LJQyTpKvT5vkn4FBchbB1cMx=YGN=iwjW7Aw2cG4w@mail.gmail.com_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: delete record confirmation dialog

2017-04-18 Thread Paolo Valleri
At the moment is not possible to change it directly in grid or smartgrid.
This is because the javascript variable is fixed, assigned 
in 
https://github.com/web2py/web2py/blob/master/applications/welcome/views/web2py_ajax.html
and then used 
in 
https://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L186

Depending on your use case you can either translate the sentence defined in 
web2py_ajax.html or add your custom logic in order to change the content of 
the w2p_ajax_confirm_message javascript variable.

Paolo

On Tuesday, April 18, 2017 at 6:00:21 PM UTC+2, Andrea Fae' wrote:
>
> How to change customized message in the confirmation dialog about delete a 
> record using grid or smartgrid? (depending on the situation)
> Any examples?
>
>
>

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

2017-04-12 Thread Paolo Valleri
you have to clone your fork, which I guess is
https://github.com/sugizo/web2py
then follow the same steps, at the end, from the github website create a PR.
Mind that your fork (https://github.com/sugizo/web2py) is really out of
date, update it before everything else.

 Paolo

2017-04-12 12:40 GMT+02:00 黄祥 :

> tried to pull request on git, result not expected, here is the step i took
> :
> *# fork web2py*
> cd ~/Git/
> git clone --recursive https://github.com/web2py/web2py.git
> cd web2py/
> git submodule update --init --recursive
>
> *# Create the branch on your local machine*
> git checkout -b fix_memcache_appadmin
>
> *# Change working branch*
> git checkout fix_memcache_appadmin
>
> *# add the code in gluon/contrib/memcache/__init__.py*
> class MemcacheClientObj(Client):
> def initialize(self):
> pass
>
> *# commit in branch*
> git push origin fix_memcache_appadmin
>
> *# result git push origin*
> Username for 'https://github.com': sugizo
> Password for 'https://sug...@github.com':
> remote: Permission to web2py/web2py.git denied to sugizo.
> fatal: unable to access 'https://github.com/web2py/web2py.git/': The
> requested URL returned error: 403
>
> i can login and access https://github.com/sugizo/web2py
> i never use git before, any hints?
>
> thanks and best regards,
> stifan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/ycOvyOBPCMQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@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.


Re: [web2py] Re: use memcache

2017-04-11 Thread Paolo Valleri
Regarding the PR, online there are many tips to help you, in short:
- fork web2py
- create a new branch (called for example: 'fix_memcache_appadmin')
- apply the change we discussed
- commit the change with a clear message
- push only the new branch
- on github, click Pull request and compare web2py/master with your branch




 Paolo

2017-04-12 2:28 GMT+02:00 黄祥 :

> *whole traceback :*
>
> Traceback (most recent call last):
>   File "/Users/MacBookPro/site/web2py/gluon/restricted.py", line 227, in 
> restricted
> exec ccode in environment
>   File "/Users/MacBookPro/site/web2py/applications/a/controllers/appadmin.py" 
> , line 
> 703, in 
>   File "/Users/MacBookPro/site/web2py/gluon/globals.py", line 417, in 
> self._caller = lambda f: f()
>   File "/Users/MacBookPro/site/web2py/applications/a/controllers/appadmin.py" 
> , line 
> 449, in ccache
> ram_stats = cache.ram.stats[request.application]
> KeyError: 'a'
>
>
> on above step, i created new web2py application named : a
>
> about a pr, how to do it? already create new pull but it ask about
> compare? already have git in my mac but never use it. any hints or pointer
> ref?
>
> thanks and best regards,
> stifan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/ycOvyOBPCMQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@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.


Re: [web2py] Re: use memcache

2017-04-11 Thread Paolo Valleri
Glad the change fixed the first issue, would you submit a PR
https://github.com/web2py/web2py/pulls?
Regarding the second error, post the whole traceback here


 Paolo

2017-04-11 0:11 GMT+02:00 黄祥 :

> *change gluon/contrib/memcache/__init__.py*
> class MemcacheClientObj(Client):
> def initialize(self):
> pass
>
> *start web2py*
> python ~/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000
>
> *create new webapp and add code on top of models/db.py*
> from gluon.contrib.memcache import MemcacheClient
> memcache_servers = ['127.0.0.1:11211']
> cache.memcache = MemcacheClient(request, memcache_servers)
> cache.ram = cache.disk = cache.memcache
>
> *error traceback*
> ram_stats = cache.ram.stats[request.application]
> KeyError: 'a'
>
> error traceback is different from first posted
>
> thanks and best regards,
> stifan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/ycOvyOBPCMQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@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.


Re: [web2py] Re: use memcache

2017-04-10 Thread Paolo Valleri
Have you restarted web2py after the change?

 Paolo

2017-04-10 0:02 GMT+02:00 黄祥 :

> after adding the code, still got the same error : AttributeError:
> 'MemcacheClientObj' object has no attribute 'initialize'
> *e.g.*
> class MemcacheClientObj(Client):
> def initialize(self):
> pass
>
> btw the problem is fixed when not assigned it into cache.ram and cache.disk
> *e.g.*
> #cache.ram = cache.disk = cache.memcache
>
> the same problem occured when using redis too
> *e.g. problem accessing ccache using redis*
> cache.ram = cache.disk = cache.redis
>
> for problem used by another server fixed by allowing the bind host to
> another machine and allow memcache port in firewall (memcache configuration
> on server)
> *e.g.*
> bind 0.0.0.0
>
> for clear memcache clear by restarting the memcache service, flush_all it
> can't do it.
>
> thanks and best regards,
> stifan
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/ycOvyOBPCMQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: use memcache

2017-04-09 Thread Paolo Valleri
Regarding the first problem you posted.
Try adding:

def initialize(self):
pass

in 
https://github.com/web2py/web2py/blob/master/gluon/contrib/memcache/__init__.py#L22

Let us know.
Paolo

On Friday, April 7, 2017 at 12:29:14 AM UTC+2, 黄祥 wrote:
>
> Tried to learn about memcache, create new web2py app from admin 
> *Situation 1 :*
> *models/db.py *
> ## memcache put on top of models/db.py
> # cache
> from gluon.contrib.memcache import MemcacheClient
> *memcache_servers = ['127.0.0.1:11211 ']*
> *#memcache_servers = ['192.168.0.99:11211 ']*
> cache.memcache = MemcacheClient(request, memcache_servers)
> cache.ram = cache.disk = cache.memcache
> # session
> from gluon.contrib.memdb import MEMDB
> session.connect(request, response, db = MEMDB(cache.memcache) ) 
>
> *Access :*
> https://server/a/appadmin/ccache
>
> *Error Traceback :*
> cache.ram.initialize()
> AttributeError: 'MemcacheClientObj' object has no attribute 'initialize'
>
> *Question 1 :*
> Is it normal or not about the traceback?
> *Question 2 :*
> Is it possible to use memcache on another machine? tried before but not 
> cached on another server, perhaps i missed something if it possible, any 
> hints?
>
> *Situation 2 :*
> *In terminal linux :*
> *# Display the current memory cache state*
> memcached-tool 127.0.0.1:11211 display
>
> *Result : *
>   #  Item_Size  Max_age   Pages   Count   Full?  Evicted Evict_Time OOM
>   8 480B40s   1   1 yes000
>
> *# Flush memcached*
> echo 'flush_all' | nc localhost 11211
>
> *Question :*
> Why after i flushed memcache, the web2py cache is still stored in 
> memcache? already tried to stop the web2py rocket server too, but same 
> result, is it normal or not?
>
> *Situation 3 :*
> Modified already built web2py app to use memcache
> *Error Traceback :*
> format = lambda r: '%s - %s - %s' % (r.name, r.supplier.name, 
> r.classification) )
> AttributeError: 'long' object has no attribute 'name'
>
> *solution 1 : *
> clean from web2py admin page, relogin, access the error page, the error 
> gone
> *solution 2 : *
> modified the code into 
> format = lambda r: '%s - %s' % (r.supplier.name, r.classification) )
>
> *Question :*
> why the same code is running well without using memcache?
>
> Thanks and Best Regards,
> stifan
>

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


Re: [web2py] Re: web2py and python3

2017-04-03 Thread Paolo Valleri
The best is to test your apps with python3 and report any issues.
After a test period, I agree regarding pushing a new release

 Paolo

2017-04-03 16:46 GMT+02:00 Richard Vézina :

> Glad to hear that Leonel...
>
> But could we have "official" wrapup of the progress so far and where we
> heading to. Are we waiting m2crypto to become py3 compatible to release a
> new web2py version?
>
> I am sure we could benefit from a new web2py version if the master is not
> broken because of that (py3 compatibility) as we can still benefit from the
> improvement and bugs fixes that occur while keep using web2py with python
> 2.7
>
> I am not saying that we should rush out a new release though as after had
> waiting that long we surely can wait another 1-2 months and get py3
> compliant version and 2.14.6 is reliable version.
>
> But, having a new version would help strengthen the code base, so there
> will be less problem to figure out when py3 release will be ready, don't
> you think? We will focus on py3 issue more easily then...
>
> Also, new version would help keep confidence that web2py is hear to stay...
>
> Thanks
>
> Richard
>
>
>
> On Mon, Apr 3, 2017 at 7:53 AM, Leonel Câmara 
> wrote:
>
>> Alex pretty much the only thing missing for py3 support is for m2crypto
>> which web2py depends on for X509 stuff to support python 3, according to
>> their repository 
>> they're
>> really close to finishing py3 support. So I would say we're almost there.
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the 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.
>>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/UKcWKU66qnA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


[web2py] Re: inner join taking too long

2017-03-26 Thread Paolo Valleri
you should check where is the bottleneck, I see three places:
- select: try to print the select statement (call _select, see 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Generating-raw-sql)
 
and check it on sqlite.
- as_list, split it from the select 
- simplejson
Adding few print statements will give you some light.

Mind that gluon.contrib.simplejson  is no longer necessary 
(https://github.com/web2py/web2py/blob/master/gluon/contrib/simplejson.py), 
import json instead.


Paolo 

On Monday, March 20, 2017 at 5:05:12 PM UTC+1, John Philip wrote:
>
> Hi there,
>
> I have two tables that I have queried using an inner join the query 
> outputs about 50,000 + records this is no problem on sqlite however it does 
> not seem to load on web2py. Is there something I am doing wrong?
>
>
> import json
> def get_dpc():
> rows = 
> db(db.plf.PLF_NAME==db.pcf.PCF_NAME).select(db.plf.PLF_NAME,db.pcf.PCF_DESCR).as_list()
> return dict(dpc_list=gluon.contrib.simplejson.dumps(rows))
>
>
>
> any help would be greatly appreciated.
>
> regards,
>
> John
>

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


Re: [web2py] Re: web2py and python3

2017-02-02 Thread Paolo Valleri
In the last months few patches have been accepted in the current master 
branch, as a result web2py core components can be tested on py3 too. Few 
features are missing see https://github.com/web2py/web2py/issues/1353.
Feel free to try and report/fix any new issue discovered.

Paolo

On Thursday, February 2, 2017 at 12:11:37 PM UTC+1, Muhammad Hashim Malik 
wrote:
>
> Its about eight months passed but no news about web3py. What's the latest 
> updated in this regard?
>
>
>
> On Wednesday, 25 May 2016 03:17:46 UTC+5, Dave S wrote:
>>
>>
>>
>> On Tuesday, May 24, 2016 at 1:42:35 PM UTC-7, Sayth Renshaw wrote:
>>>
>>> Of course though as Massimo cited all education institutions are 
>>> teaching Python 3 and have for a time meaning all the new developers are 
>>> starting there. If they write new code bases it will be 3, every dev deals 
>>> with legacy code but is that really the strongest position to take?
>>>
>>
>> There is a web3py in the works, although it will be experimental for the 
>> near future.. IIRC, pydal is already P3 compatible.  SQLFORM goes away in 
>> web3py, AIUI, and FORM will be better supported.  Switching from Bootstrap 
>> to other view-ish frameworks should be easier.
>>
>> /dps
>>
>>  
>>
>>> On Tuesday, 24 November 2015 09:38:14 UTC+11, Remco Boerma wrote:

 I've done my homework and agree Massimo. There is hardly a thing that 
 requires python3 that doesn't work with python2. The only one i know is 
 https://micropython.org/ but it's not a big company, nor a "big" 
 product. 


 Op woensdag 11 november 2015 16:21:18 UTC+1 schreef Massimo Di Pierro:
>
> As of today python 3 is used almost exclusively in schools. Do you 
> know of any large company that uses Python 3? I do not. But I know many 
> large companies that use Python 2, including banks.  
>
> On Monday, 9 November 2015 01:36:40 UTC-6, Remco Boerma wrote:
>>
>> Great one Alex. 
>>
>> While searching for web2py and python3 the first result i got was 
>> this 
>> . 
>>  
>>
>>> Hi...I m total beginner in python with elastic search also Unicode 
>>> ... I am looking for a wonderful framework & was keen on web2py..but 
>>> just 
>>> happened to read that its not compatible with python 3..
>>>
>>> Pl guide me abt this issue & in selecting framework
>>>
>>> With regards to all,
>>>
>>
>> I've been asked to start a new internship-company for a project i'm 
>> involved in. And I so want to take those boys and girls on the web2py 
>> path, 
>> but to ask of those new-to-the-market to invest in a legacy language 
>> (2020 
>> is only 4 years from now) is something that feels odd to me. Especially 
>> since i know the power and grace of web2py. 
>>
>> I know the subject has been debated and debated but for the sake of 
>> these students (and these are not the high university kind, but rather 
>> the 
>> ground-work and getting-stuff-done folks) i would kindly ask to take the 
>> future into consideration as well as our marketing because web2py is 
>> simply 
>> droped out of the equation because of py2. I would love to teach those 
>> kids 
>> web2py and be future proof. Many schools already teach things from a 
>> hundred years ago, let's not do that in IT as well. 
>>
>> Thank your for considering. 
>>
>> Op vrijdag 6 november 2015 23:57:33 UTC+1 schreef Alex:
>>>
>>> web2py for python 3 would be great. I hope it comes rather sooner 
>>> than later. I'd love to use python 3, no more str <-> unicode nonsense 
>>> (which already caused many issues and wasted time for me), type hints 
>>> (seems to have good support in PyCharm) and other new features. I think 
>>> the 
>>> current situation could also scare away potential new users when they 
>>> see 
>>> that web2py does not support python 3.
>>>
>>> pyDAL seems to be already compatible with python 3. Is it not 
>>> possible to make the remaining parts also compatible or are there 
>>> completely new concepts planned? I for one would completely remove the 
>>> FORM 
>>> code - it's nice and easy to get something up and running but difficult 
>>> to 
>>> style (no clear separation of backend/frontend) and extend. I'm using 
>>> knockout (I guess any data binding js lib will do fine) which is very 
>>> flexible and easy to understand. That should be the preferred way to do 
>>> forms and recommended in the book. But that's just my opinion. No more 
>>> FORM 
>>> would mean less code to port to python 3 ;)
>>>
>>> Alex
>>>
>>> On Wednesday, November 4, 2015 at 4:37:56 PM UTC+1, Ramos wrote:

 @massimo 
 When will it be available ? 


 2015-11-04 14:38 GMT+00:00 

[web2py] Re: [pydpdf] ('FPDF' object has no attribute 'write_html')

2016-12-07 Thread Paolo Valleri
see https://github.com/reingart/pyfpdf/blob/master/docs/reference/write_html.md 
for a detailed example for using write_html

Paolo

On Tuesday, December 6, 2016 at 10:23:46 PM UTC+1, Mamisoa Andriantafika 
wrote:
>
> Hi,
>
> Here is a simple controller.
>
> def test_fpdf():
> from gluon.contrib.pyfpdf import FPDF, HTMLMixin
> title = "This The Doc Title"
> heading = "First Paragraph"
> text = 'bla'
> # create a small table with some data:
> rows_body = []
> for data in db(db.person.id > 0).select():
> rows_body.append([TD(str(data.name)), TD(str(data.age))])
> table=TABLE(THEAD(TR(TH("Name"), TH("Age"))),*[TR(*rows) for rows in 
> rows_body])
> pdf=FPDF()
> pdf.add_page()
> pdf.write_html(str(XML(table, sanitize=False)))
> response.headers['Content-Type']='application/pdf'
> return pdf.output(dest='S')
>
> I get an error:
>
> ('FPDF' object has no attribute 
> 'write_html')
>
> Any idea why ?
>
>

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


Re: [web2py] Re: switch to python 3

2016-12-06 Thread Paolo Valleri
What about https://gitlab.com/m2crypto/m2crypto/commits/python3 ?


On Monday, December 5, 2016 at 9:57:19 PM UTC+1, Niphlod wrote:
>
> m2crypto port for py3 are available (although not strictly official). 
> The contrib module for x509 auth stands on it so, on py3, it MAY not work, 
> but it's not web2py's fault (BTW, if you have an alternative, that works 
> for py2 and py3 we'll be glad to adopt it)
>
>
> On Monday, December 5, 2016 at 1:31:19 AM UTC+1, Jason Solack wrote:
>>
>> Does not having m2crypto mean auth is less secure or does it just effect 
>> x509 authentication?
>>
>>
>> On Sunday, November 6, 2016 at 2:15:08 PM UTC-5, Niphlod wrote:
>>>
>>> the same gain moving any piece of code from python 2 to python 3 (read 
>>> on the interwebs, there are a few).
>>> at least now you can choose and have web2py not standing in the way.
>>>
>>> On Sunday, November 6, 2016 at 12:34:39 AM UTC+1, Ramos wrote:

 what is the gain moving to python 3?

 2016-11-05 17:59 GMT+00:00 Leonel Câmara :

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



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


[web2py] Re: Is web2py dying?

2016-11-18 Thread Paolo Valleri
Hi,

On Thursday, November 17, 2016 at 9:00:38 PM UTC+1, AlighaThor wrote:
>
> Thanks for your quick reply.
>
> By the way, with 4 years of experience, why not start contributing too
>>
>
> Exactly for that reason I asked this. I'm really thinking about request 
> being a contributor. I want to do my best efforts for this awesome 
> technology and I dont want it to die. :)
>

In https://github.com/web2py/web2py/issues/1353 are listed few open issues 
blocking the new release (mainly py3), pick the one you like from that list 
or from the general https://github.com/web2py/web2py/issues

 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: 50x performance improvement for web2py in TechEmpower Web Framework Benchmarks

2016-11-18 Thread Paolo Valleri
According to the benchmark records an important optimization concerns the 
session logic.
The results are also good because the web2py version used during the 
benchmark already includes all encode/decode calls introduced for py3. 

Paolo

On Friday, November 18, 2016 at 2:40:01 PM UTC+1, JorgeH wrote:
>
> Good work, Anthony!
>
>>
>>

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


[web2py] Re: How to cleanly pass FPDF output object to os Download/Save dialogue box

2016-10-17 Thread Paolo Valleri
With this:
...
s_io = pdf.output(dest='S')
response.headers['Content-Type']='application/pdf'
response.headers['Content-Disposition'] = 'attachment; filename="%s"' % 
file_name
raise HTTP(200, s_io, **response.headers)
You get the same you have now with response.stream but it's cleaner.
Without setting the 'Content-disposition' the pdf will be opened in the 
browser.

Paolo

On Sunday, October 16, 2016 at 7:42:29 PM UTC+2, Peter wrote:
>
>
> So this is better but I still need some direction... 
>
> (thanks to Paul Rykiel's post 
> 
>  
> re labels and responders including one Mariano Reingart)...and hope it 
> helps someone else down the road.
>
>
> pdf = receipt_PDF()
> pdf.add_page()
>
> rcpt_filename = "RCPT_%s_%s.pdf" % (session.rcpt_number, 
> session.rcpt_recipient)
> rcpt_filename = rcpt_filename.replace( ' ', '_' )
>
> rcpt_filepath = request.folder + '/static/temp/%s'%(rcpt_filename)
>
> if sys.platform.startswith( "linux" ) :
> os.system( "xdg-open %s" %(rcpt_filepath) )
> else :
> os.system( "%s" %(rcpt_filepath) )
>
> pdf.output(rcpt_filepath,dest='S')
> response.headers['Content-Type'] = 'application/pdf'
> return response.stream(rcpt_filepath, chunk_size=4096, request=request, 
> attachment=True, filename=rcpt_filename)
>
>
>
> so this code... 
>
>- no longer opens the browser pdf reader,  user page does not change! 
>- opens the open/save dialogue box with appropriate filename and 
>allows user to save wherever desired!
>
> but it still has one issue...
>
>- as well as opening the open/save dialogue box it automatically opens 
>Adobe Reader as well and displays the file (a little overkill!)
>
> (It also creates temp files on the system that may/may not need to be 
> cleaned up - but that's for another day.)
>
>
> *Can I stop it automatically opening the file in Adobe and if so how?*
>
>
> Peter  
>
>
>
> [edit]
> There is an added bonus that kicked in somewhere the file size is 
> approximately 30% of what it was before...
>
>
>
>
> 
>
>
>  
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Help with App memory usage

2016-10-14 Thread Paolo Valleri
Which driver are you using for postgres? Are you using cache in models?
Try to figure out if there are controllers using more memory than others.


On Friday, October 14, 2016 at 4:03:20 AM UTC+2, Anthony wrote:
>
> That's a lot of code to review. You're probably going to have to do some 
> digging and narrow it down for us. I did see one problem, though:
>
> class IS_BARCODE_AVAILABLE(object): 
> T = current.T
>
> You can't use current in a class attribute (for the same reason it can't 
> be used at the top level of a module -- it's value will be fixed at the 
> first import, though it is a thread-local object that should change with 
> every request).
>
> Anthony
>
> On Thursday, October 13, 2016 at 9:28:44 PM UTC-4, dan...@betanetweb.com 
>  wrote:
>>
>> Hello im an developing an opensource POS (link 
>> ) using web2py, 
>> everything is fine except that on my development environment and in a 
>> production server, my app memory usage grows without limits, it does not 
>> crash the server however sometimes i get python MemoryError's, things like 
>> error: 
>> unpack_from requires a buffer of at least 5 bytes 
>>  or postgres memory errors 
>> in the production server, in my development environment i see the memory 
>> grow by 3 to 6 MB for every request, i dont know what is causing this 
>> behavior, i am not using caching. any help appreciated.
>>
>

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


Re: [web2py] Re: web3py status

2016-09-07 Thread Paolo Valleri
Current master branch passes almost all unittests on python 3.5.
If anyone is interested in helping with the final steps, a checklist is 
here https://github.com/web2py/web2py/issues/1353#issue-159010482

On Tuesday, September 6, 2016 at 5:43:55 AM UTC+2, jjs0sbw wrote:
>
> I agree that a better test environment is necessary...
>
> In the next few months I will be starting a project with web2py --- or 
> whatever -- 
>
> A standard test approach and environment will be the first item to be 
> addressed..
>
> What are the basic requirements for a test environment
>
> What needs to be done first..?
>
> Take care and have fun,
>
> Joe 
>
> On Mon, Sep 5, 2016 at 2:01 PM, Matheus Cardoso  > wrote:
>
>> I think the name is the least of our problems. We should debate about 
>> what is missing to achieve this "web3py", how many people its demands to 
>> accomplish this new framework, main features, such as test environment 
>> (!!!), server side rendering or not, etc. 
>>
>> On Friday, October 25, 2013 at 11:26:36 PM UTC-3, elguavas wrote:
>>>
>>> hi there,
>>>
>>> i've seen peppered throughout this list references to "web3py". i seems 
>>> like it's mostly the unofficial name of of a concept at this stage, but i 
>>> also see references to work being pulled into web2py from web3py...  where 
>>> is this web3py and what's its current state? 
>>>
>>> thanks,
>>> e.
>>>
>>> -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> You received this message because you are 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.
>>
>
>
>
> -- 
> Joe Simpson
> “Reasonable people adapt themselves to the world. Unreasonable people 
> attempt to adapt the world to themselves. All progress, therefore, 
> depends on unreasonable people.”
> George Bernard Shaw
>

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

2016-09-03 Thread Paolo Valleri
Have you disabled migrations?

Paolo

On Saturday, September 3, 2016 at 7:01:39 PM UTC+2, Scott Hunter wrote:
>
> I have an app which runs *much* slower than expected on pythonanywhere.
>
> I enabled the profiler, and one thing stood out: on pythonanywhere, the 
> function the most time was spent in, by far, is fcntl.flock from inside 
> portalocker while loading the models.  In fact, when run locally, 
> portalocker isn't even being called: it goes straight from save_dbt to 
> cPickle.dump.
>
> Is there some configuration specific to web2py that might address this, or 
> is it something I should take up w/ the people at PA?
>
> - Scott
>

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


[web2py] Re: geometry field /postgis/srid conversion

2016-01-09 Thread Paolo Valleri
Hi Pierre,
try to define the table as follows
db.define_table('geom',
Field('loc','geometry(public, 2154, 2)'))
By doing that you define the column *loc* with srid=2154. Notice that 
'public' is the schema, and 2 is the dimension.

Paolo

On Thursday, January 7, 2016 at 7:21:40 PM UTC+1, Pierre wrote:
>
>
> As I understand it web2py geometry field uses SRID 4326 by default. Is 
>> there a way to tell it to use another SRID ?
>>
> or do I have to first create the table with a define_table and then the 
> correct geometry field with a raw SQL addcolumn command == a lot of 
> gesticulation for a simple task
>
> Am I wasting my time trying to do GIS in web2py ?
>

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


Re: [web2py] Re: geometry field /postgis/srid conversion

2016-01-09 Thread Paolo Valleri
Postgres allows the developer to define tables under different schemas, the
'common' schema is 'public'. I recommend you to use it as well.
Web2py have few bindings for GIS queries, have a look at
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#PostGIS--SpatiaLite--and-MS-Geo--experimental-

 Paolo

2016-01-09 15:17 GMT+01:00 Pierre :

> Thanks Paolo,
>
> this seem to work:
>
> db.define_table('geom',
> Field('loc','geometry('',2154,2)'))
>
> I don't understand the role of the first argument: schema/public. Why
> public instead of '' ?  what does schema/public relate to ?
>
> I guess you are a web2py expert. Do you think it's wise to build a GIS App
> in Web2py ? I mean coding GIS queries in raw sql, passing the arguments via
> placeholders This doesn't sound very good to me.
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/Ad7ICaNy5Dk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@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.


Re: [web2py] Re: web2py and python3

2015-11-16 Thread Paolo Valleri
Just to understand what we are talking about, which are the main issues in 
porting web2py on python 3.x ?

Paolo

On Saturday, November 14, 2015 at 11:24:30 PM UTC+1, Ramos wrote:
>
> weppy looks like a short webp2y environment, however lacks some good 
> documentation like web2py and all of the code samples are very short and 
> errors come often.
> Seems that the only one helping is the "creator" itself.
> Unfortunately i dont see it as a good alternative to web2py.
>
> At least web2py has a lot of people helping everybody.
>
>
>
> 2015-11-13 17:49 GMT+00:00 Jim S :
>
>> What are the chances that weppy (www.weppy.org) becomes the Python 3 
>> version of web2py?
>>
>> I'm working with the newly available, officially supported Python 
>> implementation on IBM i (formerly AS/400) and it is Python version 3.4 so 
>> web2py isn't an option for me.  Is there any news or direction for people 
>> forced to use Python 3?  I really don't want to give up my web2py knowledge 
>> and move to another framework.  The other big guns (django, flask, bottle, 
>> pyramid) all have Python 3 versions.  
>>
>> Thoughts?
>>
>> -Jim
>>
>>
>> On Thursday, November 12, 2015 at 6:41:49 PM UTC-6, Massimo Di Pierro 
>> wrote:
>>>
>>> I do not think it is a secret. As far as I know the security pricing 
>>> infrastructure of Bank of America is based on proprietary object database 
>>> built in Python and the JP Morgan Chase has been working for some time on 
>>> an internal trading platform based on Python (do not know if it is in use 
>>> at this time). Also I have consulted with some local trading companies in 
>>> Chicago that use Python+pytable+numpy+hdf5.
>>>
>>> Here is a source 
>>> https://www.quora.com/Why-are-banks-like-JP-Morgan-and-Bank-of-America-Merrill-Lynch-using-Python-to-replace-historic-legacy-systems-built-in-Java-C++
>>>  
>>> but I have my own sources. :-)
>>>
>>> In fact a friend told me Bank of America uses web2py too although not 
>>> for business critical apps where they use proprietary code, but for 
>>> interfacing some of their Air Conditioning systems. I have been unable to 
>>> verify this information. I know other banks or large financial institutions 
>>> that also use web2py for some of internal non-business critical development.
>>>
>>> Massimo
>>>
>>> On Wednesday, 11 November 2015 09:34:41 UTC-6, Ramos wrote:

 What banks? can you share that info ?

 2015-11-11 15:21 GMT+00:00 Massimo Di Pierro :

> As of today python 3 is used almost exclusively in schools. Do you 
> know of any large company that uses Python 3? I do not. But I know many 
> large companies that use Python 2, including banks.  
>
>
> On Monday, 9 November 2015 01:36:40 UTC-6, Remco Boerma wrote:
>>
>> Great one Alex. 
>>
>> While searching for web2py and python3 the first result i got was 
>> this 
>> . 
>>  
>>
>>> Hi...I m total beginner in python with elastic search also Unicode 
>>> ... I am looking for a wonderful framework & was keen on web2py..but 
>>> just 
>>> happened to read that its not compatible with python 3..
>>>
>>> Pl guide me abt this issue & in selecting framework
>>>
>>> With regards to all,
>>>
>>
>> I've been asked to start a new internship-company for a project i'm 
>> involved in. And I so want to take those boys and girls on the web2py 
>> path, 
>> but to ask of those new-to-the-market to invest in a legacy language 
>> (2020 
>> is only 4 years from now) is something that feels odd to me. Especially 
>> since i know the power and grace of web2py. 
>>
>> I know the subject has been debated and debated but for the sake of 
>> these students (and these are not the high university kind, but rather 
>> the 
>> ground-work and getting-stuff-done folks) i would kindly ask to take the 
>> future into consideration as well as our marketing because web2py is 
>> simply 
>> droped out of the equation because of py2. I would love to teach those 
>> kids 
>> web2py and be future proof. Many schools already teach things from a 
>> hundred years ago, let's not do that in IT as well. 
>>
>> Thank your for considering. 
>>
>> Op vrijdag 6 november 2015 23:57:33 UTC+1 schreef Alex:
>>>
>>> web2py for python 3 would be great. I hope it comes rather sooner 
>>> than later. I'd love to use python 3, no more str <-> unicode nonsense 
>>> (which already caused many issues and wasted time for me), type hints 
>>> (seems to have good support in PyCharm) and other new features. I think 
>>> the 
>>> current situation could also scare away potential new users when they 
>>> see 
>>> that web2py does not support python 3.
>>>
>>> pyDAL seems to be already compatible with python 3. Is 

Re: [web2py] Re: web2py and python3

2015-11-16 Thread Paolo Valleri
Maintaining web2py is not easy at all, how/who will maintain two
web2py/web3py? I see this as the major issue
The old discussions were about the whole web2py, now there is pydal already
working on python 3.x.

Having a roadmap is a good way to proceed and surely github wiki is the
place where document it.
Two things to discuss:
- will be backward compatibility?
- will be a new project (web3py), or not(web2py)?
Today, I'd say, yes to first, no to the second, but we should start working
on the porting and see later what will happen

The first step of the roadmap is writing the roadmap :0
The second making web2py "syntactically" compatible with python 3.x
Who want to start?

 Paolo

2015-11-17 2:53 GMT+01:00 Richard Vézina <ml.richard.vez...@gmail.com>:

> Here it goes :
>
> List of relevant posts :
>
> Most relevant:
> https://groups.google.com/d/msg/web2py/X80Ol0Uumrg/vGrGtaeOVZwJ
> https://groups.google.com/d/msg/web2py/mlG6-yHPa4g/MFAU9zX3jo4J
> https://groups.google.com/d/msg/web2py/WJOWlTnoz5I/y0-dQTywoHwJ
>
>
> The whole thread:
> https://groups.google.com/forum/#!topic/web2py/hAiMQ1gLUo8
> https://groups.google.com/forum/#!topic/web2py/291FhcxGvYc
>
> https://groups.google.com/forum/#!topicsearchin/web2py/web3py/web2py/lwdZ5vEMGdM
>
> Stackoverflow
> http://stackoverflow.com/questions/22684906/web2py-and-python-3
>
> Funny:
> https://www.quora.com/How-does-web2py-support-Python-3
> https://www.quora.com/profile/Wei-Wei-1/Posts/10-reasons-not-to-use-web2py
>
> Old
> https://groups.google.com/forum/#!topic/web2py/U1Ukbfhmais
> https://groups.google.com/d/msg/web2py/xXDjA47a6nc/ZrMi5XXHUpgJ
>
> web2py-dev
>
> https://groups.google.com/forum/#!msg/web2py-developers/jXFLnyfkL2U/GQ0qHENepHEJ
> https://groups.google.com/d/msg/web2py-developers/CFj5dH3ilew/x0KoevEfufIJ
> https://groups.google.com/d/msg/web2py-developers/RCeiRd3Rzs0/vqA_PfmBvHgJ
> https://groups.google.com/d/msg/web2py-developers/AEtuwHQgJnc/iKNMImHqoHUJ
> https://groups.google.com/d/msg/web2py-developers/9ztv8ecT1Nk/7__jGmreZf8J
> Gluino3 no answer :
> https://groups.google.com/d/msg/web2py-developers/ilxA-aMDtLk/OSYp_uoWfVcJ
> https://groups.google.com/d/msg/web2py/lwdZ5vEMGdM/D6BfYuwOWoUJ
>
>
> I think I can still find some threads but I think the most important one
> are there...
>
> Have a good read...
>
> :)
>
> Richard
>
> On Mon, Nov 16, 2015 at 4:45 PM, Jim S <j...@qlf.com> wrote:
>
>> +1
>>
>> On Monday, November 16, 2015 at 3:38:48 PM UTC-6, Richard wrote:
>>>
>>> I would like to suggest a way to get out of these recurrent
>>> discussions...
>>>
>>> Why not adopt some guidance around the issue... I think the heart of the
>>> problem here is that not knowing what is coming or not make people insecure
>>> about the future of what is built (or could be build) with web2py. It may
>>> be true that no big corporate are not using Python 3 at the moment, though
>>> distros have already started sending the message that Python 3 is coming...
>>> To my knowledge, since 3.4 Python 3 is consider to be ready for real
>>> work...
>>>
>>> So, maybe we could write a section in the book about web2py and Python 3
>>> support, if the book is not the place we can put a text file in github
>>> somewhere in web2py about that and maybe a TODO-List of what is need to be
>>> done... Or a Roadmap on the web2py Web site... There is plenty of options
>>> to document out this "issue" and what is know about it and what is the
>>> heart of this issue... Also, if web2py will have to break it promise for
>>> backward compatibility or not and if it breaks it what work to expect in
>>> our apps to make them work in "web3py", etc.
>>>
>>> There is many threads on the mailing-lists... A good start could be to
>>> retrieve them and read them to extract the important things??
>>>
>>> Like that when the question pop again we can redirect people to the
>>> Documentation/Roadmap and they can make a better informed decision about
>>> using web2py or not, waiting for Python 3 support by web2py or not, etc.
>>>
>>> Thanks, regards
>>>
>>> Richard
>>>
>>> On Mon, Nov 16, 2015 at 4:13 PM, Stuart Rolinson <stu...@eventsense.net>
>>> wrote:
>>>
>>>> I wanted to add to this discussion as well.  I think that developing
>>>> with python 2.7 and web2py has been fine, however I have been really
>>>> concerned as my application gets bigger that we are going to have to
>>>> migrate to a .net or java based solution in

[web2py] Re: DAL returns string fields not as unicode strings

2015-11-14 Thread Paolo Valleri
I tried to run the following (test.py) with the latest stable web2py 
(i.e.: python web2py.py -S welcome -R test.py)
db = DAL('sqlite:///tmp/storage.sqlite')
db.define_table('unicode_test', Field('test', 'string'))
test_val = unicode('på Facebook', 'utf-8')
db.unicode_test.insert(test=test_val)
db.commit()

for r in db(db.unicode_test).select(): 
print r.test, type(r.test)

print db.unicode_test[1].test

I got

på Facebook 
på Facebook

Paolo


On Thursday, November 12, 2015 at 8:03:25 PM UTC+1, Dandelion Mine wrote:
>
> I tried it on 2.12.3-stable:
> >>> db = DAL('sqlite://storage.sqlite')
> >>> db._db_codec
> 'UTF-8'
> >>> db.define_table('unicode_test', Field('test', 'string'))
> 
> >>> test_val = unicode('på Facebook', 'utf-8')
> >>> db.unicode_test.insert(test=test_val)
> 1L
> >>> for r in db(db.unicode_test).select(): print r.test, type(r.test)
> ... 
> på Facebook 
> >>> db.unicode_test[1].test
> 'p\xc3\xa5 Facebook'
> >>> db.unicode_test[1].test.decode('utf-8')
> u'p\xe5 Facebook'
>
> On Wednesday, November 11, 2015 at 5:52:47 PM UTC+3, Massimo Di Pierro 
> wrote:
>>
>> The strings you get are probably UTF8. Can you confirm?
>>
>> On Wednesday, 4 November 2015 08:19:41 UTC-6, Dandelion Mine wrote:
>>>
>>> Hello!
>>> According to Web2py book, 'by default web2py uses utf8 character 
>>> encoding for databases'. I get the contrary results: there are fields with 
>>> type 'string', mysql shows that they have collation utf8_general_ci, but 
>>> when I select them with DAL, the type of returned fields are 'str', not 
>>> 'unicode'.
>>>
>>> db.define_table('customers',
>>> Field('name', 'string'))
>>>
>>> +---+--+-+--
>>> | Field | Type | Collation   | Null | Key | 
>>> +---+--+-+--+
>>> | name  | varchar(512) | utf8_general_ci | 
>>>
>>> print type(db(db.tradera_customers).select().first().name)
>>> 
>>>
>>> I tried to remove *.table in databases and to use db_codec parameter for 
>>> DAL, but nothing changed.
>>>
>>> Web2py version 2.9.11-stable, Python 2.7.9, MySQL ver 14.14 Distrib 
>>> 5.5.40
>>>
>>> Is it a known bug or I'm doing something wrong?
>>> Thanks in advance.
>>>
>>

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


[web2py] Re: ajax need to return 4 values

2015-11-14 Thread Paolo Valleri
There isn't a solution out-of-the-box in web2py.
I'd suggest returning a json with the 4 values, and then apply the result 
to the input fields

Paolo

On Saturday, November 14, 2015 at 1:50:56 PM UTC+1, lucas wrote:
>
> hello one and all,
>
> how do i run an ajax function under an onchange of a select where the 
> return 4 values will be going to 4 separate other inputs of type text, 
> select, or textarea?
>
> thank you in advance, lucas
>

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


[web2py] Re: Creating web apps with Web2py in Azure Web Apps

2015-11-13 Thread Paolo Valleri
we can start using github wiki for all things in script/*

Paolo

On Friday, November 13, 2015 at 9:09:12 AM UTC+1, Niphlod wrote:
>
> we're working towards REDUCING scripts/anything_for_deployment because 
> they quickly become unmaintained. 
> If we start to scripts/deploy/any_cloud_provider_out_there I guess it'll 
> suffer for the same issues.
>
> IMHO (maybe) we should use gitbook for recipes.
>
> On Friday, November 13, 2015 at 1:46:11 AM UTC+1, Massimo Di Pierro wrote:
>>
>> I do not know how long web2py slices will live. Bruno does not want to 
>> maintain it and GoDaddy is adopting their usual policy of not allowing the 
>> domain transfer (they say yes but it does not work). We need a better 
>> solution. Would you opposed to a scripts/azure/ subfolder?
>>
>> On Thursday, 12 November 2015 15:49:52 UTC-6, Niphlod wrote:
>>>
>>> +1 +1 +1 +1 
>>> this should go in web2pyslices.com (although the venv machinery is not 
>>> strictly necessary, it's a "nice to have")
>>>
>>> On Thursday, November 12, 2015 at 10:09:36 PM UTC+1, Nbush wrote:

 Hi all,

 just want to share web2py setup Azure Web Apps.

 Based on 
 https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/

 1. Create web app on Azure Portal
 2. Fork a repo web2py (github)
 3.* Add 4 files  to own github repository (web2py/)*
 4. Configure continuous deployment using github 
 https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/
  
 look *Deploy files from a repository site like BitBucket, CodePlex, 
 Dropbox, GitHub, or Mercurial. *

> *Azure creates an association with the selected repository, and pulls 
> in the files from the specified branch. After this process completes, the 
> Deployment section of your web app's blade will show an Active Deployment 
> message that indicates deployment has succeeded.*

 5. Run web app on on Azure Portal

 Admin password:
 1.on local copy web2py - save the password in the parameters_8000.py 
 file
 2.rename parameters_8000.py parameters_443.py
 3.copy parameters_443.py via FTP (link in Azure Portal) in site/wwwroot

 Example: 
 https://nbush2py.azurewebsites.net
 https://github.com/Nbushkov/web2py




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


[web2py] Re: postgis & web2py geo api

2015-11-13 Thread Paolo Valleri
have a look 
at 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?#PostGIS--SpatiaLite--and-MS-Geo--experimental-
and a basic example here: 
http://www.web2pyslices.com/slice/show/1899/leaflet-and-geojson-with-web2py

Paolo
On Friday, November 13, 2015 at 3:47:18 PM UTC+1, Pierre wrote:
>
> Hi all,
>
> Do I have to install third-party software to use postgis in web2py or is 
> it only to change the DAL connection string ?   used sqlite so far
> Is there a place where I could find wider documentation concerning web2py 
> geo api /examples?
> how to define a geography field ? what should be in it ?
> given not being a system engineer is it ok  to deploy a web2py app using 
> postgis on pythonanywhere / GAE ?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Oracle perfomance issues with version 2.12.3

2015-11-09 Thread Paolo Valleri
Hi,
there should be something wrong going on.
As a first step, I'd write a simple query (i.e., select(db.table.ALL, 
limit=(0,10)) using pydal (the database abstraction layer used in web2py) 
and try to find out in which version has been introduced this performance 
issue. If you don't find a performance issue on pydal, then there should be 
something in the SQLFORM.grid part.

 Paolo

On Sunday, November 8, 2015 at 6:16:31 AM UTC+1, tomt wrote:
>
> Hi,
>
> I encountered really slow responses when I was using my web2py app to 
> access an oracle database.  I tried to use dbstats in response.toolbar to 
> measure this, but it wouldn't show the sql or any timing information.  I 
> decided to try downgrading to an older web2py version, 2.11.2, and noticed 
> a dramatic change.
>
> web2py 2.11.2   query took 4 seconds
> web2py 2.12.3   query took > 2 minutes
>
> I've tried this several times, with the same result. Were there any 
> changes in web2py that could account for this?
>
> The query I am running was passed to sqlform.grid
>
> soequery = ( (db2.soe_tdb.utctime > fromdate)&\
>  (db2.soe_tdb.utctime < todate)&\
>  (db2.soe_tdb.stationname.belongs(stationlist))&\
>  (db2.soe_tdb.pointnumber == db2.statuspoint.pointnumber)&\
>  (db2.statuspoint.pointaccessarea == 
> db2.accessareaassignment.setnumber)&\
>  (db2.accessareaassignment.referencename == 'SOE')&\
>  ~(db2.statuspoint.pointname.like('%@%')) )
>
> orderby = [db2.soe_tdb.utctime]
>
> grid=SQLFORM.grid(
> query=soequery,
> deletable=False,editable=False,details=False,
> searchable=True,fields=fields,headers=headers,
> paginate=10,csv=False,maxtextlengths=maxtextlengths,
> orderby=orderby,
> )
>
> Please let me know if there is any other information that I could provide 
> to try to resolve this.
>
> Thanks in advance, - Tom
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] Getting type 'exceptions.ImportError' cannot import name table_field after upgrading to 2.12.3

2015-08-24 Thread Paolo Valleri
see also https://github.com/kenji4569/sqlabs/issues/68

On Monday, August 24, 2015 at 3:23:24 PM UTC+2, Johann Spies wrote:

 I had similar problems which convinced me to to stop using solidtable.

 Regards
 Johann


 -- 
 Because experiencing your loyal love is better than life itself, 
 my lips will praise you.  (Psalm 63:3)


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: GAE unicodeDecodeError: 'ascii' codec can't decode byte... unable to fix it

2015-08-18 Thread Paolo Valleri
Hi, 
the latest version of web2py doesn't include the most recent pydal.
I'd suggest trying your app with the last development version of web2py.

Paolo

On Monday, August 17, 2015 at 6:48:11 PM UTC+2, Jaime Sempere wrote:

 Hi,

 I am having problems when I try to deploy my app on local SDK GAE.

 I can start the app on my local gae, but when I try to register first 
 user, after fill the form and press submit, I got this:

 Traceback (most recent call last):
   File /home/jukvoxman/web2py/gluon/restricted.py, line 227, in 
 restricted
 exec ccode in environment
   File 
 /home/jukvoxman/web2py/applications/relatos/controllers/default.py, line 
 219, in module
   File /home/jukvoxman/web2py/gluon/globals.py, line 412, in lambda
 self._caller = lambda f: f()
   File 
 /home/jukvoxman/web2py/applications/relatos/controllers/default.py, line 
 196, in user
 return dict(form=auth())
   File /home/jukvoxman/web2py/gluon/tools.py, line 1594, in __call__
 return getattr(self, args[0])()
   File /home/jukvoxman/web2py/gluon/tools.py, line 2901, in register
 self.settings.create_user_groups % form.vars, description)
   File /home/jukvoxman/web2py/gluon/tools.py, line 3636, in add_group
 role=role, description=description)
   File /home/jukvoxman/web2py/gluon/packages/dal/pydal/objects.py, line 
 691, in insert
 ret = self._db._adapter.insert(self, self._listify(fields))
   File 
 /home/jukvoxman/web2py/gluon/packages/dal/pydal/adapters/google_adapters.py,
  
 line 549, in insert
 dfields=dict((f.name,self.represent(v,f.type)) for f,v in fields)
   File 
 /home/jukvoxman/web2py/gluon/packages/dal/pydal/adapters/google_adapters.py,
  
 line 549, in genexpr
 dfields=dict((f.name,self.represent(v,f.type)) for f,v in fields)
   File 
 /home/jukvoxman/web2py/gluon/packages/dal/pydal/adapters/google_adapters.py,
  
 line 171, in represent
 obj = NoSQLAdapter.represent(self, obj, fieldtype)
   File /home/jukvoxman/web2py/gluon/packages/dal/pydal/adapters/base.py, 
 line 1858, in represent
 obj = to_unicode(obj)
   File /home/jukvoxman/web2py/gluon/packages/dal/pydal/_compat.py, line 
 27, in to_unicode
 return unicode(obj)
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15: 
 ordinal not in range(128)


 I have done everything: look for other posts, I have deleted any special 
 character found on my code (0xc3 is supposed to be an Á, which is strange 
 because I have not found any of them on code), deleted the 'list:strings' 
 fields, and so on I have tried with 2.11.2 version and the just 
 released one.

 I have tried a lot of things, but I have just given up... could any one 
 give some light on my issue? 

 I'd really appreciate it. Thanks in advance!



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


[web2py] Re: Error in last stable version when trying to delete through one to many relation

2015-08-17 Thread Paolo Valleri
Hi all, 
according to my tests the issue is fixed on master pydal.
@Lisandro, you should use master web2py which points to a version of pydal 
containing the fix.

Paolo

On Tuesday, August 4, 2015 at 5:21:38 PM UTC+2, Massimo Di Pierro wrote:

 good catch! I opened a ticket: https://github.com/web2py/pydal/issues/262

 On Monday, 3 August 2015 16:25:24 UTC-5, Lisandro wrote:

 I **think** I've found the problem. 
 After some tests, I've deduced that the error is thrown when using DAL 
 with lazy_tables=True. 
 So when I retrieve a Row from contenido table, the returned object does 
 not contain the galeria_contenido set. 

 Is this a bug? Or I've been using lazy_tables in the wrong way? 
 I ask because I've been using this code in production for a while with no 
 errors, but the error only appeared when I upgrade from 2.10.3 to 2.11.2 
 (haven't checked intermediate versions).

 El lunes, 3 de agosto de 2015, 16:23:25 (UTC-3), Anthony escribió:

 Also, note that the error is not related to the delete method -- it is 
 occurring when trying to access 

 noticia.galeria_contenido

 The galeria_contenido attribute of the Row object should be a Set 
 object referring to the set of records in db.galeria_contenido that 
 reference this particular row in db.contenido. For some reason, that Set 
 object is not there.

 Anthony

 On Monday, August 3, 2015 at 2:47:18 PM UTC-4, Niphlod wrote:

 uhm, I can't reproduce with a minimal model and 2.11.2 ..
 what backend are you using ?


 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2015
 Version 2.11.2-stable+timestamp.2015.05.30.11.29.46
 Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000
 , pyodbc
 WARNING:web2py:import IPython error; use default python shell
 Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel
 )] on win
 32
 Type help, copyright, credits or license for more information.
 (InteractiveConsole)
  db.define_table('contenido', Field('titulo'))
 Table contenido (id,titulo)
  db.define_table('galeria_contenido', Field('contenido', db.
 contenido, ondele
 te='NO ACTION'), Field('titulo'))
 Table galeria_contenido (id,contenido,titulo)
  db.contenido.insert(titulo='test')
 1L
  db.galeria_contenido.insert(contenido=1, titulo='galeria_1')
 1L
  db.galeria_contenido.insert(contenido=1, titulo='galeria_2')
 2L
  db.contenido[1]
 Row {'titulo': 'test', 'id': 1L, 'galeria_contenido': Set (
 galeria_contenido.contenido = 1)}
  contenido_1 = db.contenido[1]
  contenido_1
 Row {'titulo': 'test', 'id': 1L, 'galeria_contenido': Set (
 galeria_contenido.contenido = 1)}
  contenido_1.galeria_contenido.delete()
 2
 



 Can you replicate the issue with this ultra-slim model ?




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: 2.12.1 is out

2015-08-17 Thread Paolo Valleri
@Massimo, I've just noticed that web2py 2.12.2 points to an old version of 
pydal. is that correct?
see https://github.com/web2py/web2py/tree/R-2.12.2/gluon/packages

Paolo

On Sunday, August 16, 2015 at 10:45:19 PM UTC+2, Massimo Di Pierro wrote:

 Fine with most of these. Can you send PR requests and I will 
 review/accept/reject?
 Massimo

 On Saturday, 15 August 2015 08:58:58 UTC-5, ermolaev...@gmail.com 
 javascript: wrote:

 for prevetn pickle error please add new param in session:

 session.connect(request,response,cookie_key='kjykGFDRETfxf65',
 compression_level=None, *pickle_low*=True)


 If *pickle_low: - not use high protocol foe pickle*



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: break syntax between 2.8.2 and 2.11.2??

2015-07-13 Thread Paolo Valleri
Hi Simone, 
it should be fixed in trunk, would you mind to test your code against 
latest development version of web2py?

Paolo

On Thursday, July 9, 2015 at 9:33:05 PM UTC+2, Dave S wrote:



 On Thursday, July 9, 2015 at 5:54:00 AM UTC-7, 黄祥 wrote:

 please update your web2py, since 2.11.x it have pydal.


 Simone apparently did not do an update, but instead a new install, so 
 there should be no old dal files to remove.
 And we do see pydal mentioned in the error message.

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


Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-22 Thread Paolo Valleri
Massimo the mentioned issue has been fixed in pydal. Have you found other 
different issues?

Paolo

On Sunday, June 21, 2015 at 6:14:29 PM UTC+2, Massimo Di Pierro wrote:

 I think we should remove pg8000 unless this unicode problem is fixed. It 
 just causes problem to new pgsql users. psycopg2 is solid.

 On Thursday, 18 June 2015 12:59:44 UTC-5, Paolo Valleri wrote:

 In general the best choice is psycopg2 however, the issue with pg8000 has 
 been fixed
 I've written an initial basic unittest 
 https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to check 
 possible issues with unicode


  Paolo

 2015-06-18 19:47 GMT+02:00 Antonio Salazar asala...@gmail.com 
 javascript::

 Is it still recommended to use psycopg2 instead of pg8000 after this fix?

 El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:

 According to my tests, the current PG adapter works only with psycopg2 
 and python2.7
 It is broken with both pg8000 and psycopg2 on python 3.x

 A possible fix for pg8000 and python2.7 is here 
 https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64

 I've posted an issue for psycopg2 with python3.x here 
 https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256

 Paolo

 On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:

 It is a bug in pg8000. You need to install psycopg2

 On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:

 I have the same problem. PostgreSQL database, web2py 
 2.11.2-stable+timestamp.2015.05.30.16.33.24 
 source install.

 Now any field update which has non-ASCII characters fails with type 
 'exceptions.UnicodeDecodeError' 'ascii' codec can't decode byte 0xc3 in 
 position X: ordinal not in range(128)
 By any field update, I mean custom forms, form grids, and even 
 database administration.

 This is the traceback after failing to change a user's name to José 
 with database administration:

 Traceback (most recent call last):
   File S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py, line 
 227, in restricted
 exec ccode in environment
   File 
 S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py
  http://127.0.0.1:8000/admin/edit/extranet/controllers/appadmin.py, 
 line 704, in module
   File S:\Extranet\Website\Fuentes\web2py\gluon\globals.py, line 412, 
 in lambda
 self._caller = lambda f: f()
   File 
 S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py
  http://127.0.0.1:8000/admin/edit/extranet/controllers/appadmin.py, 
 line 343, in update
 if form.accepts(request.vars, session):
   File S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py, line 1686, 
 in accepts
 self.id_field_name]).update(**fields)
   File 
 S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py,
  line 2020, in update
 ret = db._adapter.update(%s % table._tablename,self.query,fields)
   File 
 S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py,
  line 996, in update
 raise e
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
 ordinal not in range(128)


 I don't recall having this problem with pre 2.10 versions

  -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/AE6NVmLPCwk/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com javascript:.
 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.


Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-22 Thread Paolo Valleri
Hi Ben, the latest web2py download doesn't include the fix yet. You have to
either manually update pydal or wait for a newer release of web2py

 Paolo

2015-06-23 6:12 GMT+02:00 Ben Lawrence benlawr...@gmail.com:

 Hi Paolo,  I get the error type 'exceptions.UnicodeDecodeError' 'ascii'
 codec can't decode using the latest web2py download
 (2.10.4-stable+timestamp.2015.04.26.15.11.54 (Running on Apache/2.4.7
 (Ubuntu), Python 2.7.6)). This occurs even with “” characters in the
 on-board wiki.
 Could you tell me the steps of the easiest way to fix this? (I don't mind
 which i use pg8000 or psycopg2) Is it a simple matter of

 sudo apt-get install python-psycopg2

 ?


 On Sunday, June 21, 2015 at 11:20:33 PM UTC-7, Paolo Valleri wrote:

 Massimo the mentioned issue has been fixed in pydal. Have you found other
 different issues?

 Paolo

 On Sunday, June 21, 2015 at 6:14:29 PM UTC+2, Massimo Di Pierro wrote:

 I think we should remove pg8000 unless this unicode problem is fixed. It
 just causes problem to new pgsql users. psycopg2 is solid.

 On Thursday, 18 June 2015 12:59:44 UTC-5, Paolo Valleri wrote:

 In general the best choice is psycopg2 however, the issue with pg8000
 has been fixed
 I've written an initial basic unittest
 https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to check
 possible issues with unicode


  Paolo

 2015-06-18 19:47 GMT+02:00 Antonio Salazar asala...@gmail.com:

 Is it still recommended to use psycopg2 instead of pg8000 after this
 fix?

 El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:

 According to my tests, the current PG adapter works only with
 psycopg2 and python2.7
 It is broken with both pg8000 and psycopg2 on python 3.x

 A possible fix for pg8000 and python2.7 is here
 https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64

 I've posted an issue for psycopg2 with python3.x here
 https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256

 Paolo

 On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro
 wrote:

 It is a bug in pg8000. You need to install psycopg2

 On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:

 I have the same problem. PostgreSQL database, web2py 
 2.11.2-stable+timestamp.2015.05.30.16.33.24
 source install.

 Now any field update which has non-ASCII characters fails with
 type 'exceptions.UnicodeDecodeError' 'ascii' codec can't decode byte
 0xc3 in position X: ordinal not in range(128)
 By any field update, I mean custom forms, form grids, and even
 database administration.

 This is the traceback after failing to change a user's name to
 José with database administration:

 Traceback (most recent call last):
   File S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py, line 
 227, in restricted
 exec ccode in environment
   File 
 S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py
  http://127.0.0.1:8000/admin/edit/extranet/controllers/appadmin.py, 
 line 704, in module
   File S:\Extranet\Website\Fuentes\web2py\gluon\globals.py, line 
 412, in lambda
 self._caller = lambda f: f()
   File 
 S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py
  http://127.0.0.1:8000/admin/edit/extranet/controllers/appadmin.py, 
 line 343, in update
 if form.accepts(request.vars, session):
   File S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py, line 
 1686, in accepts
 self.id_field_name]).update(**fields)
   File 
 S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py,
  line 2020, in update
 ret = db._adapter.update(%s % table._tablename,self.query,fields)
   File 
 S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py,
  line 996, in update
 raise e
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 
 57: ordinal not in range(128)


 I don't recall having this problem with pre 2.10 versions

  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/AE6NVmLPCwk/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/AE6NVmLPCwk/unsubscribe.
 To unsubscribe from this group and all its topics, send

Re: [web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-18 Thread Paolo Valleri
In general the best choice is psycopg2 however, the issue with pg8000 has
been fixed
I've written an initial basic unittest
https://github.com/web2py/pydal/blob/master/tests/base.py#L72 to check
possible issues with unicode


 Paolo

2015-06-18 19:47 GMT+02:00 Antonio Salazar asalaza...@gmail.com:

 Is it still recommended to use psycopg2 instead of pg8000 after this fix?

 El lunes, 15 de junio de 2015, 5:28:09 (UTC-5), Paolo Valleri escribió:

 According to my tests, the current PG adapter works only with psycopg2
 and python2.7
 It is broken with both pg8000 and psycopg2 on python 3.x

 A possible fix for pg8000 and python2.7 is here
 https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64

 I've posted an issue for psycopg2 with python3.x here
 https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256

 Paolo

 On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:

 It is a bug in pg8000. You need to install psycopg2

 On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:

 I have the same problem. PostgreSQL database, web2py 
 2.11.2-stable+timestamp.2015.05.30.16.33.24
 source install.

 Now any field update which has non-ASCII characters fails with type
 'exceptions.UnicodeDecodeError' 'ascii' codec can't decode byte 0xc3 in
 position X: ordinal not in range(128)
 By any field update, I mean custom forms, form grids, and even database
 administration.

 This is the traceback after failing to change a user's name to José
 with database administration:

 Traceback (most recent call last):
   File S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py, line 227, 
 in restricted
 exec ccode in environment
   File 
 S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py
  http://127.0.0.1:8000/admin/edit/extranet/controllers/appadmin.py, line 
 704, in module
   File S:\Extranet\Website\Fuentes\web2py\gluon\globals.py, line 412, in 
 lambda
 self._caller = lambda f: f()
   File 
 S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py
  http://127.0.0.1:8000/admin/edit/extranet/controllers/appadmin.py, line 
 343, in update
 if form.accepts(request.vars, session):
   File S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py, line 1686, 
 in accepts
 self.id_field_name]).update(**fields)
   File 
 S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py, 
 line 2020, in update
 ret = db._adapter.update(%s % table._tablename,self.query,fields)
   File 
 S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py,
  line 996, in update
 raise e
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
 ordinal not in range(128)


 I don't recall having this problem with pre 2.10 versions

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


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


[web2py] Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1145: ordinal not in range(128)

2015-06-15 Thread Paolo Valleri
According to my tests, the current PG adapter works only with psycopg2 and 
python2.7
It is broken with both pg8000 and psycopg2 on python 3.x

A possible fix for pg8000 and python2.7 is 
here 
https://github.com/ilvalle/pydal/commit/d5450938ae606a3e85deffa831899a35146f5e64

I've posted an issue for psycopg2 with python3.x 
here https://github.com/psycopg/psycopg2/issues/331#issuecomment-111909256

Paolo

On Saturday, June 13, 2015 at 5:22:07 AM UTC+2, Massimo Di Pierro wrote:

 It is a bug in pg8000. You need to install psycopg2

 On Friday, 12 June 2015 13:51:55 UTC-5, Antonio Salazar wrote:

 I have the same problem. PostgreSQL database, web2py 
 2.11.2-stable+timestamp.2015.05.30.16.33.24 
 source install.

 Now any field update which has non-ASCII characters fails with type 
 'exceptions.UnicodeDecodeError' 'ascii' codec can't decode byte 0xc3 in 
 position X: ordinal not in range(128)
 By any field update, I mean custom forms, form grids, and even database 
 administration.

 This is the traceback after failing to change a user's name to José 
 with database administration:

 Traceback (most recent call last):
   File S:\Extranet\Website\Fuentes\web2py\gluon\restricted.py, line 227, 
 in restricted
 exec ccode in environment
   File 
 S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py
  http://127.0.0.1:8000/admin/edit/extranet/controllers/appadmin.py, line 
 704, in module
   File S:\Extranet\Website\Fuentes\web2py\gluon\globals.py, line 412, in 
 lambda
 self._caller = lambda f: f()
   File 
 S:/Extranet/Website/Fuentes/web2py/applications/extranet/controllers/appadmin.py
  http://127.0.0.1:8000/admin/edit/extranet/controllers/appadmin.py, line 
 343, in update
 if form.accepts(request.vars, session):
   File S:\Extranet\Website\Fuentes\web2py\gluon\sqlhtml.py, line 1686, in 
 accepts
 self.id_field_name]).update(**fields)
   File 
 S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\objects.py, 
 line 2020, in update
 ret = db._adapter.update(%s % table._tablename,self.query,fields)
   File 
 S:\Extranet\Website\Fuentes\web2py\gluon\packages\dal\pydal\adapters\base.py,
  line 996, in update
 raise e
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 57: 
 ordinal not in range(128)


 I don't recall having this problem with pre 2.10 versions



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Virtual fields disapeared from select() results (v2.11.2)

2015-06-09 Thread Paolo Valleri
I see the problem now, thanks for pointing it out.
I'll post a fix later today.

 Paolo

2015-06-08 22:11 GMT+02:00 Donatas Burba d.bu...@gmail.com:

 This is failing example:

 db=DAL('sqlite:memory')

 db.define_table('tt',
 Field('vv', 'integer'),
 Field.Virtual('x', lambda row: row.tt.vv * 10))

 db.define_table('tt2',
 Field('ttref', 'reference tt'),
 Field('vv2', 'integer'))

 tt1 = db.tt.insert(vv='1')
 tt2 = db.tt.insert(vv='3')
 db.tt2.insert(ttref=tt1, vv2='3')
 db.tt2.insert(ttref=tt2, vv2='4')

 records = db(db.tt).select(
 db.tt.ALL, db.tt2.ALL,
 join=[db.tt2.on(db.tt2.ttref == db.tt.id)]
 )
 for r in records:
 print r

 Result:

 Row {'tt2': {'ttref': 1L, 'id': 1L, 'vv2': 3L}, 'tt': {'id': 1L, 'vv':
 1L}}
 Row {'tt2': {'ttref': 2L, 'id': 2L, 'vv2': 4L}, 'tt': {'id': 2L, 'vv':
 3L}}

 As you can see virtual field 'x' (in table 'tt') is missing. As I
 understand this occurs when selecting records from more than one table. In
 my case (with PostgreSQL) every time I use db(...).select(db.table.ALL,
 TOTAL_ROWS, ...) where TOTAL_ROWS = 'COUNT(*) OVER()'.

 --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/l8V3nAzE4Hs/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@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.


Re: [web2py] Re: Virtual fields disapeared from select() results (v2.11.2)

2015-06-09 Thread Paolo Valleri
ok, the fix is here https://github.com/web2py/pydal/pull/211

Paolo

On Tuesday, June 9, 2015 at 10:44:59 AM UTC+2, tim.n...@conted.ox.ac.uk 
wrote:

 Lovely!  I was just about to post this problem.

 On Tuesday, 9 June 2015 07:56:35 UTC+1, Paolo Valleri wrote:

 I see the problem now, thanks for pointing it out.
 I'll post a fix later today.

  Paolo

 2015-06-08 22:11 GMT+02:00 Donatas Burba d.b...@gmail.com:

 This is failing example:

 db=DAL('sqlite:memory')

 db.define_table('tt', 
 Field('vv', 'integer'), 
 Field.Virtual('x', lambda row: row.tt.vv * 10))
 
 db.define_table('tt2', 
 Field('ttref', 'reference tt'),
 Field('vv2', 'integer'))

 tt1 = db.tt.insert(vv='1')
 tt2 = db.tt.insert(vv='3')
 db.tt2.insert(ttref=tt1, vv2='3')
 db.tt2.insert(ttref=tt2, vv2='4')
 
 records = db(db.tt).select(
 db.tt.ALL, db.tt2.ALL,
 join=[db.tt2.on(db.tt2.ttref == db.tt.id)]
 )
 for r in records:
 print r

 Result:

 Row {'tt2': {'ttref': 1L, 'id': 1L, 'vv2': 3L}, 'tt': {'id': 1L, 'vv': 
 1L}}
 Row {'tt2': {'ttref': 2L, 'id': 2L, 'vv2': 4L}, 'tt': {'id': 2L, 'vv': 
 3L}}

 As you can see virtual field 'x' (in table 'tt') is missing. As I 
 understand this occurs when selecting records from more than one table. In 
 my case (with PostgreSQL) every time I use db(...).select(db.table.ALL, 
 TOTAL_ROWS, ...) where TOTAL_ROWS = 'COUNT(*) OVER()'.

 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/l8V3nAzE4Hs/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.




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


[web2py] Re: is this a pydal issue?

2015-06-08 Thread Paolo Valleri
Your are comparing Rows with None.
The question is why?

Normally, you should compare Rows with Rows. 
In pydal we can add a check to raise an error if the second argument isn't 
an instance of Rows.

Paolo

On Monday, June 8, 2015 at 1:03:45 PM UTC+2, Auden RovelleQuartz wrote:

 What does this error mean?

 {
 Ticket ID

 24.211.17.122.2015-06-08.05-34-25.9f6361e2-d387-4cf8-adef-2216ad5c6476
 type 'exceptions.AttributeError' 'NoneType' object has no attribute 
 'records'Versionweb2py™Version 2.11.2-stable+timestamp.2015.05.30.16.33.24
 PythonPython 2.7.3: /usr/bin/python (prefix: /usr)Traceback

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/www-data/web2py/applications/omniavx_cxn/controllers/public.py 
 https://ovxdev.us/admin/default/edit/omniavx_cxn/controllers/public.py, 
 line 3343, in module
   File /home/www-data/web2py/gluon/globals.py, line 412, in lambda
 self._caller = lambda f: f()
   File /home/www-data/web2py/applications/omniavx_cxn/controllers/public.py 
 https://ovxdev.us/admin/default/edit/omniavx_cxn/controllers/public.py, 
 line 920, in signup_captcha
 (op_rec == None) or (op_rec2 == None) or (op_rec3 == None) or (op_rec4 == 
 None)):
   File /home/www-data/web2py/gluon/packages/dal/pydal/objects.py, line 
 2506, in __eq__
 return (self.records == other.records)
 AttributeError: 'NoneType' object has no attribute 'records'

 }


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: is this a pydal issue?

2015-06-08 Thread Paolo Valleri
ok, I get it.
I'll post an update later today to fix the backward compatibility

 Paolo

2015-06-08 13:58 GMT+02:00 Auden RovelleQuartz oves@gmail.com:

 parameter op_rec is set to a session parameter that under normal
 operating conditions is a Rows object

 if a person goes to the page directly (not the normal method) then the
 op_rec parameter would be None and in that case, the code simply
 redirects the person to a function that sets it to the Rows object

 thanks for your response!


 On Monday, June 8, 2015 at 6:48:57 AM UTC-5, Paolo Valleri wrote:

 Your are comparing Rows with None.
 The question is why?

 Normally, you should compare Rows with Rows.
 In pydal we can add a check to raise an error if the second argument
 isn't an instance of Rows.

 Paolo

 On Monday, June 8, 2015 at 1:03:45 PM UTC+2, Auden RovelleQuartz wrote:

 What does this error mean?

 {
 Ticket ID

 24.211.17.122.2015-06-08.05-34-25.9f6361e2-d387-4cf8-adef-2216ad5c6476
 type 'exceptions.AttributeError' 'NoneType' object has no attribute
 'records'Versionweb2py™Version
 2.11.2-stable+timestamp.2015.05.30.16.33.24PythonPython 2.7.3:
 /usr/bin/python (prefix: /usr)Traceback

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File 
 /home/www-data/web2py/applications/omniavx_cxn/controllers/public.py 
 https://ovxdev.us/admin/default/edit/omniavx_cxn/controllers/public.py, 
 line 3343, in module
   File /home/www-data/web2py/gluon/globals.py, line 412, in lambda
 self._caller = lambda f: f()
   File 
 /home/www-data/web2py/applications/omniavx_cxn/controllers/public.py 
 https://ovxdev.us/admin/default/edit/omniavx_cxn/controllers/public.py, 
 line 920, in signup_captcha
 (op_rec == None) or (op_rec2 == None) or (op_rec3 == None) or (op_rec4 
 == None)):
   File /home/www-data/web2py/gluon/packages/dal/pydal/objects.py, line 
 2506, in __eq__
 return (self.records == other.records)
 AttributeError: 'NoneType' object has no attribute 'records'

 }

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


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


[web2py] Re: Virtual fields disapeared from select() results (v2.11.2)

2015-06-07 Thread Paolo Valleri
Hi,
The following works
db=DAL('sqlite:memory')
db.define_table('tt', 
Field('vv', 'integer'), 
Field.Virtual('x', lambda row: row.tt.vv * 10))
db.tt.insert(vv='1')
print db(db.tt).select().first()
printing
Row {'x': 10L, 'id': 1L, 'vv': 1L}
We need more details to understand what is failing in your case. Can you 
post a failing example?

Paolo

On Saturday, June 6, 2015 at 10:23:59 PM UTC+2, Donatas Burba wrote:

 Hello everybody. I am testing my products on web2py v2.11.2 base and have 
 error. I want to ask is it new feature that virtual fields no more exist in 
 Row after select? It means if I have Field.Virtual('x', ...) in my model, 
 after doing db(db.tablename).select() I had this 'x' in results (with 
 web2py v2.10.4), but now it is missing and my code, that depends on virtual 
 field, just breaks.
 And secondly, why aren't funny names not allowed in field names? In 
 search forms I am using one serializeJSON library (for serializing form and 
 making ajax call) so for multiselects I must use names like 'classes[]' in 
 order it would be serialized as array. But this is minor problem for me, I 
 have a workaround already.


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: db define error

2015-06-05 Thread Paolo Valleri
Mind that you have written 
db.define.table
instead of

db.define_table


Paolo

On Friday, June 5, 2015 at 6:26:00 AM UTC+2, Dan Hett wrote:

 I am getting an error for this table creation:

 db.define.table('blade_location',
 Field('bladeID','reference blade'),
 Field('locationID','integer'),
 Field('widgetID','integer'),
 Field('moduleType'))

 Getting this error:

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.

 Traceback (most recent call last):
   File C:\web2py\gluon\restricted.py, line 227, in restricted
 exec ccode in environment
   File C:/web2py/applications/dan/models/db.py 
 http://127.0.0.1:8000/admin/default/edit/dan/models/db.py, line 75, in 
 module
 db.define.table('blade_location',
   File C:\web2py\gluon\packages\dal\pydal\base.py, line 906, in __getattr__
 return super(DAL, self).__getattr__(key)
   File C:\web2py\gluon\packages\dal\pydal\helpers\classes.py, line 348, in 
 __getattr__
 raise AttributeError
 Attr


 Table before this one looks like this:
 db.define_table('blade',
 auth.signature,
 Field('topicID','integer','default=0'),
 Field('layoutType'),
 Field('name'),
 Field('description'),
 Field('rateUp','boolean'),
 Field('rateOK','boolean'),
 Field('rateDown','boolean'),
 Field('views','integer'),
 Field('weight','integer'),
 Field('privateLevel','integer'))

 Any ideas?



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

2015-05-25 Thread Paolo Valleri
This issue has been already 
fixed 
https://github.com/web2py/pydal/commit/2172b776b9c41884717902e68900b41c105e0364#diff-114ce07f361177e0669ec9a374ef7d6a
Have you updated web2py  (and pydal) properly? 

Paolo
On Monday, May 25, 2015 at 7:37:35 AM UTC+2, Mark Graves wrote:

 I seem to be having the same problem. 

 On Sunday, May 24, 2015 at 6:58:26 PM UTC-5, villas wrote:

 Hi All,

 Can someone see what the problem is please?

 db.define_table('tag', Field('name'))
 db.define_table('test',Field('name'),Field('tags','list:reference tag'))

 def test():
 grid = SQLFORM.grid(db.test, user_signature = False)
 return dict(grid=grid)

 Navigate to function test,  try using the grid. Save a record etc and view 
 it.

 Traceback (most recent call last):
   File C:\Users\David\Documents\GitHub\web2py\gluon\restricted.py, line 
 227, in restricted
 exec ccode in environment
   File 
 C:/Users/David/Documents/GitHub/web2py/applications/owners/controllers/default.py
  http://localhost:8000/admin/default/edit/owners/controllers/default.py, 
 line 181, in module
   File C:\Users\David\Documents\GitHub\web2py\gluon\globals.py, line 403, 
 in lambda
 self._caller = lambda f: f()
   File 
 C:/Users/David/Documents/GitHub/web2py/applications/owners/controllers/default.py
  http://localhost:8000/admin/default/edit/owners/controllers/default.py, 
 line 139, in test
 grid = SQLFORM.grid(db.test, fields=[db.test.id,db.test.name], 
 user_signature = False)
   File C:\Users\David\Documents\GitHub\web2py\gluon\sqlhtml.py, line 2252, 
 in grid
 view_form = SQLFORM(table, record, **sqlformargs)
   File C:\Users\David\Documents\GitHub\web2py\gluon\sqlhtml.py, line 1203, 
 in __init__
 inp = represent(field, default, record)
   File C:\Users\David\Documents\GitHub\web2py\gluon\sqlhtml.py, line 68, 
 in represent
 return f(value)
   File 
 C:\Users\David\Documents\GitHub\web2py\gluon\packages\dal\pydal\helpers\methods.py,
  line 268, in __call__
 if isinstance(db._adapter, GoogleDatastoreAdapter):
 TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and 
 types



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: @cache.action not working properly with nginx, is any additional configuration required?

2015-05-20 Thread Paolo Valleri
The web2py part you have posted is more than enough. Did you try it?
memcache with nginx is an other thing


 Paolo

2015-05-20 15:03 GMT+02:00 Lisandro rostagnolisan...@gmail.com:

 Thank you very much for the clarification.

 Do you know about some example of nginx+uwsgi configuration with memcache?
 I've already read this documentation:
 http://web2py.com/books/default/chapter/29/13/deployment-recipes#Memcache
 http://nginx.org/en/docs/http/ngx_http_memcached_module.html

 I've already created the model file models/0_memcache.py with this code:

 from gluon.contrib.memcache import MemcacheClient
 memcache_servers = ['127.0.0.1:11211']
 cache.memcache = MemcacheClient(request, memcache_servers)
 cache.ram = cache.disk = cache.memcache

 But I'm not shure about my nginx virtual host configuration. I'm concerned
 about which should be the proper way of combining all the stuff in the
 nginx's virtual server configuration (by all the stuff I mean, gzip,
 location rules for static content, uwsgi pass, etc).

 This is the actual nginx's virtual server configuration that I've tried,
 but it doesn't work (the website works ok, but still no caching).

 server {
 listen   80;
 server_name  dev.demo;
 root /home/gonguinguen/medios;

 location ~* ^/(\w+)/static(?:/_[\d]+\.[\d]+\.[\d]+)?/(.*)$ {
 alias /home/gonguinguen/medios/applications/$1/static/$2;
 expires max;
 }

 location ~* ^/(\w+)/static/ {
 root /home/gonguinguen/medios/applications;
 expires max;
 }

 location / {
 set$memcached_key $uri?$args;
 memcached_pass 127.0.0.1:11211;
 error_page 404 502 504 = @fallback;

 uwsgi_pass  unix:///tmp/medios.socket;
 include uwsgi_params;
 uwsgi_param UWSGI_SCHEME $scheme;
 uwsgi_param SERVER_SOFTWAREnginx/$nginx_version;
 }

 location @fallback {
 uwsgi_pass  unix:///tmp/medios.socket;
 }
 }




 I don't know where to or how to check if memcache is caching.

 Thanks in advance!



 El miércoles, 20 de mayo de 2015, 9:11:58 (UTC-3), Paolo Valleri escribió:

 this is the correct behavior in a multi-process/multi-thread environment
 because cache.ram is not shared across them.
 use either memcache or redis to have a global cache

 Paolo

 On Wednesday, May 20, 2015 at 1:46:48 PM UTC+2, Lisandro wrote:

 Are there any special consideration about @cache.action in production
 with nginx + uwsgi? I'm having problems using it, so I made a simple test
 to show you.

 In the default welcome application, in default.py controller:

 @cache.action(time_expire=30, cache_model=cache.ram, session=False, vars
 =False, public=True)
 def test():
 return request.now.strftime('%H:%M:%S')

 Now, the first time you hit the /test url, you will see the current
 time.
 But if you inmediately hit the url again, you will see the time shown in
 the first hit. This time will be shown for 30 seconds, that is, the result
 of the function is cached for 30 seconds.

 This works ok with web2py's embedded server.
 However, when I move it to nginx + uwsgi, @cache.action behaves
 strangely:
 1) When I first hit the url, I see the current time.
 2) Three seconds after, I hit the url again, and I don't see cached
 time, instead, I see again the current time.
 3) Three or four seconds after, I hit the url again, and I see the first
 cached time.
 4) I keep hitting the url, and it keeps returning previously cached
 values, randomly. But something is shure: it never returns a value for 30
 seconds, the code is executed at least every 4 o 5 seconds. So in a period
 of 30 seconds, no matter how many times I hit the url, the returned values
 will always differ 4 o 5 seconds between them.

 Am I missing something? Is it necesarry to configure some nginx's stuff?
 I don't think it would be necessary.

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


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


[web2py] Re: @cache.action not working properly with nginx, is any additional configuration required?

2015-05-20 Thread Paolo Valleri
this is the correct behavior in a multi-process/multi-thread environment 
because cache.ram is not shared across them.
use either memcache or redis to have a global cache

Paolo

On Wednesday, May 20, 2015 at 1:46:48 PM UTC+2, Lisandro wrote:

 Are there any special consideration about @cache.action in production with 
 nginx + uwsgi? I'm having problems using it, so I made a simple test to 
 show you.

 In the default welcome application, in default.py controller:

 @cache.action(time_expire=30, cache_model=cache.ram, session=False, vars=
 False, public=True)
 def test():
 return request.now.strftime('%H:%M:%S')

 Now, the first time you hit the /test url, you will see the current time. 
 But if you inmediately hit the url again, you will see the time shown in 
 the first hit. This time will be shown for 30 seconds, that is, the result 
 of the function is cached for 30 seconds.

 This works ok with web2py's embedded server. 
 However, when I move it to nginx + uwsgi, @cache.action behaves strangely:
 1) When I first hit the url, I see the current time.
 2) Three seconds after, I hit the url again, and I don't see cached time, 
 instead, I see again the current time.
 3) Three or four seconds after, I hit the url again, and I see the first 
 cached time.
 4) I keep hitting the url, and it keeps returning previously cached 
 values, randomly. But something is shure: it never returns a value for 30 
 seconds, the code is executed at least every 4 o 5 seconds. So in a period 
 of 30 seconds, no matter how many times I hit the url, the returned values 
 will always differ 4 o 5 seconds between them.

 Am I missing something? Is it necesarry to configure some nginx's stuff? I 
 don't think it would be necessary. 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: AttributeError: 'DAL' object has no attribute

2015-05-14 Thread Paolo Valleri
have you defined the table?
web2py 2.4.* is really old. I suggest upgrading to a newer version

 Paolo

2015-05-14 10:16 GMT+02:00 goome marcs2...@gmail.com:

 from the shell i tried

 legacy_db = DAL('sqlite://rocketdb')
 # it found the db
 fornitori =
 legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper())

 stille give error
 AttributeError: 'DAL' object has no attribute 'fornitori'

 but now this is working calles from the server 
 ??


 Il giorno giovedì 14 maggio 2015 09:38:33 UTC+2, goome ha scritto:

 2.4.6 stable
 No, i cannot reproduce because today when i open the browser it worked!
 By the way, what is the correct way  load the models in the shell?
 i open the shell with
 python web2py -S myapplic
 lanched from the dir of web2py, so that myapplic in under appilcations/



 Il giorno mercoledì 13 maggio 2015 21:14:27 UTC+2, Paolo Valleri ha
 scritto:

 Which web2py version are you using?
 Can you post a complete example that reproduces the issue?

 Paolo

 On Wednesday, May 13, 2015 at 7:14:30 PM UTC+2, goome wrote:

 hello , i have this action in defaul.py
 
 @auth.requires_login()
 def lista_fornitori():
   fornitori =
 legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper())
   return dict(fornitori = fornitori)
 
 and this work perfectly giving me the list of records in table
 'fornitori'

 Now in another action i need to retrieve the same list for creating a
 select,
 but this time the same code
 fornitori = legacy_db().select(legacy_db.fornitori.ALL)
 fails with error
 AttributeError: 'DAL' object has no attribute 'fornitori'

 why in this action DAL does not find the table fornitori? What could be
 the problem.
 The 2 actions are both in default.py

 The beginning of thje second actions:
 def sel_fornitore():
   fornitori = legacy_db(legacy_db.fornitori.ALL).select()

 i also tried from shell with the same error.
 What i am missing?

  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/B-Nqj2CKS-0/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


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


[web2py] Re: AttributeError: 'DAL' object has no attribute

2015-05-13 Thread Paolo Valleri
Which web2py version are you using?
Can you post a complete example that reproduces the issue?

Paolo

On Wednesday, May 13, 2015 at 7:14:30 PM UTC+2, goome wrote:

 hello , i have this action in defaul.py
 
 @auth.requires_login()
 def lista_fornitori():
   fornitori = 
 legacy_db().select(legacy_db.fornitori.ALL,orderby=legacy_db.fornitori.BrandName.upper())
   return dict(fornitori = fornitori)
 
 and this work perfectly giving me the list of records in table 'fornitori'

 Now in another action i need to retrieve the same list for creating a 
 select,
 but this time the same code
 fornitori = legacy_db().select(legacy_db.fornitori.ALL)
 fails with error
 AttributeError: 'DAL' object has no attribute 'fornitori'

 why in this action DAL does not find the table fornitori? What could be 
 the problem.
 The 2 actions are both in default.py

 The beginning of thje second actions:
 def sel_fornitore():
   fornitori = legacy_db(legacy_db.fornitori.ALL).select()

 i also tried from shell with the same error.
 What i am missing?



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Deadlock in cache.py/CacheOnDisk in R 2.10.4

2015-05-12 Thread Paolo Valleri
can you open an issue/pull request on github?

Paolo

On Tuesday, May 12, 2015 at 7:06:47 PM UTC+2, Bernard Letourmy wrote:

 We  found a blocking issue in our app with some image download after 
 upgrading from 2.9.12 to 2.10.4

 It turned out to be a deadlock in CacheOnDisk class in case of exception 
 in our cache callback function, normally handled in our app
 without any issue until now.

 the new file_locks introduced in 2.10.1, (3e46e985bf15) acquired before 
 the cache app callback ( value = f() )
 with self.storage.acquire(CacheAbstract.cache_stats_name) 
 Is never released in case of exception in f()
 then next call to the CacheOnDisk during same request will block the 
 thread indefinitely.

 (CacheInRam should not have the same issue as self.locker.release() is 
 released before f())

 The following patch solves the issue for us.
 Hope it could help

 Bernard
  

 git diff -w  R-2.10.4 cache.py

 *diff --git a/gluon/cache.py b/gluon/cache.py*
 *index f94937d..9729e6b 100644*
 *--- a/gluon/cache.py*
 *+++ b/gluon/cache.py*@@ -473,7 +473,12 @@ class 
 CacheOnDisk(CacheAbstract):
  if item and ((dt is None) or (item[0]  now - dt)):
  value = item[1]
  else:
 +try:
  value = f()
 +except:
 +self.storage.release(CacheAbstract.cache_stats_name)
 +self.storage.release(key)
 +raise
  self.storage[key] = (now, value)
  self.storage.safe_apply(CacheAbstract.cache_stats_name, 
 inc_misses,
  default_value={'hit_total': 0, 
 'misses': 0})



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: invalid literal for int() with base 10: running mongodb

2015-05-10 Thread Paolo Valleri
Hi Ron, please open an issue on https://github.com/web2py/pydal/issues
it seems that mongo adapter doesn't support list:reference table yet

On Sunday, May 10, 2015 at 4:09:51 PM UTC+2, Ron Chatterjee wrote:

 I have the following in model. I get an error invalide literal for int 
 when I add the line Field(comments, list: reference comment). Otherwise 
 it works fine

 db.define_table('Post',

 Field('author'),

 Field('content','Text'),

 Field(tags,list:string),

 Field(comments,list:reference comment),

 Field('date', 'datetime',default=request.now))


  db.define_table(comment,

 Field(created_on,datetime,default=request.now),

 Field(body,text),

 Field(author,reference auth_user))

 posts = db._adapter.connection.posts_three



 ---

 Below is the error I get.


 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.
 16.
 17.
 18.
 19.
 20.

 Traceback (most recent call last):
   File C:\Users\Ron\Desktop\web2py_new\web2py_new\gluon\restricted.py, line 
 227, in restricted
 exec ccode in environment
   File 
 C:/Users/Ron/Desktop/web2py_new/web2py_new/applications/mongo_example1/controllers/appadmin.py
  
 http://127.0.0.1:8000/admin/default/edit/mongo_example1/controllers/appadmin.py,
  line 704, in module
   File C:\Users\Ron\Desktop\web2py_new\web2py_new\gluon\globals.py, line 
 393, in lambda
 self._caller = lambda f: f()
   File 
 C:/Users/Ron/Desktop/web2py_new/web2py_new/applications/mongo_example1/controllers/appadmin.py
  
 http://127.0.0.1:8000/admin/default/edit/mongo_example1/controllers/appadmin.py,
  line 151, in insert
 if form.accepts(request.vars, session):
   File C:\Users\Ron\Desktop\web2py_new\web2py_new\gluon\sqlhtml.py, line 
 1679, in accepts
 self.vars.id = self.table.insert(**fields)
   File 
 C:\Users\Ron\AppData\Local\Enthought\Canopy\User\lib\site-packages\pydal-15.02.27-py2.7.egg\pydal\objects.py,
  line 737, in insert
 ret =  self._db._adapter.insert(self, self._listify(fields))
   File 
 C:\Users\Ron\AppData\Local\Enthought\Canopy\User\lib\site-packages\pydal-15.02.27-py2.7.egg\pydal\adapters\mongo.py,
  line 359, in insert
 values[fieldname] = self.represent(v, fieldtype)
   File 
 C:\Users\Ron\AppData\Local\Enthought\Canopy\User\lib\site-packages\pydal-15.02.27-py2.7.egg\pydal\adapters\mongo.py,
  line 146, in represent
 value = NoSQLAdapter.represent(self, obj, fieldtype)
   File 
 C:\Users\Ron\AppData\Local\Enthought\Canopy\User\lib\site-packages\pydal-15.02.27-py2.7.egg\pydal\adapters\base.py,
  line 1795, in represent
 return map(int,obj)
 ValueError: invalid literal for int() with base 10: 'comment one'



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: MSSQL and auth.signature

2015-05-09 Thread Paolo Valleri
that's odd. Can you open an issue on github 
(https://github.com/web2py/pydal/issues) with a simple example to reproduce 
it? I'll have a look in the next few days

Paolo

On Saturday, May 9, 2015 at 11:54:30 AM UTC+2, Claudinei Fernandes wrote:

 Hi,

 Has anyone used auth.signature attribute with MSSQL database?
 For me it is returning the following error:

 class 'gluon.contrib.pypyodbc.ProgrammingError' (u'42000', u[42000] 
 [Microsoft][ODBC SQL Server Driver][SQL Server]Introducing FOREIGN KEY 
 constraint 'signature_test_modified_by__constraint' on table 
 'signature_test' may cause cycles or multiple cascade paths. Specify ON 
 DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY 
 constraints.)

 Can anyone help me please?


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

2015-05-07 Thread Paolo Valleri
I don't see any problem at all in implementing a common post-comment page 
in web2py.
You can code it independently from the backend. 

On Wednesday, May 6, 2015 at 8:28:08 PM UTC+2, Ron Chatterjee wrote:

 Here is another tutorial from django:


 *http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/
  
 http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/*


 Pretty cool. Wondering if we can have a web2py version implementing the 
 same with mongodb.  Any thoughts any one?



 On Tuesday, May 5, 2015 at 4:49:08 PM UTC-4, Ron Chatterjee wrote:

 I was wondering about creating an object inside an object. As shown in 
 the link above:

 {
   'created_on': ISODate('...'),
   'author_name' : 'Bob',
'author_email': 'b...@example.org javascript:',
   'text' : 'The cake is a lie'
 }


 instead of that dict someone can also write it as:


 {
   'created_on': ISODate('...'),
   'author' : {
 'name': 'Bob',
 'email': 'b...@example.org javascript:'
   },
   'text' : 'The cake is a lie'}



 Django handles with EmbeddedModelField. How does web2py handles that? 
 I am thinking there must be a way.


 On Tuesday, May 5, 2015 at 12:58:48 PM UTC-4, Cássio Botaro wrote:

 Actually DAL have experimental mongodb support.
 You can see 
 http://www.web2pyslices.com/slice/show/1580/save-the-earth-from-a-total-data-mess-with-mongodbadapter



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

2015-05-07 Thread Paolo Valleri
update your local copy of pydal, there are several updates regarding mongo
in master branch


 Paolo

2015-05-07 21:14 GMT+02:00 José Ricardo Borba jrborba...@gmail.com:

 Allright!

 Updating pymongo to version 3.0 solves this up!

 Now I take care of the mongo time / pydal issue!

 Thanks a lot.


 2015-05-07 9:05 GMT-03:00 Paolo Valleri paolo.vall...@gmail.com:

 You should use pymongo 3.0


 On Wednesday, May 6, 2015 at 2:38:56 PM UTC+2, José Borba wrote:

 I'm very busy in these days, but I tried to start a new installation
 from the ground (to test the TIME issue with Mongodb in pydal #170), but
 even without this correction (i.e, with plain web2py clone from github) I
 receive the below error message.

 I'm simply copy the application folder to the new installation
 (side-by-side with welcome and examples). With CLI client (mongo)
 everything works fine.

 The welcome app works fine.

 I see that pydal tries to connect 5 times. The string to connect to
 mongo is fine (since is a local install. In production will have an user
 and a password too...).
 Version  web2py™ Version 2.10.4-stable+timestamp.2015.04.26.09.05.21
 Traceback

 Traceback (most recent call last):
   File /home/mydir/w2p210b/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/mydir/w2p210b/applications/rastreamento/models/db.py 
 http://localhost:8000/admin/default/edit/rastreamento/models/db.py, line 
 12, in module
 db = DAL('mongodb://localhost/telemet', pool_size=0, lazy_tables=True)
   File /home/mydir/w2p210b/gluon/packages/dal/pydal/base.py, line 174, in 
 __call__
 obj = super(MetaDAL, cls).__call__(*args, **kwargs)
   File /mydir/w2p210b/gluon/packages/dal/pydal/base.py, line 459, in 
 __init__
 raise RuntimeError(Failure to connect, tried %d times:\n%s % 
 (attempts, tb))
 RuntimeError: Failure to connect, tried 5 times:
 Traceback (most recent call last):
   File /home/mydir/w2p210b/gluon/packages/dal/pydal/base.py, line 437, in 
 __init__
 self._adapter = ADAPTERS[self._dbname](**kwargs)
   File /home/mydir/w2p210b/gluon/packages/dal/pydal/adapters/base.py, 
 line 57, in __call__
 obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
   File /home/mydir/w2p210b/gluon/packages/dal/pydal/adapters/mongo.py, 
 line 58, in __init__
 from pymongo.write_concern import WriteConcern
   File /home/mydir/w2p210b/gluon/custom_import.py, line 108, in 
 custom_importer
 return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
 ImportError: No module named write_concern




 Best regards,
 --
 José Ricardo Borba

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




 --
 José Ricardo Borba

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


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


[web2py] Re: Issues with PythonAnywhere - /proc/meminfo

2015-05-07 Thread Paolo Valleri
Hi, you have spotted an issue on the new cache system.
I've opened the issue so we can fix it soon. 
https://github.com/web2py/web2py/issues/959

Paolo

On Wednesday, May 6, 2015 at 3:28:44 PM UTC+2, Lovecannon wrote:

 Hello I'm having some issues with web2py and PythonAnywhere. It seems as 
 though the RAM cache function is giving me issues saying that /proc/meminfo 
 cannot be opened. Anyone know of any fixes or workarounds related to this? 
 It triggers randomly and cleaning the application through the admin 
 interface often temporarily fixes the issue.


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

2015-05-07 Thread Paolo Valleri
You should use pymongo 3.0

On Wednesday, May 6, 2015 at 2:38:56 PM UTC+2, José Borba wrote:

 I'm very busy in these days, but I tried to start a new installation 
 from the ground (to test the TIME issue with Mongodb in pydal #170), but 
 even without this correction (i.e, with plain web2py clone from github) I 
 receive the below error message.

 I'm simply copy the application folder to the new installation 
 (side-by-side with welcome and examples). With CLI client (mongo) 
 everything works fine.

 The welcome app works fine.

 I see that pydal tries to connect 5 times. The string to connect to mongo 
 is fine (since is a local install. In production will have an user and a 
 password too...). 
 Version  web2py™ Version 2.10.4-stable+timestamp.2015.04.26.09.05.21  
 Traceback 

 Traceback (most recent call last):
   File /home/mydir/w2p210b/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/mydir/w2p210b/applications/rastreamento/models/db.py 
 http://localhost:8000/admin/default/edit/rastreamento/models/db.py, line 
 12, in module
 db = DAL('mongodb://localhost/telemet', pool_size=0, lazy_tables=True)
   File /home/mydir/w2p210b/gluon/packages/dal/pydal/base.py, line 174, in 
 __call__
 obj = super(MetaDAL, cls).__call__(*args, **kwargs)
   File /mydir/w2p210b/gluon/packages/dal/pydal/base.py, line 459, in 
 __init__
 raise RuntimeError(Failure to connect, tried %d times:\n%s % (attempts, 
 tb))
 RuntimeError: Failure to connect, tried 5 times:
 Traceback (most recent call last):
   File /home/mydir/w2p210b/gluon/packages/dal/pydal/base.py, line 437, in 
 __init__
 self._adapter = ADAPTERS[self._dbname](**kwargs)
   File /home/mydir/w2p210b/gluon/packages/dal/pydal/adapters/base.py, line 
 57, in __call__
 obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
   File /home/mydir/w2p210b/gluon/packages/dal/pydal/adapters/mongo.py, line 
 58, in __init__
 from pymongo.write_concern import WriteConcern
   File /home/mydir/w2p210b/gluon/custom_import.py, line 108, in 
 custom_importer
 return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
 ImportError: No module named write_concern




 Best regards,
 -- 
 José Ricardo Borba

 

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

2015-05-04 Thread Paolo Valleri
It should be fixed in trunk

Paolo

On Saturday, May 2, 2015 at 1:24:32 PM UTC+2, José Borba wrote:

 OK.
 Thank you very much again.

 Cheers.

 2015-05-02 8:22 GMT-03:00 Paolo Valleri paolo@gmail.com javascript:
 :

 Open an issue to don't forget it,I'll fix it in the next few days

 Paolo
 On May 2, 2015 1:18 PM, José Ricardo Borba jrbor...@gmail.com 
 javascript: wrote:

 Paolo,

 Thank you for you quickly response. But I'm working with the latest 
 web2py/Pydal 2.10.4 (downloaded 2.10.3 and updated). I forgot to mention 
 this. I'm sorry.

 My second bet is that the parser of time (the time_itens above) need to 
 be modified to work with time in mongo,

 Still not knowing what is the correct bug (if there are one) to report.

 Cheers,


 2015-05-02 4:23 GMT-03:00 Paolo Valleri paolo@gmail.com 
 javascript::

 Hi, try use the latest version of pydal, Mongo adapter has been 
 recently updated to work with pymongo 3.0
 However, I think this is a bug. Can you open a bug report on 
 https://github.com/web2py/pydal

 Paolo


 On Saturday, May 2, 2015 at 3:58:13 AM UTC+2, José Borba wrote:

 Hi 4 All,

 I'm new to mongoDB and still having some problems with a TIME field. 
 When I set a TIME field in the table, fill the input field of a sqlform 
 (only time is allowed) and send the data to table, all the record is 
 inserted without any warning. But when I try to show in the sqlform, I 
 receive a message:

 pre
 code
   Traceback (most recent call last):
   File /home/xxx.../applications/ras/controllers/appadmin.py, line 
 269, in select
 *fields, limitby=(start, stop))
   File /home/xxx.../gluon/packages/dal/pydal/objects.py, line 2026, 
 in select
 return adapter.select(self.query,fields,attributes)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/mongo.py, line 
 353, in select
 result = processor(rows, fields, newnames, False)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py, line 
 1596, in parse
 value = self.parse_value(value,ft,blob_decode)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py, line 
 1450, in parse_value
 return self.parsemap[key](value,field_type)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py, line 
 1472, in parse_time
 time_items = map(int,str(value)[:8].strip().split(':')[:3])
 ValueError: invalid literal for int() with base 10: '2000-01-'
 /code
 /pre 

 Trying to understand what happened, I'm googled for some info, and 
 found the Mongo adapter code (yes, I didn't tried in my own computer).

 Reading the code (in pydal/adapters/mongo.py), I see a (possible) 
 clue: The lines 148 to 163 is, in some way, weird for my reading. Maybe I 
 misunderstood some point, but this

 pre
 code
 t = datetime.time(0,0,0)
 /code
 /pre 

 is a formatter for a field type DATE, and this 

 pre
 code
 t = datetime.date(2000,1,1)
 /code
 /pre 

 is a formatter for a field type TIME ?

 Best regards, and keep going the invaluable work with this framework.

 -- 
 José Ricardo Borba

   -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are 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 javascript:.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 José Ricardo Borba

  -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/web2py/c8JpvzBHGhE/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@googlegroups.com javascript:.
 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+un...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 José Ricardo Borba

 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from

Re: [web2py] Re: DB2 database issue with Clob types

2015-05-04 Thread Paolo Valleri
well done

 Paolo

2015-05-04 19:35 GMT+02:00 Boris Aramis Aguilar Rodríguez 
boriscou...@gmail.com:

 I've just fixed it :D

 The thing is that those parameters (that fix up the issue with clob types
 and pyodbc) can be passed trough the web2py connection string, so it is now
 as follows:

 db_tivoli =
 DAL('db2:pyodbc://driver=DB2;hostname=IP_OR_HOSTNAME;database=DATABASENAME;\

 uid=USER;pwd=PASSWORD;port=50005;LONGDATACOMPAT=1;LOBMAXCOLUMNSIZE=10485875',
 migrate=False, pool_size=0, attempts=1)

 I'm so happy :)

 El lunes, 4 de mayo de 2015, 10:56:49 (UTC-6), Boris Aramis Aguilar
 Rodríguez escribió:

 Hi, web2py data type is text;

 I see in this post:
 https://groups.google.com/forum/#!searchin/web2py/ODBC$20data$20type$20-99/web2py/6xxz8KXBXCY/pcpdiPQh1K4J
 that it is the normal behavior of web2py, to map text-clob on IBM DB2
 databases.

 Also on the same post they propose a solution editing db2cli.ini file but
 I don't know how to configure db2cli.ini (I mean, I know how to open it,
 where it is but I don't understand which alias should I put on the file)

 Any help I will really appreciate it.

 Thanks!

 El sábado, 25 de abril de 2015, 5:24:41 (UTC-6), Paolo Valleri escribió:

 you should provide us more info...
 which web2py type are you using that is mapped to CLOB field?
 web2py/pyodbc version

 Paolo

 On Friday, April 24, 2015 at 6:17:53 PM UTC+2, Boris Aramis Aguilar
 Rodríguez wrote:

 class pyodbc.Error' ('ODBC data type -99 is not supported. Cannot
 read column LDTEXT.', 'HY000')

 Hi, Im currently accesing a DB2 database (readonly) that is used by
 another application, my connection string is as follows:

 db_tivoli =
 DAL('db2:pyodbc://driver=DB2;hostname=24.50.5.5;database=MAXDB71;uid=on_usr;pwd=pass.;port=50005',
 pool_size=1, db_codec='latin1', migrate=False)

 and everything was going fine until I added a clobdata type to web2py
 data code

 And now I'm getting the error I referenced above (sorry I couldnt paste
 it in order, Im on my phone) Any hints I would appreciate it :)

  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/525AqDpOpio/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@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.


Re: [web2py] Re: MongoDB adapter

2015-05-02 Thread Paolo Valleri
Open an issue to don't forget it,I'll fix it in the next few days

Paolo
On May 2, 2015 1:18 PM, José Ricardo Borba jrborba...@gmail.com wrote:

 Paolo,

 Thank you for you quickly response. But I'm working with the latest
 web2py/Pydal 2.10.4 (downloaded 2.10.3 and updated). I forgot to mention
 this. I'm sorry.

 My second bet is that the parser of time (the time_itens above) need to be
 modified to work with time in mongo,

 Still not knowing what is the correct bug (if there are one) to report.

 Cheers,


 2015-05-02 4:23 GMT-03:00 Paolo Valleri paolo.vall...@gmail.com:

 Hi, try use the latest version of pydal, Mongo adapter has been recently
 updated to work with pymongo 3.0
 However, I think this is a bug. Can you open a bug report on
 https://github.com/web2py/pydal

 Paolo


 On Saturday, May 2, 2015 at 3:58:13 AM UTC+2, José Borba wrote:

 Hi 4 All,

 I'm new to mongoDB and still having some problems with a TIME field.
 When I set a TIME field in the table, fill the input field of a sqlform
 (only time is allowed) and send the data to table, all the record is
 inserted without any warning. But when I try to show in the sqlform, I
 receive a message:

 pre
 code
   Traceback (most recent call last):
   File /home/xxx.../applications/ras/controllers/appadmin.py, line
 269, in select
 *fields, limitby=(start, stop))
   File /home/xxx.../gluon/packages/dal/pydal/objects.py, line 2026, in
 select
 return adapter.select(self.query,fields,attributes)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/mongo.py, line
 353, in select
 result = processor(rows, fields, newnames, False)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py, line
 1596, in parse
 value = self.parse_value(value,ft,blob_decode)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py, line
 1450, in parse_value
 return self.parsemap[key](value,field_type)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py, line
 1472, in parse_time
 time_items = map(int,str(value)[:8].strip().split(':')[:3])
 ValueError: invalid literal for int() with base 10: '2000-01-'
 /code
 /pre

 Trying to understand what happened, I'm googled for some info, and found
 the Mongo adapter code (yes, I didn't tried in my own computer).

 Reading the code (in pydal/adapters/mongo.py), I see a (possible) clue:
 The lines 148 to 163 is, in some way, weird for my reading. Maybe I
 misunderstood some point, but this

 pre
 code
 t = datetime.time(0,0,0)
 /code
 /pre

 is a formatter for a field type DATE, and this

 pre
 code
 t = datetime.date(2000,1,1)
 /code
 /pre

 is a formatter for a field type TIME ?

 Best regards, and keep going the invaluable work with this framework.

 --
 José Ricardo Borba

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




 --
 José Ricardo Borba

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


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


[web2py] Re: MongoDB adapter

2015-05-02 Thread Paolo Valleri
Hi, try use the latest version of pydal, Mongo adapter has been recently 
updated to work with pymongo 3.0
However, I think this is a bug. Can you open a bug report 
on https://github.com/web2py/pydal

Paolo

On Saturday, May 2, 2015 at 3:58:13 AM UTC+2, José Borba wrote:

 Hi 4 All,

 I'm new to mongoDB and still having some problems with a TIME field. When 
 I set a TIME field in the table, fill the input field of a sqlform (only 
 time is allowed) and send the data to table, all the record is inserted 
 without any warning. But when I try to show in the sqlform, I receive a 
 message:

 pre
 code
   Traceback (most recent call last):
   File /home/xxx.../applications/ras/controllers/appadmin.py, line 269, 
 in select
 *fields, limitby=(start, stop))
   File /home/xxx.../gluon/packages/dal/pydal/objects.py, line 2026, in 
 select
 return adapter.select(self.query,fields,attributes)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/mongo.py, line 
 353, in select
 result = processor(rows, fields, newnames, False)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py, line 
 1596, in parse
 value = self.parse_value(value,ft,blob_decode)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py, line 
 1450, in parse_value
 return self.parsemap[key](value,field_type)
   File /home/xxx.../gluon/packages/dal/pydal/adapters/base.py, line 
 1472, in parse_time
 time_items = map(int,str(value)[:8].strip().split(':')[:3])
 ValueError: invalid literal for int() with base 10: '2000-01-'
 /code
 /pre 

 Trying to understand what happened, I'm googled for some info, and found 
 the Mongo adapter code (yes, I didn't tried in my own computer).

 Reading the code (in pydal/adapters/mongo.py), I see a (possible) clue: 
 The lines 148 to 163 is, in some way, weird for my reading. Maybe I 
 misunderstood some point, but this

 pre
 code
 t = datetime.time(0,0,0)
 /code
 /pre 

 is a formatter for a field type DATE, and this 

 pre
 code
 t = datetime.date(2000,1,1)
 /code
 /pre 

 is a formatter for a field type TIME ?

 Best regards, and keep going the invaluable work with this framework.

 -- 
 José Ricardo Borba

 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Any problem in list:reference in 2.10 ?

2015-04-29 Thread Paolo Valleri
Hi,
Can you try the fix I proposed 
in https://github.com/web2py/web2py/issues/946#issuecomment-9661

Paolo

On Tuesday, April 28, 2015 at 9:26:23 PM UTC+2, Ariya Owam-aram wrote:

 Hi Everyone,

 I just upgrade to 2.10.4 and found error message when using filed 
 list:reference.

 APP : welcome 

 DB
 db.define_table('parent', Field('name'))
 db.define_table('student', Field('name'), Field('parent', 'list:reference 
 parent'))

 in APPADMIN
 - from parent table insert : father, mother
 - from student table insert : student1 with select father (or mother or 
 both)
 - open student grid view : return error 
 type 'exceptions.TypeError' isinstance() arg 2 must be a class, type, or 
 tuple of classes and types

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.

 Traceback (most recent call last):
   File /home/www-data/web2py/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/www-data/web2py/applications/welcome/views/appadmin.html 
 https://op4.cacpacific.com/admin/edit/welcome/views/appadmin.html, line 
 175, in module
 {{if ram['bytes']  524287:}}
   File /home/www-data/web2py/gluon/sqlhtml.py, line 3253, in __init__
 r = represent(field, r or [], record)
   File /home/www-data/web2py/gluon/sqlhtml.py, line 68, in represent
 return f(value)
   File /home/www-data/web2py/gluon/packages/dal/pydal/helpers/methods.py, 
 line 268, in __call__
 if isinstance(db._adapter, GoogleDatastoreAdapter):
 TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and 
 types


 Frames

- 

*File /home/www-data/web2py/gluon/restricted.py in restricted at line 227* 
 code arguments variables
- 

*File /home/www-data/web2py/applications/welcome/views/appadmin.html in 
 module at line 175* code arguments variables
- 

*File /home/www-data/web2py/gluon/sqlhtml.py in __init__ at line 3253* 
 code arguments variables
- 

*File /home/www-data/web2py/gluon/sqlhtml.py in represent at line 68* code 
 arguments variables
- 

*File /home/www-data/web2py/gluon/packages/dal/pydal/helpers/methods.py in 
 __call__ at line 268* code arguments variables
Function argument list

(self=pydal.helpers.methods._repr_ref_list object, value=[1L], row=None)
Code listing

263.
264.
265.
266.
267.
268.

269.
270.
271.
272.

if not value:
return None
from ..adapters import GoogleDatastoreAdapter
refs = None
db, id = self.ref._db, self.ref._id
if isinstance(db._adapter, GoogleDatastoreAdapter):

def count(values):
return db(id.belongs(values)).select(id)
rx = range(0, len(value), 30)
refs = reduce(lambda a, b: a  b, [count(value[i:i+30])

Variablesbuiltinisinstancebuilt-in function 
 isinstancedb._adapterpydal.adapters.sqlite.SQLiteAdapter 
objectdbDAL uri=sqlite://storage.sqliteGoogleDatastoreAdapterNone


 Thank you
 Ariya


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Pydal ilike search inside a list of strings?

2015-04-29 Thread Paolo Valleri
Which postgres adapter are you using?
Try 
- contains('%Smith')
and (for case-insensitive query)
- contains('%smith', case_sensitive=False)

Paolo

On Tuesday, April 28, 2015 at 9:26:24 PM UTC+2, Tom Stratton wrote:

 For me, with the postgres adapter, the contains method is only returning 
 information when one of the items in the list is an exact match (case 
 insensitive) for the item I search for.

 so if the list is ['John Doe', 'Michael Smith', 'Karen Jones', 'Anne 
 Baker']

 contains('Michael Smith') returns the row but
 contains('Smith') does not

 I would like to be able to do 
 ('% b%) and get back the row - Matching 'Anne Baker'

 Tom


 On Saturday, April 25, 2015 at 7:15:41 PM UTC-7, Massimo Di Pierro wrote:

 db.tablename.fieldname.contains('whatever')




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: postgres/psychopg2 connect problem -- need help

2015-04-26 Thread Paolo Valleri
you have to setup the user on the new postgres server. You have probably 
restored only the data of the database.

On Sunday, April 26, 2015 at 9:10:11 AM UTC+2, weheh wrote:

 I'm moving my app to a new server. It's running Windows 8.1 (sorry about 
 that, but it can't be avoided for technical reasons). Regardless, I backed 
 up my postgres db on my old server and moved it over to the new server and 
 sucked it into postgres. The db is associated with the same user name and 
 password. Now, however, when I try to start my app, I get the error message:

 Traceback (most recent call last):
   File C:\web2py\gluon\restricted.py, line 224, in restricted
 exec ccode in environment
   File C:/web2py/applications/myapp/models/0_0_globals.py, line 25, in 
 module
 migrate=False,  # enable in production for increased performance
   File C:\web2py\gluon\dal\base.py, line 432, in __init__
 raise RuntimeError(Failure to connect, tried %d times:\n%s % 
 (attempts, tb))
 RuntimeError: Failure to connect, tried 10 times:
 Traceback (most recent call last):
   File C:\web2py\gluon\dal\base.py, line 410, in __init__
 self._adapter = ADAPTERS[self._dbname](**kwargs)
   File C:\web2py\gluon\dal\adapters\base.py, line 47, in __call__
 obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
   File C:\web2py\gluon\dal\adapters\postgres.py, line 144, in __init__
 if do_connect: self.reconnect()
   File C:\web2py\gluon\dal\connection.py, line 113, in reconnect
 self.connection = f()
   File C:\web2py\gluon\dal\adapters\postgres.py, line 142, in connector
 return self.driver.connect(msg,**driver_args)
   File C:\Program Files 
 (x86)\Python27\lib\site-packages\psycopg2\__init__.py, line 164, in connect
 conn = _connect(dsn, connection_factory=connection_factory, 
 async=async)
 OperationalError: FATAL:  password authentication failed for user myuser

 I'm using the same credentials as before. Nothing has changed. psychopg2 
 is installed. The password has been validated multiple times directly in 
 postgres.

 This is all running on web2py 2.9.12-stable+timestamp.2015.01.17.06.11.03 
 (Running on Rocket 1.2.6, Python 2.7.8) 



 Anybody have any ideas how to get this running again? 


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: postgres/psychopg2 connect problem -- need help

2015-04-26 Thread Paolo Valleri
The error says: FATAL:  password authentication failed for user myuser
Given that, as far as I can see it's related to postgres rather than web2py

 Paolo

2015-04-26 10:24 GMT+02:00 weheh richard_gor...@verizon.net:

 Thanks for the response, but no, before restoring the database I created
 the user and the database directly in postgres. Then I ran web2py and got
 the error. Then I restored the database from the old server and ran web2py
 and got the same error. I dropped the database and tried again and got the
 same result.


 On Sunday, April 26, 2015 at 1:14:38 AM UTC-7, Paolo Valleri wrote:

 you have to setup the user on the new postgres server. You have probably
 restored only the data of the database.

 On Sunday, April 26, 2015 at 9:10:11 AM UTC+2, weheh wrote:

 I'm moving my app to a new server. It's running Windows 8.1 (sorry about
 that, but it can't be avoided for technical reasons). Regardless, I backed
 up my postgres db on my old server and moved it over to the new server and
 sucked it into postgres. The db is associated with the same user name and
 password. Now, however, when I try to start my app, I get the error message:

 Traceback (most recent call last):
   File C:\web2py\gluon\restricted.py, line 224, in restricted
 exec ccode in environment
   File C:/web2py/applications/myapp/models/0_0_globals.py, line 25, in
 module
 migrate=False,  # enable in production for increased performance
   File C:\web2py\gluon\dal\base.py, line 432, in __init__
 raise RuntimeError(Failure to connect, tried %d times:\n%s %
 (attempts, tb))
 RuntimeError: Failure to connect, tried 10 times:
 Traceback (most recent call last):
   File C:\web2py\gluon\dal\base.py, line 410, in __init__
 self._adapter = ADAPTERS[self._dbname](**kwargs)
   File C:\web2py\gluon\dal\adapters\base.py, line 47, in __call__
 obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
   File C:\web2py\gluon\dal\adapters\postgres.py, line 144, in __init__
 if do_connect: self.reconnect()
   File C:\web2py\gluon\dal\connection.py, line 113, in reconnect
 self.connection = f()
   File C:\web2py\gluon\dal\adapters\postgres.py, line 142, in connector
 return self.driver.connect(msg,**driver_args)
   File C:\Program Files
 (x86)\Python27\lib\site-packages\psycopg2\__init__.py, line 164, in connect
 conn = _connect(dsn, connection_factory=connection_factory,
 async=async)
 OperationalError: FATAL:  password authentication failed for user
 myuser

 I'm using the same credentials as before. Nothing has changed. psychopg2
 is installed. The password has been validated multiple times directly in
 postgres.

 This is all running on web2py
 2.9.12-stable+timestamp.2015.01.17.06.11.03 (Running on Rocket 1.2.6,
 Python 2.7.8)



 Anybody have any ideas how to get this running again?

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


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


[web2py] Re: DB2 database issue with Clob types

2015-04-25 Thread Paolo Valleri
you should provide us more info...
which web2py type are you using that is mapped to CLOB field?
web2py/pyodbc version

Paolo

On Friday, April 24, 2015 at 6:17:53 PM UTC+2, Boris Aramis Aguilar 
Rodríguez wrote:

 class pyodbc.Error' ('ODBC data type -99 is not supported. Cannot read 
 column LDTEXT.', 'HY000') 

 Hi, Im currently accesing a DB2 database (readonly) that is used by 
 another application, my connection string is as follows: 

 db_tivoli = 
 DAL('db2:pyodbc://driver=DB2;hostname=24.50.5.5;database=MAXDB71;uid=on_usr;pwd=pass.;port=50005',
  
 pool_size=1, db_codec='latin1', migrate=False) 

 and everything was going fine until I added a clobdata type to web2py data 
 code 

 And now I'm getting the error I referenced above (sorry I couldnt paste it 
 in order, Im on my phone) Any hints I would appreciate it :)

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


[web2py] Re: Need support for web2py application with over 1 million users.

2015-04-23 Thread Paolo Valleri
Mind that if you store session in the database/redis you could have 
problems in pages that use components (es: load). Otherwise, it is a good 
starting point.


On Thursday, April 23, 2015 at 6:21:51 PM UTC+2, Derek wrote:

 Barring him sharing that information, what general advice can you give 
 regarding this? 

 For example, should you store sessions in redis and setup squid and nginx 
 on the hosts? How do you handle the migrations, etc?


 On Saturday, April 18, 2015 at 8:26:00 PM UTC-7, Massimo Di Pierro wrote:

 For use to help you we need more info about the architecture. There two 
 ways you can do this.
 1) you can share information on this list and we will all help and 
 everybody will learn. 2) you can ask for private consulting from one of the 
 companies that provide web2py support. If you need advice, please contact 
 me personally.

 Anyway. Web2py is designed to scale horizontally by adding server behind 
 a load balancer. You can increase the number of requests per machine by 
 improving caching. Eventually you hit the database bottleneck. That is a 
 framework independent problem. If that is the problem you want to look into 
 optimizing queries. Some times it can be done and some times it cannot. 
 Some times you have to move to a NoSQL database like Google Cloud Storage 
 or Mongo. 

 Massimo

 On Saturday, 18 April 2015 19:04:54 UTC-5, Sandeep wrote:

 We run major application in India with over 1 million users, and 
 relatively high concurrent users traffic, which spikes twice a day. 
 Recently we are experiencing a lot of troubles in scaling. We would love to 
 get opinion from any consultant who provides support for web2py application 
 in India. Any help in this regard would be appreciated. 



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


[web2py] Re: New error in trunk' s sqlhtml.py: AttributeError: 'SQLCustomType' object has no attribute 'represent'

2015-04-22 Thread Paolo Valleri
Hi, this it should have been fixed
Have you tried with the last trunk? Be sure to update pydal too.

Paolo

On Wednesday, April 22, 2015 at 1:00:04 PM UTC+2, Johann Spies wrote:

 This code work without a problem in
  Version 2.9.12-stable+timestamp.2015.01.17.06.11.03

 but not with the code from the trunk:

 def za_arts_by_journal_by_year():

 db.define_table('za_wos_papers_by_journal_by_year',
 Field('journal', type=citext),
 Field('pubyear', 'integer'),
 Field('articles', 'integer'),
 migrate = False,
 rname = 'isi.za_wos_papers_by_journal_by_year')
 grid = SQLFORM.grid(db.za_wos_papers_by_journal_by_year,
 
 fields=[db.za_wos_papers_by_journal_by_year.journal,
 
 db.za_wos_papers_by_journal_by_year.pubyear,
 
 db.za_wos_papers_by_journal_by_year.articles],
 create = False,
 editable = False,
 details = False,
 deletable = False,
 searchable = False,
 maxtextlength= 200,
 paginate=120,
 
 orderby=~db.za_wos_papers_by_journal_by_year.pubyear|~db.za_wos_papers_by_journal_by_year.articles)
 grid.element('.web2py_counter',replace=None)
 
 where orderby is on line 391.

 The error:

 Traceback (most recent call last):
   File /home/js/web2py/gluon/restricted.py, line 227, in restricted
 exec ccode in environment
   File /home/js/web2py/applications/nkb/controllers/wos_indicators.py 
 http://localhost:8000/admin/default/edit/nkb/controllers/wos_indicators.py, 
 line 818, in module
   File /home/js/web2py/gluon/globals.py, line 393, in lambda
 self._caller = lambda f: f()
   File /home/js/web2py/applications/nkb/controllers/wos_indicators.py 
 http://localhost:8000/admin/default/edit/nkb/controllers/wos_indicators.py, 
 line 391, in za_arts_by_journal_by_year
 
 orderby=~db.za_wos_papers_by_journal_by_year.pubyear|~db.za_wos_papers_by_journal_by_year.articles)
   File /home/js/web2py/gluon/sqlhtml.py, line 2720, in grid
 elif isinstance(field.type, SQLCustomType) and 
 callable(field.type.represent):
 AttributeError: 'SQLCustomType' object has no attribute 'represent'


 I did know how to create an issue on the mercurial trunk but I am not sure 
 about the git repository.  What is the url again?

 Regards
 Johann
 -- 
 Because experiencing your loyal love is better than life itself, 
 my lips will praise you.  (Psalm 63:3)
  

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

2015-04-15 Thread Paolo Valleri
mssql adapters are quite messy.
MSSQL2Adapter is the adapter that uses 'nvarchar' as type, however it 
inherits from MSSQLAdapter, given that it doesn't have the features of 
MSSQL4Adapter.
For backward compatibility I don't think MSSQL2Adapter will be never 
updated to inherits from MSSQL4Adapter.
My suggestion is to create your own adapter, something like that should work
from pydal.adapters import ADAPTERS, MSSQL4Adapter, MSSQL2Adapter
class MyMSSQLAdapter(MSSQL2Adapter, MSSQL4Adapter):
pass

ADAPTERS.update( {
'mymssql': MyMSSQLAdapter
})
db = DAL('mymssql://user:pass@host/database')

Your new adapter will have the types of MSSQL2Adapter, the methods of both.

Paolo

On Wednesday, April 15, 2015 at 3:22:10 AM UTC+2, Ray (a.k.a. Iceberg) 
wrote:

 Hi there,

 Long story short, I am now working in a project with web2py trying to 
 connect to a MSSQL database. My team tends to use the connect string as 
 mssql4://... to take the advantage of the (latest and greatest?) 
 MSSQL4Adapter, however we also notice from the dal source code mssql.py 
 that, MSSQL4Adapter defines string as VARCHAR, while an older 
 MSSQL2Adapter defines string as *N*VARCHAR.

 It seems there is some other opinion in favor of NVARCHAR 
 http://stackoverflow.com/questions/144283/what-is-the-difference-between-varchar-and-nvarchar
  for 
 internationalization reason. But then why the web2py MSSQL4dapter chooses 
 VARCHAR instead of NVARCHAR? Any insight?

 Thanks in advance!

 Regards,
 Ray


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: auth.accessible_query() speedup

2015-04-13 Thread Paolo Valleri
Which backend are you using?
Can you provide the output of the query?

On Sunday, April 12, 2015 at 10:01:17 AM UTC+2, weheh wrote:

 I'm wondering if there's any kind of speedup possible on 
 auth.accessible_query(...) by indexing the various auth tables (like 
 auth.member, auth.group, ...)?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Last version of plugin_wiki?

2015-04-08 Thread Paolo Valleri
plugin_wiki is no longer supported. 
See 
http://www.web2py.com/books/default/chapter/29/03/overview?search=wiki#The-built-in-web2py-wiki

Paolo

On Tuesday, April 7, 2015 at 6:32:09 PM UTC+2, Najtsirk wrote:


 Hi guys,

 where can I get the latest version of plugin_wiki?

 Best,
 K


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Please report here upgrading issues to web2py 2.10.2

2015-04-08 Thread Paolo Valleri
Hi Jim,
Which back-engine are you using? Have you tried with a different one?
Can you pack a simple app that reproduce the issue?

Paolo

On Tuesday, April 7, 2015 at 9:40:29 PM UTC+2, Jim S wrote:

 Just wondering if this is posted in the right place.  Should I be 
 reporting this issue elsewhere?

 -Jim

 On Monday, April 6, 2015 at 9:53:46 AM UTC-5, Jim S wrote:

 Upgraded to

 2.10.3-stable+timestamp.2015.04.02.21.42.07
 (Running on nginx/1.4.6, Python 2.7.6) 

 ...still having the same problem with record versioning.

 -Jim

 On Thursday, April 2, 2015 at 4:37:03 PM UTC-5, Jim S wrote:

 Version 2.10.1-stable+timestamp.2015.04.01.03.27.40

 I have one table with record versioning turned on.  I get the following 
 in my nginx setup...

 nginx 502 Bad Gateway

 Looking in the nginx log I see:

 2015/04/02 15:37:13 [error] 1040#0: *67 upstream prematurely closed 
 connection while reading response header from upstream, client: 
 10.10.2.126, server: ss15, request: POST 
 /contacts/index/edit/contact/5221?district_id=0search_text=steiltag_id=0_signature=81d4b0ab8a5bf5f05de6ed17c6203596d5883f76
  
 HTTP/1.1, upstream: uwsgi://unix:///tmp/web2py.socket:, host: ss15, 
 referrer: 
 https://ss15/contacts/index/edit/contact/5221?district_id=0search_text=steiltag_id=0_signature=81d4b0ab8a5bf5f05de6ed17c6203596d5883f76
 

 If I comment out this line:

 db.contact._enable_record_versioning()

 Then it works fine.

 It works fine on my production server running Version 
 2.9.5-stable+timestamp.2014.03.16.02.35.39

 nginx 1.4.6 on both systems
 uwsgi version 2.0.6 on the system that works
 uwsgi version 2.0.10 on the system exhibiting the problem

 If I run with the built-in rocket server, I see the same behavior.

 Here is the traceback when running on rocket:

 ERROR:Rocket.Errors.Thread-2:Traceback (most recent call last):
   File C:\prod\web2py\gluon\rocket.py, line 1337, in run
 self.run_app(conn)
   File C:\prod\web2py\gluon\rocket.py, line 1838, in run_app
 output = self.app(environ, self.start_response)
   File C:\prod\web2py\gluon\main.py, line 652, in app_with_logging
 ret[0] = wsgiapp(environ, responder2)
   File C:\prod\web2py\gluon\main.py, line 563, in wsgibase
 return wsgibase(new_environ, responder)
   File C:\prod\web2py\gluon\main.py, line 533, in wsgibase
 if request.body:
   File C:\prod\web2py\gluon\globals.py, line 268, in body
 self._body = copystream_progress(self)
   File C:\prod\web2py\gluon\globals.py, line 125, in 
 copystream_progress
 copystream(source, dest, size, chunk_size)
   File C:\prod\web2py\gluon\fileutils.py, line 426, in copystream
 data = src.read(size)

 ValueError: I/O operation on closed file

 Please let me know if you need more information to help with this issue.

 -Jim


 On Wednesday, April 1, 2015 at 11:03:20 AM UTC-5, Massimo Di Pierro 
 wrote:

 Please report here upgrading issues to web2py 2.10.2

 from which version?
 which os?
 which python version?
 what is the problem? complete traceback



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Stupid Question - how do I run the pydal test suite?

2015-04-03 Thread Paolo Valleri
python -m unittest tests

Paolo


On Friday, April 3, 2015 at 7:57:41 AM UTC+2, Tom Stratton wrote:

 I have google for the last hour to try and figure out how to run the 
 unittests in the tests folder for pydal and have come up short.

 Is there something simple I am missing?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: High Memory usage due to uploads_in_blob

2015-04-02 Thread Paolo Valleri
That is a bug because Grid selects the 'hidden' doc_blob field.
Please open an issue on github

Paolo

On Thursday, April 2, 2015 at 11:03:15 AM UTC+2, Mandar Vaze wrote:

 Hi,

 I have an application that uses uploads_in_blob feature as follows :

 db._adapter.uploads_in_blob = True

 This creates an additional column of BYTEA type at the DB Level (I am 
 using postgres, if it matters)

 Here is a sample table (This is just to give you the idea, this is not the 
 exact definition):

 db.define_table('uploaded_docs',
 Field('document_name', 'string', default=''),
 Field('doc', 'upload', label=T('Document'),
   uploadfield=True,
   requires=IS_NOT_EMPTY(
   error_message=T('Select a document to upload'
 ))),
 Field('doc_property1', 'string'),
 Field('doc_property2', 'string'),
 Field('document_date', 'date'),
 Field('status', 'string', default='Open',
   requires=IS_IN_SET(['Draft', 'Approved', 'Under 
 Review'])),
 Field('remarks', 'string', default='')
 )



1. User can upload documents in the doc field (which is the upload 
field)
2. There is some meta data as described by other fields.
3. There is *no restriction on the size* of the document (Customer 
requirement, can't negotiate)


 These documents are shown using SQLFORM.grid widget (automatic pagination, 
 search, all the cool things)

 *Here is the problem* :
 Each time a DB query is run (and results returned to web2py), the *size 
 of each row returned also includes the size of the uploaded document*.
 e.g. If each row has a document of say 5MB, then 20 rows that are returned 
 by default pagination, consumes 100MB
 (I am not sure when this memory is released/GC'ed) So after going thru say 
 5 such queries, memory consumed is 500MB

 I have deployed the app on webfaction, with default memory block of 512MB

 So at this point, the app is killed, resulting into 502-Bad gateway 
 error to the end user.

 Customer may not always download the file, customer may be just looking 
 at the records' metadata, so access to the BLOB isn't needed till user 
 clicks the download link (denoted by file URL)
 When NOT using uploads_in_blob, the uploads folder only contains a 
 filename, and the file actually resides on the disk. IMO the filesystem is 
 accessed only when needed.
 Is there a way to handle BLOB field in similar fashion ? (Access only when 
 needed)

 *Are there any suggestions on how to limit the memory usage ?*
 (The app is already in production, so if I handle this via code changes, 
 this is definitely preferred over data migration)

 Thanks,
 -Mandar


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: High Memory usage due to uploads_in_blob

2015-04-02 Thread Paolo Valleri
Try to 
change https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L2151
with 
filter1 = lambda f: isinstance(f, Field) and f.type != 'blob'

Paolo

On Thursday, April 2, 2015 at 4:20:29 PM UTC+2, Paolo Valleri wrote:

 That is a bug because Grid selects the 'hidden' doc_blob field.
 Please open an issue on github

 Paolo

 On Thursday, April 2, 2015 at 11:03:15 AM UTC+2, Mandar Vaze wrote:

 Hi,

 I have an application that uses uploads_in_blob feature as follows :

 db._adapter.uploads_in_blob = True

 This creates an additional column of BYTEA type at the DB Level (I am 
 using postgres, if it matters)

 Here is a sample table (This is just to give you the idea, this is not 
 the exact definition):

 db.define_table('uploaded_docs',
 Field('document_name', 'string', default=''),
 Field('doc', 'upload', label=T('Document'),
   uploadfield=True,
   requires=IS_NOT_EMPTY(
   error_message=T('Select a document to upload'
 ))),
 Field('doc_property1', 'string'),
 Field('doc_property2', 'string'),
 Field('document_date', 'date'),
 Field('status', 'string', default='Open',
   requires=IS_IN_SET(['Draft', 'Approved', 'Under 
 Review'])),
 Field('remarks', 'string', default='')
 )



1. User can upload documents in the doc field (which is the upload 
field)
2. There is some meta data as described by other fields.
3. There is *no restriction on the size* of the document (Customer 
requirement, can't negotiate)


 These documents are shown using SQLFORM.grid widget (automatic 
 pagination, search, all the cool things)

 *Here is the problem* :
 Each time a DB query is run (and results returned to web2py), the *size 
 of each row returned also includes the size of the uploaded document*.
 e.g. If each row has a document of say 5MB, then 20 rows that are 
 returned by default pagination, consumes 100MB
 (I am not sure when this memory is released/GC'ed) So after going thru 
 say 5 such queries, memory consumed is 500MB

 I have deployed the app on webfaction, with default memory block of 512MB

 So at this point, the app is killed, resulting into 502-Bad gateway 
 error to the end user.

 Customer may not always download the file, customer may be just looking 
 at the records' metadata, so access to the BLOB isn't needed till user 
 clicks the download link (denoted by file URL)
 When NOT using uploads_in_blob, the uploads folder only contains a 
 filename, and the file actually resides on the disk. IMO the filesystem is 
 accessed only when needed.
 Is there a way to handle BLOB field in similar fashion ? (Access only 
 when needed)

 *Are there any suggestions on how to limit the memory usage ?*
 (The app is already in production, so if I handle this via code changes, 
 this is definitely preferred over data migration)

 Thanks,
 -Mandar



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

2015-03-28 Thread Paolo Valleri
Which web2py version was working ? What was the sql output?
As you mentioned, replacing belongs with contains fixed the problem.



On Saturday, March 28, 2015 at 6:53:50 PM UTC+1, Leonardo Pires Felix wrote:

 Not working too on the version for testers, in this case using sqlite. 
 Example:

 db.define_table(business_day,
Field(description, notnull=True),
Field(week_days, list:integer, notnull=True))

 db.business_day.insert(description='first week january 2015', week_days=[3
 ,4])
 1L
  print db(db.business_day.id0).select()
 business_day.id,business_day.description,business_day.week_days
 1,first week january 2015,|3|4|

  db(db.business_day.week_days.belongs([3])).select()
 Rows (0)

  db(db.business_day.week_days.belongs([3]))._select()
 SELECT  business_day.id, business_day.description, 
 business_day.week_days FROM business_day WHERE (business_day.week_days IN 
 ('|3|'));


 Em sábado, 28 de março de 2015 13:27:28 UTC-3, Massimo Di Pierro escreveu:

 Can you please try the for testers version on the web site? Can you 
 provide a simpler example to reproduce the problem?

 On Saturday, 28 March 2015 10:43:56 UTC-5, Leonardo Pires Felix wrote:

 Hi,
 I think on last update the belongs stoped working.
 I've a table that is defined like this:
 db.define_table(regra_entrada,
 Field(descricao, notnull=True, represent=nome, 
 requires=[IS_NOT_EMPTY(), IS_UPPER()]),
 Field(data_inicial, date, widget=SQLFORM.widgets.
 string.widget, represent=campo_date_dia_semana,
   default=request.now.date() + datetime.timedelta(
 days=1), notnull=True),
 Field(data_final, date, notnull=True, widget=SQLFORM
 .widgets.string.widget,
   represent=campo_date_dia_semana),
 # Definido as delimitações abaixo
 Field(modo, integer, widget=SQLFORM.widgets.radio.
 widget, notnull=True,
   represent=lambda v, l: _dic_modo[v] if v is not 
 None else None, requires=IS_IN_SET(_dic_modo)),
 Field(notificacao_sms, boolean, notnull=True, 
 default=True),
 Field(notificacao_email, boolean, notnull=True, 
 default=True),
 Field(turnos, list:integer, represent=lambda l, v: , 
 .join([db.turno(i).sigla for i in l]),
   requires=IS_IN_DB(db, db.turno, multiple=True, 
 label=db.turno._format)))

 Then, it's populated like this:
  print db(db.regra_entrada.id  0).select()
 regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
 regra_entrada.data_final,regra_entrada.modo,regra_entrada.
 notificacao_sms,regra_entrada.notificacao_email,regra_entrada.turnos
 19,OUTRO TESTE,2015-03-25,2015-05-01,0,True,True,|2|3|1|

 The problem is, i'm pretty sure that belongs should be working on this 
 case, as i have already tested it on early versions. But now belongs not 
 work, this is the outpout for belongs of field turnos with 3(that is on 
 the table, on the previous output):
  print db(db.regra_entrada.turnos.belongs([3])).select()
 regra_entrada.id,regra_entrada.descricao,regra_entrada.data_inicial,
 regra_entrada.data_final,regra_entrada.modo,regra_entrada.
 notificacao_sms,regra_entrada.notificacao_email,regra_entrada.turnos



 Maybe something was changed on the version i'm using? Or some specific 
 change to the postgres DAL?


 Web2py version: 2.9.12-stable+timestamp.2015.01.17.06.11.03
 Rocket 1.2.6, Python 2.7.9
 OS: Debian 8(wheezy)
 Postgres: PostgreSQL 9.4.1 on x86_64-unknown-linux-gnu, compiled by 
 gcc-4.9.real (Debian 4.9.2-10) 4.9.2, 64-bit




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Saving Google Maps Markers To Database

2015-03-26 Thread Paolo Valleri
If you have to show the marker (and maybe a tooltip) you can consider to 
use a geojson layer.
I've written an example for leaflet, but the same can be applied to google 
maps (https://developers.google.com/maps/documentation/javascript/datalayer)
https://github.com/ilvalle/w2pgis

For storing the coordinates you have two alternatives:
- storing as double fields (one for latitude, one for longitude)
- storing as one geometry field
The geometry field allows you to run spatial queries.

Paolo

On Thursday, March 26, 2015 at 1:54:00 AM UTC+1, Leonel Câmara wrote:

 My current version is a bit changed but you can use this:

 https://groups.google.com/forum/#!searchin/web2py/location$20picker/web2py/bCGmGAMWhG0/FPEaxH4_pqAJ


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Git Clone : Seems bad first page

2015-03-25 Thread Paolo Valleri
Massimo can we enable static_version in welcome?

On Wednesday, March 25, 2015 at 5:31:15 AM UTC+1, Massimo Di Pierro wrote:

 it should not look like that. Either a css is missing or your browser is 
 caching some old style file (most likely). Try force a reload and check the 
 JS console for errors.

 On Tuesday, 24 March 2015 22:14:49 UTC-5, Vikash Sharma wrote:

 Hi ,

 I have cloned src today from git and found this page. Is this new design 
 or commit by mistake?


 https://lh6.googleusercontent.com/-tQJEK-ma7I8/VRGuc3pRIFI/SYY/5-CUnfMS4S8/s1600/web2py%2Badmin%2Bpage.PNG






-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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.factory adding dynamic form

2015-03-25 Thread Paolo Valleri
To fix the exception 'table already defined' use define_table() with 
redefine=True
see 
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=redefine#redefine

Paolo

On Wednesday, March 25, 2015 at 2:17:45 AM UTC+1, Ramkrishan Bhatt wrote:

 I am looking from templating genrated form through SQLFORM.factory is 
 possible that we can clone of address table Multiple time like one person 
 can have multiple address using add address button. Than submit all 
 together with bulk insert.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: last minute web2py hackaton

2015-03-21 Thread Paolo Valleri
+1

On Friday, March 20, 2015 at 5:57:37 PM UTC+1, Niphlod wrote:

 damn. I should have waited all those months. 

 muhahahaha!

 let's see if money speed up things.

 BTW; I'd have included that with the fix should be included a regression 
 test to make it never happen again, but that's just me




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Ongoing issue with 'Lost connection to MySQL server during query'

2015-03-17 Thread Paolo Valleri
Ian, as mentioned before, with the last trunk a reconnect can be done with
the following:
- db._adapter.close()
- db._adapter.reconnect()
Without the last trunk, try the following:
try:
 db._adapter.close()
except:
 db._adapter.connection = None
db._adapter.reconnect()

but my suggestion is to use the last trunk




 Paolo

2015-03-17 11:02 GMT+01:00 Ian Ryder i.ry...@appichar.com.au:

 The issue sits with the parent method - it calls a method which takes 
 300 seconds, then whatever action is taken with the database in the parent
 method on return blows up.

 I think I've cracked it though - and to get there I had to drop the web2py
 scheduler and write my own so I knew what was going on!

 Anyway, for anyone else in the same situation (unless web2py handles this
 natively down the track), I basically have to reconnect completely, ie:

- db = DAL('mysql://XX@mysql.server/xxx',
fake_migrate=False, pool_size=10)
- define all the tables again
- reload any records I had open in the calling method

 I've written the relevant methods to make it all fairly neat...it's not
 the end of the universe and may be the only way but seems clunky...given
 I've been living with this for 2 or 3 months I'm just happy I have an
 answer that seems properly robust ;)

 On Tuesday, March 17, 2015 at 1:07:06 AM UTC+11, Paolo Valleri wrote:

 your query takes to much time to be executed and the query goes into
 timeout.
 From the log I see that you are running a bulk_insert, you can split it
 into more operations, placing a db.commit between them.
 Mind that in this case the bulk_insert will be executed into few
 transactions.

 Otherwise, you can run a custom bulk_insert based on an executesql
 containing all the inserts.
 let us know more information about the query.

  Paolo

 2015-03-15 2:01 GMT+01:00 Ian Ryder i.r...@appichar.com.au:

 Thanks Paolo - sadly same result :( I'm not using pyDAL, just the usual
 Web2py DAL

 ##
  305
 ##
 Traceback (most recent call last):
   File /home/ianryder/yarpr/web2py/gluon/restricted.py, line 224, in
 restricted
 exec ccode in environment
   File applications/yarpr/models/my_scheduler.py, line 554, in
 module
 PenguinDoer(db_app)
   File applications/yarpr/models/my_scheduler.py, line 468, in
 __init__
 debug_log(sys._getframe().f_code.co_name, None, start=method_start,
 error_details=ee, severity='Fail')
   File applications/yarpr/models/do_debugging.py, line 197, in
 debug_log
 debug_flush()
   File applications/yarpr/models/do_debugging.py, line 201, in
 debug_flush
 db_usage.debug_data.bulk_insert(DebugHandler.debug_records)
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 9425, in
 bulk_insert
 ret = self._db._adapter.bulk_insert(self, items)
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1376, in
 bulk_insert
 return [self.insert(table, item) for item in items]
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1361, in insert
 raise e
 OperationalError: (2006, 'MySQL server has gone away')

 Here's the code:
 self.dbase.commit()
 self.dbase._adapter.close(action=None)
 try:
 # now the long running task - in the test it's a sleep for
 305 seconds.
 run_method(
 *loads(this_task.args, object_hook=self._decode_dict),
 **loads(this_task.vars, object_hook=self._decode_dict))
 #, *passed_vars)
 except Exception as ee:
 self.dbase._adapter.reconnect()
 this_doer = change_status(
 this_doer,
 FAILED,
 'Failed: ' + str(ee)
 )
 this_doer.update_record()
 debug_log(sys._getframe().f_code.co_name, None,
 start=method_start, error_details=ee, severity='Fail')
 raise Exception('Failure during method execution: ' +
 str(ee))

 self.dbase._adapter.reconnect()
 this_doer = change_status(
 this_doer,
 COMPLETED,
 'Normal exit'
 )




 On Sunday, March 15, 2015 at 12:04:04 AM UTC+11, Paolo Valleri wrote:

 Hi,
 first of all use the latest pydal, it contains a fix when trying to
 close 'broken connection'.
 Afterwards, for a proper reconnect in your application you should do:
 - db._adapter.close()
 - db._adapter.reconnect()

 If you are looking for an 'auto-reconnect', namely it will re-execute
 all queries in the broken transaction, I've been working on it, have a look
 at https://github.com/ilvalle/pydal/tree/auto-reconnect
 In this case it will re-execute all commands in the last transaction
 (but if you do a db.commit() before the operation, then it is fine).
 a discussion about this new feature is here: https://groups.google.co
 m/d/topic/web2py-developers/e161iZZmp0Y/discussion
 Finally, I've never tried it with mysql, but it should work since

Re: [web2py] Re: Ongoing issue with 'Lost connection to MySQL server during query'

2015-03-16 Thread Paolo Valleri
your query takes to much time to be executed and the query goes into
timeout.
From the log I see that you are running a bulk_insert, you can split it
into more operations, placing a db.commit between them.
Mind that in this case the bulk_insert will be executed into few
transactions.

Otherwise, you can run a custom bulk_insert based on an executesql
containing all the inserts.
let us know more information about the query.

 Paolo

2015-03-15 2:01 GMT+01:00 Ian Ryder i.ry...@appichar.com.au:

 Thanks Paolo - sadly same result :( I'm not using pyDAL, just the usual
 Web2py DAL

 ##
  305
 ##
 Traceback (most recent call last):
   File /home/ianryder/yarpr/web2py/gluon/restricted.py, line 224, in
 restricted
 exec ccode in environment
   File applications/yarpr/models/my_scheduler.py, line 554, in module
 PenguinDoer(db_app)
   File applications/yarpr/models/my_scheduler.py, line 468, in __init__
 debug_log(sys._getframe().f_code.co_name, None, start=method_start,
 error_details=ee, severity='Fail')
   File applications/yarpr/models/do_debugging.py, line 197, in debug_log
 debug_flush()
   File applications/yarpr/models/do_debugging.py, line 201, in
 debug_flush
 db_usage.debug_data.bulk_insert(DebugHandler.debug_records)
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 9425, in
 bulk_insert
 ret = self._db._adapter.bulk_insert(self, items)
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1376, in
 bulk_insert
 return [self.insert(table, item) for item in items]
   File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1361, in insert
 raise e
 OperationalError: (2006, 'MySQL server has gone away')

 Here's the code:
 self.dbase.commit()
 self.dbase._adapter.close(action=None)
 try:
 # now the long running task - in the test it's a sleep for 305
 seconds.
 run_method(
 *loads(this_task.args, object_hook=self._decode_dict),
 **loads(this_task.vars, object_hook=self._decode_dict)) #,
 *passed_vars)
 except Exception as ee:
 self.dbase._adapter.reconnect()
 this_doer = change_status(
 this_doer,
 FAILED,
 'Failed: ' + str(ee)
 )
 this_doer.update_record()
 debug_log(sys._getframe().f_code.co_name, None,
 start=method_start, error_details=ee, severity='Fail')
 raise Exception('Failure during method execution: ' + str(ee))

 self.dbase._adapter.reconnect()
 this_doer = change_status(
 this_doer,
 COMPLETED,
 'Normal exit'
 )




 On Sunday, March 15, 2015 at 12:04:04 AM UTC+11, Paolo Valleri wrote:

 Hi,
 first of all use the latest pydal, it contains a fix when trying to close
 'broken connection'.
 Afterwards, for a proper reconnect in your application you should do:
 - db._adapter.close()
 - db._adapter.reconnect()

 If you are looking for an 'auto-reconnect', namely it will re-execute all
 queries in the broken transaction, I've been working on it, have a look at
 https://github.com/ilvalle/pydal/tree/auto-reconnect
 In this case it will re-execute all commands in the last transaction (but
 if you do a db.commit() before the operation, then it is fine).
 a discussion about this new feature is here: https://groups.google.
 com/d/topic/web2py-developers/e161iZZmp0Y/discussion
 Finally, I've never tried it with mysql, but it should work since
 an OperationalError is raised.

 Paolo

 On Saturday, March 14, 2015 at 5:50:49 AM UTC+1, Ian Ryder wrote:

 Sorry, formatting was all screwy on the last bit of the OP - 2
 processing running together, one lasting 295 seconds and saving without
 issue, the other lasting 305 seconds and failing because the SQL server has
 gone / isn't reconnected:


 ##
 295#
 ##

 About to save statusClean exit for doer 2928
 ##
 305
 ##
 About to save statusClean exit for doer 2925
 (2013, 'Lost connection to MySQL server during query')
 Traceback (most recent call last):
 File /home/ianryder/yarpr/web2py/gluon/restricted.py, line 224, in
 restricted exec ccode in environment
 File applications/yarpr/models/my_scheduler.py, line 446, in module
 PenguinDoer(db_app)
 File applications/yarpr/models/my_scheduler.py, line 382, in __init__
 debug_log(sys._getframe().f_code.co_name, None, start=method_start,
 job_status=None)
 File applications/yarpr/models/debug_framework.py, line 196, in
 debug_log debug_flush()
 File applications/yarpr/models/debug_framework.py, line 200, in
 debug_flushdb_usage.debug_data.bulk_insert(DebugHandler.debug_records)
 File /home/ianryder/yarpr/web2py/gluon/dal.py, line 9425, in
 bulk_insert ret = self._db

[web2py] Re: Ongoing issue with 'Lost connection to MySQL server during query'

2015-03-14 Thread Paolo Valleri
Hi,
first of all use the latest pydal, it contains a fix when trying to close 
'broken connection'.
Afterwards, for a proper reconnect in your application you should do:
- db._adapter.close()
- db._adapter.reconnect()

If you are looking for an 'auto-reconnect', namely it will re-execute all 
queries in the broken transaction, I've been working on it, have a look 
at https://github.com/ilvalle/pydal/tree/auto-reconnect
In this case it will re-execute all commands in the last transaction (but 
if you do a db.commit() before the operation, then it is fine). 
a discussion about this new feature is 
here: https://groups.google.com/d/topic/web2py-developers/e161iZZmp0Y/discussion
Finally, I've never tried it with mysql, but it should work since 
an OperationalError is raised.

Paolo

On Saturday, March 14, 2015 at 5:50:49 AM UTC+1, Ian Ryder wrote:

 Sorry, formatting was all screwy on the last bit of the OP - 2 processing 
 running together, one lasting 295 seconds and saving without issue, the 
 other lasting 305 seconds and failing because the SQL server has gone / 
 isn't reconnected:


 ## 
 295#
 ## 

 About to save statusClean exit for doer 2928
 ## 
 305
 ##
 About to save statusClean exit for doer 2925
 (2013, 'Lost connection to MySQL server during query')
 Traceback (most recent call last): 
 File /home/ianryder/yarpr/web2py/gluon/restricted.py, line 224, in 
 restricted exec ccode in environment 
 File applications/yarpr/models/my_scheduler.py, line 446, in module 
 PenguinDoer(db_app) 
 File applications/yarpr/models/my_scheduler.py, line 382, in __init__ 
 debug_log(sys._getframe().f_code.co_name, None, start=method_start, 
 job_status=None) 
 File applications/yarpr/models/debug_framework.py, line 196, in 
 debug_log debug_flush() 
 File applications/yarpr/models/debug_framework.py, line 200, in 
 debug_flushdb_usage.debug_data.bulk_insert(DebugHandler.debug_records) 
 File /home/ianryder/yarpr/web2py/gluon/dal.py, line 9425, in bulk_insert 
 ret = self._db._adapter.bulk_insert(self, items)
 File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1376, in bulk_insert 
 return [self.insert(table, item) for item in items] 
 File /home/ianryder/yarpr/web2py/gluon/dal.py, line 1361, in insert
 raise e OperationalError: (2006, 'MySQL server has gone away')

 On Saturday, March 14, 2015 at 8:30:39 AM UTC+11, Ian Ryder wrote:

 Hi, we are using Web2py to do some batch processing of data but from day 
 one have had show-stopping issues with losing connection to MySQL on 
 PythonAnywhere.

 We've refactored the code to be much lighter in terms of batch sizes etc 
 which has made it much closer to perfect but we still have problems.

 Essentially we're going over the 300 second timeout on PA and web2py 
 won't reconnect no matter what we try. We have:

 - tried pool size 10 on the connection
 - tried pool size 0 on the connection
 - db.commit before kicking off the longer process
 - db.close before kicking off the longer process
 - tried reconnecting the entire DB when it drops
 - tried db._adapter.reconnect() when it drops

 Same results every time...the basic steps are: 

 - scheduled method called
 - it calls batch task which loops through happily, constantly working on 
 the database
 - returns to the original method which then tried to close a status 
 record off and that's where it bombs

 Here's some code:
 self.my_pid = this_task.last_doer_pid
 new_doer = {
 'doer_name': self.get_doer_name(this_task.id),
 'task_queue': this_task.id,
 'method_name': this_task.method_name,
 'pid': self.my_pid
 }
 this_doer_id = 
 self.dbase.task_doer.insert(**self.dbase.task_doer._filter_fields(new_doer))
 this_doer = self.dbase.task_doer[this_doer_id]
 this_task.update_record(status=RUNNING, last_doer_id=this_doer.id, 
 doer_name=new_doer['doer_name'])
 self.dbase.commit()

 snip socket handling
 snip method name getting

 if not run_method:
 this_doer.update_record(status=FAILED, status_note='Method %s 
 not implemented' % this_task.method_name)
 self.dbase.commit()
 raise Exception('Method %s not implemented' % 
 this_task.method_name)

 passed_args = passed_vars = None
 # close off the connection so it doesn't drop out during the 
 processing
 self.dbase.commit()
 try:
 run_method(
 *loads(this_task.args, object_hook=self._decode_dict),
 **loads(this_task.vars, object_hook=self._decode_dict)) 
 #, *passed_vars)
 except Exception as ee:
 this_doer.update_record(status=FAILED, status_note='Failed: ' 
 + str(ee))
 debug_log(sys._getframe().f_code.co_name, None, 
 start=method_start, 

[web2py] Re: list reference with ondelete=set null breaking when delete parent

2015-03-10 Thread Paolo Valleri
ondelete is for reference field.
At a first sight, a possible workaround would be to write your own 
'ondelete' by using the _before_delete and _after_delete callbacks

Paolo

On Monday, March 9, 2015 at 7:09:54 PM UTC+1, Ron Chatterjee wrote:

 Wonder if he can try to make it a list and do list.remove?

 Have you tried that?

 On Thursday, March 20, 2014 at 3:07:47 PM UTC-4, Leonel Câmara wrote:

 I think you should have a third table anyway or searches for T-shirts of 
 a given colour will be quite slow.



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Query Production Oracle database using DAL

2015-03-06 Thread Paolo Valleri
Instantiate DAL with migrate=False is enough to guarantee the 
read-only-mode operations.
In addition accessing the db using an user without write permissions is 
better if you only have to dump data.

To copy data from one db to an other, have a look 
at https://github.com/web2py/web2py/blob/master/scripts/cpdb.py

Paolo

On Friday, March 6, 2015 at 12:30:02 AM UTC+1, Michel Krav wrote:

 Hi ,
  
 I need to dump some tables from oracle db let's call it *dbo *into sqlite *db 
  
 *to allow a disconnect/offline mode for an app.

 I' ve already done this stuff using cx_oracle, building a cursor, then my 
 own SQL requests..., now I'm looking to ease those tasks.
 [So no problem to connect oracle dbo using cx_oracle even in web2py]

 But I'm not really sure about how to do it using DAL :

1. Once define connexion to oracle dbo is done : (using lazy_tables=True 
to enhance performance as hundred of table have to be read but not for 
each request)
2. I've read I have to *define_table* manually for each table I want 
to query, (to instantiate table class  and attributes)
3. In the signature of define_table : I plan to secure the *read only 
mode* to *dbo *using* migration = False *and  *fake_migration* = *True 
*in order to never alter the source table : is it correct ? I will specify 
*redefine = False* for the same reason. By the way , I think there's a 
mistake in the online documentation in 

 http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Fixing-broken-migrations
  
: 

db.define_table(,migrate=True,fake_migrate=True)
should be in this context : 
db.define_table(,migrate=False,fake_migrate=True)


4. Once *dbo*.table is available, I should use export_to_csv_file method 
then import_from_csv_file to (re)load *db.table * when needed 
 (synchronisation 
on demand).

 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: Current status of adapting OrientDB for web2py

2015-03-04 Thread Paolo Valleri
Hi, contributions are more than welcome :)
You can start by having a look at those other no-sql adapters 
in https://github.com/web2py/pydal/tree/master/pydal/adapters

Paolo

On Wednesday, March 4, 2015 at 4:27:16 AM UTC+1, Pumplerod wrote:

 I'm curious if anyone has done any more to integrate OrientDB with the 
 DAL.  Or if not, if there is a guide of some sort for creating an adapter.

 I'm beginning to design a site around OrientDB and rather than keeping 
 track of two systems one for Auth and one for the rest of my data it seems 
 like it may easier to create the adapter.


 On Monday, February 13, 2012 at 9:54:05 AM UTC-8, Nolan Nichols wrote:

 I'm researching the nosql and graph database landscape for a web2py 
 application that will require the schema to evolve over time and 
 provide network/graph analysis metrics. 

 I started by looking at the Tinkerpop (http://tinkerpop.com/) stack 
 and the Bulbflow (http://bulbflow.com/) python library for interacting 
 with Tinkerpop graph databases like Neo4j and OrientDB. 

 It looks like there was interest a few months back in adapting 
 OrientDB's sql interface for web2py, and there is an open issue: 

 - http://code.google.com/p/web2py/issues/detail?id=407 

 A few questions: 

 What is the current status of an OrientDB/web2py adapter? 
 Is anyone currently using a graph database with web2py? 
 Any suggestions for using web2py DAI/templates with non-rdbms sources? 

 Cheers, 

 Nolan



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Weird Error Message From Web2py - OSError: [Errno 24] Too many open files ???????

2015-03-04 Thread Paolo Valleri
Massimo, I suggest adding a message when web2py start using internal cron 
in which is stated that cron is no longer supported.
Do you agree ?

On Tuesday, March 3, 2015 at 5:51:50 PM UTC+1, Massimo Di Pierro wrote:

 BTW. We do not support cron anymore since we have the scheduler. Cron 
 causes other problems with locking of resources and memory build-up. It is 
 not necessarily a bug, it is designed to guarantee start of execution not 
 cap resource utilization.

 On Monday, 2 March 2015 11:49:20 UTC-6, AngeloC wrote:

 Hi Yannick, 

 Probably it's a regression with hardcron, if you search the list you 
 can find several thread about that problem. 

 I had it several times in the past and simply I gave up using hard 
 cron in web2py. I ususally use the plain and simple unix cron to 
 schedule activities! 

 Sincerely, Angelo 

 2015-03-02 18:39 GMT+01:00 Massimo Di Pierro massimo@gmail.com 
 javascript:: 
  This usually happens when you open but you do not close connections. It 
 can 
  happen if you put open connections in cache-ram. Do you open many 
 files? 
  
  
  On Monday, 2 March 2015 00:24:57 UTC-6, Yusuf Kaka wrote: 
  
  I've got the same error, was there any resolution? 
  
  On Monday, February 22, 2010 at 2:28:17 AM UTC+2, Pascal wrote: 
  
  Thanks for the note... I'm usually running Web2py through Wing IDE 
  since it is easy for debugging... 
  Please let me know if you have any questions regarding this issue 
  
  Yannick P. 
  
  On Feb 21, 4:02 pm, Massimo Di Pierro mdipie...@cs.depaul.edu 
 wrote: 
   This is interesting I will take a look asap. 
   
   Meanwhile, if you are not using cron, run web2py with -N. 
   
   Massimo 
   
   On Feb 21, 2010, at 1:28 PM, Yannick wrote: 
   
Hello mate, 
I'm using the latest version of Web2py and Mac OS and since few 
web2py 
release I have been having this problem and I don't know what is 
 the 
cause of this... 
When it happens I can't access my application anymore I got a 
 this 
message from the browser: Internal error 
Ticket issued: unrecoverable  
So basicallly I just have to reboot the server to get my appl 
 working 
again... 
   
Here is the exceptions I got from Web2py: 
   
### 
Exception in thread Thread-106: 
Traceback (most recent call last): 
 File 
 /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/threading.py, line 486, in __bootstrap_inner 
   self.run() 
 File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, 
 line 
229, in run 
   shell=self.shell) 
 File 
 /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/subprocess.py, line 587, in __init__ 
   errread, errwrite) = self._get_handles(stdin, stdout, stderr) 
 File 
 /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/subprocess.py, line 953, in _get_handles 
   errread, errwrite = os.pipe() 
OSError: [Errno 24] Too many open files 
 
Exception in thread Thread-107: 
Traceback (most recent call last): 
 File 
 /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/threading.py, line 486, in __bootstrap_inner 
   self.run() 
 File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, 
 line 
229, in run 
   shell=self.shell) 
 File 
 /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/subprocess.py, line 587, in __init__ 
   errread, errwrite) = self._get_handles(stdin, stdout, stderr) 
 File 
 /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/subprocess.py, line 933, in _get_handles 
   p2cread, p2cwrite = os.pipe() 
OSError: [Errno 24] Too many open files 
# 
Exception in thread Thread-1: 
Traceback (most recent call last): 
 File 
 /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/threading.py, line 486, in __bootstrap_inner 
   self.run() 
 File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, 
 line 
55, in run 
   s.run() 
 File 
 /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/sched.py, line 114, in run 
 File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, 
 line 
47, in launch 
   crondance(self.path, 'hard', startup = self.startup) 
 File /Users/OnemeWs/App Server/web2py/gluon/contrib/cron.py, 
 line 
261, in crondance 
   f = open(crontab, 'rt') 
IOError: [Errno 24] Too many open files: 
## 
   
Please any idea ? 
  
  -- 
  Resources: 
  - http://web2py.com 
  - http://web2py.com/book (Documentation) 
  - http://github.com/web2py/web2py (Source code) 
  - https://code.google.com/p/web2py/issues/list (Report Issues) 
  --- 
  You received this message because you are subscribed to the 

[web2py] Re: First post: Is this a bug?

2015-02-22 Thread Paolo Valleri
Can you post an example code?

On Monday, February 23, 2015 at 4:37:31 AM UTC+1, Mat Miles wrote:

 I had a project that a number of tables that reference other tables using 
 MySQL as the DB. I started another project using SQlite and the reference 
 tables did not work. I went over and over the project to see if I had a 
 typo somewhere and could not find one. Finally I converted the table to 
 MSSQL and the references began working. Is this a bug, or is there some 
 configuration option that I am missing when using SQlite?

 What I mean by the reference tables not working is that when you go to 
 create a new record where one of the fields is referencing values in 
 another table, the box would show for the field, but it would display as a 
 text field with no values and not a dropdown list.

 -mat




-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: can't type forward slash in editor

2015-02-21 Thread Paolo Valleri
Hi,
it seems you have spotted a codemirror issue, which has been fixed in the 
new version 4.13.
see https://groups.google.com/d/topic/codemirror-announce/0bPIIIR2M8I/discussion
I'll make a PR to fix it in web2py.

Paolo

On Wednesday, February 18, 2015 at 4:56:04 PM UTC+1, dangne...@juno.com 
wrote:

 Day 1 newbie. I feel I have entered a new wonderland of capabilities, and 
 lucky to have found web2py, with all the noise being made about flask and 
 django. Flask is all now to do this you have to install that and django's 
 awesome documentation made me want to give up. Web2py on the other hand 
 seems to be teaching itself, and the tutorial I'm watching is great. But 
 one problem:

 I typed this html correctly (see closing tags) but this is what shows up 
 on the screen, and I can't save it because web2py knows it's wrong:

 def hello():
 return htmlbodyh1Hello Worldh1bodyhtml

 Neither the forward slash on the main keyboard or the number pad works in 
 the editor:

 http://127.0.0.1:8000/admin/default/edit/app1/controllers/test.py?id=controllers__test__py

 Tested the key, it works. The question mark works in general and on the 
 editor, it types a forward slash anywhere else including the url bar of the 
 same page. I have never encountered this anywhere before.

 I made a different test file in controllers and also a test file in view, 
 no forward slash is possible in either editor.

 Nothing wrong with this keyboard: 
 

 Thanks.

 Scott


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


[web2py] 'emulate' list:double

2015-02-08 Thread Paolo Valleri
I'm trying to 'emulate' list:double using list:string with a validator 
as IS_LIST_OF(IS_FLOAT_IN_RANGE(...)). This works well but the json 
produced by as_json is:
field: [float, float]
I need something like:
field: [float, float]
I achieved it by defining the field as 'json' but I don't like the way I've 
to fill/validate it, namely submitting a json string instead of two floats

Paolo

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Memory leaks in web2py : how do you track them ?

2015-02-01 Thread Paolo Valleri
Hi,
the garbace collector is called once every 100 requests. 
See 
https://github.com/web2py/web2py/blob/5a0ee722605164f1eae4064d0d1dd0d72b5eb14b/gluon/main.py#L197

In addition try to pack a very basic app which can reproduce the issue, 
we'll have more info about what is going on wrong in your app or web2py

Paolo

On Monday, February 2, 2015 at 12:35:50 AM UTC+1, Leonel Câmara wrote:

 If you have pool_size defined can you tell me if putting pool_size=0 in 
 your DAL solves this problem?

 Anyway I got really interested in this, for some unknown to me reason, and 
 decided to create a *VERY CRUDE* decorator to memory check your 
 controller functions for leaks, I guess with time we could refine this if 
 there's a desire to have a memory leak checker for controller functions in 
 web2py. I hope it helps, if it doesn't at least it was fun to code.

  
 def memcheck(f):
 
 A crude decorator to memory check your web2py controller's functions.


 False positives are possible if your controller function returns less 
 than
 common stuff.


 Put it in your models and then decorate your controller functions.


 example:


 @memcheck
 def index():
 response.flash = T(Welcome to web2py!)
 return dict(message=T('Hello World'))


 BEERWARE - You should try to buy Leonel Câmara beers!
 
 from functools import wraps
 from collections import Counter, Mapping, Iterable
 from gluon.languages import lazyT
 from gc import get_objects


 def get_value_objects(v):
 
 Generate an object for each value in a value including itself.
 
 if isinstance(v, basestring):
 yield v
 elif isinstance(v, lazyT):
 yield v
 yield v.s # Check lazyT symbols dict
 for i in v.s:  
 for new_v in get_value_objects(i):
 yield new_v
 elif isinstance(v, Mapping):
 yield v
 for i in v.values():
 for new_v in get_value_objects(i):
 yield new_v
 elif isinstance(v, Iterable):
 yield v
 for i in v:
 for new_v in get_value_objects(i):
 yield new_v
 else:
 yield v


 @wraps(f)
 def wrapper(*args, **kwargs):
 before = Counter(type(obj) for obj in get_objects())
 result = f(*args, **kwargs)
 after = Counter(type(obj) for obj in get_objects())
 result_objs = Counter(type(obj) for obj in get_value_objects(
 result))
 count = after - before - result_objs - Counter([Counter])
 # This and other stuff put in the response or session is not a 
 memory
 # leak.
 # So false positives may appear for what's not accounted here.
 if response.flash: 
 count -= Counter(type(obj) for obj in get_value_objects(
 response.flash))
 if response.js: 
 count -= Counter(type(obj) for obj in get_value_objects(
 response.js))
 
 # Finally we are ready to report what we have found.
 for k in count:
 print 'LEAKED: %d of type %s' % (count[k], k)
 return result


 return wrapper





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: pydal / postgres / jsonb

2015-01-29 Thread Paolo Valleri
@niphlod, an option is to set travis-ci to use postgres 9.4 to tests this
new data type very carefully. I guest it'll be ready as stable soon
https://github.com/travis-ci/travis-ci/issues/2983


 Paolo

2015-01-29 9:34 GMT+01:00 Kiran Subbaraman subbaraman.ki...@gmail.com:

 Opened a request here: https://github.com/web2py/pydal/issues/48. Thanks
 for looking into this.

 On Wednesday, January 28, 2015 at 11:31:08 PM UTC+5:30, Paolo Valleri
 wrote:

 I agree. we should set jsonb as default json data type for pg = 9.4
 I'll provide a patch as soon as possible, in the meanwhile, please open
 an issue on https://github.com/web2py/pydal/issues

 Paolo
 On Tuesday, January 27, 2015 at 6:24:47 PM UTC+1, Kiran Subbaraman wrote:

 Any plans for the the postgres adapter to support *jsonb* type, by
 default, and not the basic json type?
 The *jsonb* type seems to have a lot more capabilities going for it,
 than the basic json type: http://www.postgresql.org/
 docs/devel/static/datatype-json.html
 Indexing support, containment checks, and postgres' recommendation:
 ..most applications should prefer to store JSON data as jsonb.. makes
 this rather attractive to me.
 Any thoughts?

  --
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups web2py-users group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/web2py/3hY4niQu-jY/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


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


[web2py] Re: pydal / postgres / jsonb

2015-01-28 Thread Paolo Valleri
I agree. we should set jsonb as default json data type for pg = 9.4
I'll provide a patch as soon as possible, in the meanwhile, please open an 
issue on https://github.com/web2py/pydal/issues

Paolo
On Tuesday, January 27, 2015 at 6:24:47 PM UTC+1, Kiran Subbaraman wrote:

 Any plans for the the postgres adapter to support *jsonb* type, by 
 default, and not the basic json type?
 The *jsonb* type seems to have a lot more capabilities going for it, than 
 the basic json type: 
 http://www.postgresql.org/docs/devel/static/datatype-json.html
 Indexing support, containment checks, and postgres' recommendation: 
 ..most applications should prefer to store JSON data as jsonb.. makes 
 this rather attractive to me.
 Any thoughts?


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: HELP!! One click upgrade failed for pythonanywhere site

2015-01-21 Thread Paolo Valleri
Hi,
since you have access to the file system, can you check the content of the 
last ticket in the admin error directory?

Paolo

On Wednesday, January 21, 2015 at 5:13:17 PM UTC+1, Omi Chiba wrote:

 Hi, I clicked the upload on admin and tried to upgrade from 2.4.6 to 
 2.9.12. As soon as I clicked I got ticket but cannot see the ticket because 
 now I get a ticket to see the ticket... It means I cannot open admin site. 
 My app is still working fine.

 I don't where to start to fix. Can you guys help?

 I can access web2py folder on pythonanywhere no problem. Worst case, I can 
 delete it and install new and import app which I backup before upgrade.




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


[web2py] Re: error: no such table

2015-01-21 Thread Paolo Valleri
Hi,
why are you using fake_migrate?
it rebuilds web2py metadata.

Paolo
On Thursday, January 22, 2015 at 6:25:10 AM UTC+1, Dmitry Ermolaev wrote:

 class 'sqlite3.OperationalError' no such table: cp_mods
 Versionweb2py™Version 2.9.12-stable+timestamp.2015.01.17.06.11.03PythonPython 
 2.7.8: C:\Python27\python.exe (prefix: C:\Python27)Traceback

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.
 16.
 17.
 18.
 19.

 Traceback (most recent call last):
   File C:\web2py-9-12\gluon\restricted.py, line 224, in restricted
 exec ccode in environment
   File C:/web2py-9-12/applications/bs3b/models/db.py 
 http://127.0.0.1:8000/admin/default/edit/bs3b/models/db.py, line 615, in 
 module
 if len(db(db.cp_mods).select()) == 0:
   File C:\web2py-9-12\gluon\dal\objects.py, line 2066, in select
 return adapter.select(self.query,fields,attributes)
   File C:\web2py-9-12\gluon\dal\adapters\sqlite.py, line 125, in select
 return super(SQLiteAdapter, self).select(query, fields, attributes)
   File C:\web2py-9-12\gluon\dal\adapters\base.py, line 1232, in select
 return self._select_aux(sql,fields,attributes)
   File C:\web2py-9-12\gluon\dal\adapters\base.py, line 1197, in _select_aux
 self.execute(sql)
   File C:\web2py-9-12\gluon\dal\adapters\base.py, line 1319, in execute
 return self.log_execute(*a, **b)
   File C:\web2py-9-12\gluon\dal\adapters\base.py, line 1313, in log_execute
 ret = self.cursor.execute(command, *a[1:], **b)
 OperationalError: no such table: cp_mods


 code:
 db = DAL(sqlite://storage.sqlite, # on PC locals
 folder='applications/shop/databases',
 pool_size=0,
 migrate=True,
 fake_migrate=True,
 check_reserved=['all'],
 )
 db.define_table('cp_mods', # вакансии
 Field('cms', length=30),
 fake_migrate=True,
 redefine=True,
 )
 if len(db(db.cp_mods).select()) == 0:
db.cp_mods.truncate()
db.cp_mods[0] = dict(cms = '_unknown_')
 ===
 my other tables is exist


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


  1   2   3   >