Re: [web2py] Re: GAE Task Queue no longer passes payload to web2py function

2019-05-28 Thread Carl Hunter Roach
Thanks Dave. I’m thinking it must be something of that order too. Time to 
rebuild this project’s yank file.

Carl Hunter Roach
Bisham Barn Owl Group
Middle Thames Conservation Trust
Runnymede Ringing Group

Founder, Midnight 30 Ltd
midnight30.com
Makers of Great Careers


From: web2py@googlegroups.com on behalf of Dave S 
Sent: Tuesday, May 28, 2019 7:10 pm
To: web2py-users
Subject: [web2py] Re: GAE Task Queue no longer passes payload to web2py function



On Tuesday, May 28, 2019 at 4:11:40 AM UTC-7, Carl Hunter Roach wrote:
I installed R-2.15.4.
You are right that I don't get any function parameters in the functions that 
handle my Google tasks.

I am getting a weird error.

In the function handling the Google task that historically worked) the value of 
`request.body` is:
', mode 'w+b' at 0x2b31c3ed9930>

That is weird. For the payload of the Google task I'm passing in some json data.

I can't see where an fdopen value would be coming from.


I'm afraid you've gone beyond my experience.  I haven't used GAE.  I know 
Massimo and some others of the core group have, but you may need to check that 
there isn't something in your YAML that GAE has obsoleted or has always 
considered wrong but tolerated until now.  I know that GG code is tweaked 
fairly often, and given Google's continuous integration strategy, I'd expect 
GAE to be updated frequently as well.

/dps




On Friday, 24 May 2019 21:37:53 UTC+1, Dave S wrote:


On Friday, May 24, 2019 at 3:43:26 AM UTC-7, Carl Hunter Roach wrote:
This code has been working for a couple of years but, for an unknown reason to 
me, has stopped working.

This function continues to create Tasks correctly.

def send_task():
from google.appengine.api import taskqueue
json_data = ...
task = taskqueue.Task(url=..., countdown=2, payload=json_data)
task.add()

The handling url is passed to:

in db.py
openings_service = Service()


in controller...
@openings_service.json
def opening_task_queue():
body_data = request.body.getvalue()

For the last couple of years `body_data` was populated and processing continued.
But last week, without change to my code, request.body was no longer present.

I had been running with Web2py R-2.14.6 but an upgrade to R-2.15.0b2 broke how 
I needed to declare functions.


Ooooh, yuck.  2.15.0b2 is not a good choice; I'm using 2.15.4, and the 2.18.x 
line is much, much better (pending upgrade, but I've been letting other people 
shake the low-hanging fruit off first)



Where I had been using function headings with no parameters:

@openings_service.json
def submit_openings():

I now needed to declare:

@openings_service.json
def submit_openings(openings):

Does anyone know why?
And does that relate to the error I detail at the top of this post?


That change should not be the case.   Functions as URL targets should not have 
parameters, and none of my @auth_requires_login() or @request.restful() uses 
have had to add parameters after the annotation.

/dps


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google 
Groups "web2py-users" group.
To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/web2py/tAd7MgqZ9so/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 
web2py+unsubscr...@googlegroups.com<mailto:web2py+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/22ae6bd1-dbf8-4bfa-bd01-b2448577e509%40googlegroups.com<https://groups.google.com/d/msgid/web2py/22ae6bd1-dbf8-4bfa-bd01-b2448577e509%40googlegroups.com?utm_medium=email&utm_source=footer>.
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/DB7PR03MB42981A6AEB3B72735369C85FA41E0%40DB7PR03MB4298.eurprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: GAE Task Queue no longer passes payload to web2py function

2019-05-28 Thread Carl Hunter Roach
I installed R-2.15.4.
You are right that I don't get any function parameters in the functions 
that handle my Google tasks.

I am getting a weird error.

In the function handling the Google task that historically worked) the 
value of `request.body` is:
', mode 'w+b' at 0x2b31c3ed9930>

That is weird. For the payload of the Google task I'm passing in some json 
data.

I can't see where an fdopen value would be coming from.


On Friday, 24 May 2019 21:37:53 UTC+1, Dave S wrote:
>
>
>
> On Friday, May 24, 2019 at 3:43:26 AM UTC-7, Carl Hunter Roach wrote:
>>
>> This code has been working for a couple of years but, for an unknown 
>> reason to me, has stopped working.
>>
>> This function continues to create Tasks correctly.
>>
>> def send_task():
>> from google.appengine.api import taskqueue
>> json_data = ...
>> task = taskqueue.Task(url=..., countdown=2, payload=json_data)
>> task.add()
>>
>> The handling url is passed to:
>>
>> in db.py
>> openings_service = Service()
>>
>>
>> in controller...
>> @openings_service.json
>> def opening_task_queue():
>> body_data = request.body.getvalue()
>>
>> For the last couple of years `body_data` was populated and processing 
>> continued.
>> But last week, without change to my code, request.body was no longer 
>> present.
>>
>> I had been running with Web2py R-2.14.6 but an upgrade to R-2.15.0b2 
>> broke how I needed to declare functions.
>>
>
>
> Ooooh, yuck.  2.15.0b2 is not a good choice; I'm using 2.15.4, and the 
> 2.18.x line is much, much better (pending upgrade, but I've been letting 
> other people shake the low-hanging fruit off first)
>
>  
>
>>
>> Where I had been using function headings with no parameters:
>>
>> @openings_service.json
>> def submit_openings():
>>
>> I now needed to declare:
>>
>> @openings_service.json
>> def submit_openings(openings):
>>
>> Does anyone know why?
>> And does that relate to the error I detail at the top of this post?
>>
>>
> That change should not be the case.   Functions as URL targets should not 
> have parameters, and none of my @auth_requires_login() or 
> @request.restful() uses have had to add parameters after the annotation.
>
> /dps
>
>

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


[web2py] Re: GAE Task Queue no longer passes payload to web2py function

2019-05-24 Thread Carl Hunter Roach
Thanks for responding dps.

Having found the issue arrive with the R-2.15.0b2 release I did try the latest 
2.18x line. But that too was broken so I went back to R-2.14.6
But then last week the issue started to occur (I hadn’t pushed any code so this 
change is hard to explain, to say the least).

It’s good to hear you don’t have this issue with R-2.15.4. I’ll try that and 
see if it bears fruit.

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


Re: [web2py] Re: retrieving json field from db (GAE)

2019-03-04 Thread Carl Hunter Roach
hi Leonel.

I'm not added a Web2py/Pydal github-collabator but I have made your
suggested changes to a copy of PyDal and those changes did address my
problem.

I added an issue as requested:
https://github.com/web2py/web2py/issues/2121

but now I've tried out the fix I see that I should have posted to pydal
instead. Apologies for that.


On Sun, 3 Mar 2019 at 08:09, Massimo Di Pierro 
wrote:

> if we broke this, it was not intentional. Please open a ticket about this
> so we can track it. It will be fixed asap
>
> On Friday, 1 March 2019 04:17:44 UTC-8, Carl Hunter Roach wrote:
>>
>> In a db table I have:
>>
>> Field('address', 'json', custom_qualifier={'indexed':False}
>>
>> I retrieve an entry thus:
>>
>> geo_address_row = db(db.geo_address.latlonkey == latlonkey).select(db.
>> geo_address.latlonkey).first()
>>
>>
>> I could access the json data via `geo_address_row.address` as a dict.
>>
>> but then I updated from web2py v2.14.6 to v2.18.2
>>
>> and `geo_address_row.address` is now a str rather than a dict and I need
>> to wrap it thus: `json.loads(geo_address_row.address)`
>>
>> I suspect I've been living with an error that has, by undefined chance,
>> worked; and that Web2py has now closed that bug and caught me out.
>>
>> Have I given enough information for anyone to provide an insight?
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/lstHGGuaBR8/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.
>


-- 
Carl Hunter Roach
Bisham Barn Owl Group <http://bishambarnowlgroup.blogspot.com/>
Runnymede Ringing Group <https://www.runnymederinging.uk/>

Founder of Midnight 30 <https://midnight30.com>
Download Great Careers app
<https://itunes.apple.com/us/app/great-careers-job-search-on-your-side/id977007868?ls=1&mt=8>
Jobs at great companies you can commute to.

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

2019-03-03 Thread Carl Hunter Roach
I've added this as an issue.
https://github.com/web2py/web2py/issues/2122

On Sun, 3 Mar 2019 at 08:05, Massimo Di Pierro 
wrote:

> Can you please open a ticket about this?
>
> On Friday, 1 March 2019 04:07:28 UTC-8, Carl Hunter Roach wrote:
>>
>> I've been remiss and skipped too may Web2py updates.
>>
>> I've now updated from web2py v2.14.6 to web2py v2.18.2
>>
>> db.py
>>
>> openings_service = Service()
>>
>> controller.py
>>
>> @openings_service.json
>> def submit_openings():
>> ...
>>
>>
>> An external program calls my Web2py service and the function
>> submit_openings()
>> The caller has passed in a parameter and even though my `def` doesn't
>> define a parameter I was able to access the required parameter via `request`
>>
>> After the update to Web2py 2.18.2 the call no longer succeeds.
>>
>> TypeError: submit_openings() takes no arguments (1 given)
>>
>> I can see why this no longer works and the fix is simple; redefine the
>> `def` in my code as:
>>
>> @openings_service.json
>> def submit_openings(openings):
>>
>>
>> But I'd like to know what changed in Web2py? Mainly to confirm that I am
>> using Web2py correctly.
>>
>> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.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/G-_M0yNe5wc/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.
>


-- 
Carl Hunter Roach
Bisham Barn Owl Group <http://bishambarnowlgroup.blogspot.com/>
Runnymede Ringing Group <https://www.runnymederinging.uk/>

Founder of Midnight 30 <https://midnight30.com>
Download Great Careers app
<https://itunes.apple.com/us/app/great-careers-job-search-on-your-side/id977007868?ls=1&mt=8>
Jobs at great companies you can commute to.

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

2018-11-05 Thread Carl Hunter Roach
thanks Dave.
I wasn't Base64 encoding it myself. The "=" is there in the string returned 
by Google Talent Solution. Perhaps they've Base64 encoded it.
For now, I am percent-encoding/decoding it. It looks like it's nothing do 
to with Web2py but I'd still like to know what is tripping loads() up. 
Probably never will :)

On Monday, 5 November 2018 07:04:16 UTC, Dave S wrote:
>
>
>
> On Sunday, November 4, 2018 at 5:06:33 AM UTC-8, Carl Hunter Roach wrote:
>>
>> As suspected, my workaround was to URL encode the "offending" fields at 
>> the client end. simpleton.loads() then parsed the json happily. The field 
>> could then be "unencoded".
>>
>> My system has plenty of json passing between clients and the Web2py 
>> service. I can't work out why I've tripped over here.
>>
>>
> If that value is Base64 encoded, the "=" is a part of the encoding that is 
> used for padding when the length of the original string doesn't fill the 
> last set of encoding bytes (looking at WP for Base64,  len(S) % 4 != 0).
>
> /dps
>  
>
>>
>> On Saturday, 3 November 2018 19:04:20 UTC, Carl Hunter Roach wrote:
>>>
>>> I've had a stable web2py-based service for some years now.
>>> But it broke today with a small change in a data value - that's my 
>>> working hypothesis.
>>>
>>> The output of the print statement (see code below):
>>>
>>> >> {'{"sort":"relevancy","longitude":-0.1228710438544765,"keywords":"parrot","latitude":51.51158325978085,"page_cursor":"A2ebAAFVVvv0OW53MHyzU0VWVVBxb0tiUW9oWkd0UHMzU09aUjIwYUFBPT0jMTA':
>>>  
>>> '"}'}>
>>>
>>>
>>> The value of "page_cursor" sent by the caller is "page_cursor" : 
>>> "A2ebAAFVVvv0OW53MHyzU0VWVVBxb0tiUW9oWkd0UHMzU09aUjIwYUFBPT0jMTA=' i.e. 
>>> there is an "=" suffix. But by the time my controller receives the 
>>> json structure the "=" has been mangled. This obviously defeats the 
>>> simplejson loads function as the data is no longer valid json. Previous to 
>>> today page_cursor values have been more straightforward and not included a 
>>> "=" character and the code has executed fine.
>>>
>>> Any suggestions? A fix or a different approach to parsing 
>>> request.post_vars
>>>
>>> The call is to: https://…/api/v1/article_search
>>>
>>> The code excerpts:
>>>
>>> app/controller.py
>>>
>>> @articles_service.json
>>> def get_article():
>>> from applications.app.modules.article import get_articles
>>> print(request.post_vars)
>>> return get_articles(request.post_vars)
>>>
>>> app/modules/article.py
>>>
>>> def get_articles(json_fields):
>>> '''
>>> get with a JSON interface
>>> '''
>>> from gluon.contrib.simplejson import loads
>>> fields = {}
>>> for i in json_fields.keys():
>>> fields = loads(i) # crashes here.
>>> return …
>>>
>>> routes.py
>>>
>>> routes_in = (  ('/api/v1/$anything', 
>>> '/app/controller/call/json/$anything')  )
>>> routes_out = [(x, y) for (y, x) in routes_in]
>>>
>>>
>>>

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

2018-11-04 Thread Carl Hunter Roach
As suspected, my workaround was to URL encode the "offending" fields at the 
client end. simpleton.loads() then parsed the json happily. The field could 
then be "unencoded".

My system has plenty of json passing between clients and the Web2py 
service. I can't work out why I've tripped over here.


On Saturday, 3 November 2018 19:04:20 UTC, Carl Hunter Roach wrote:
>
> I've had a stable web2py-based service for some years now.
> But it broke today with a small change in a data value - that's my working 
> hypothesis.
>
> The output of the print statement (see code below):
>
>  {'{"sort":"relevancy","longitude":-0.1228710438544765,"keywords":"parrot","latitude":51.51158325978085,"page_cursor":"A2ebAAFVVvv0OW53MHyzU0VWVVBxb0tiUW9oWkd0UHMzU09aUjIwYUFBPT0jMTA':
>  
> '"}'}>
>
>
> The value of "page_cursor" sent by the caller is "page_cursor" : 
> "A2ebAAFVVvv0OW53MHyzU0VWVVBxb0tiUW9oWkd0UHMzU09aUjIwYUFBPT0jMTA=' i.e. 
> there is an "=" suffix. But by the time my controller receives the 
> json structure the "=" has been mangled. This obviously defeats the 
> simplejson loads function as the data is no longer valid json. Previous to 
> today page_cursor values have been more straightforward and not included a 
> "=" character and the code has executed fine.
>
> Any suggestions? A fix or a different approach to parsing request.post_vars
>
> The call is to: https://…/api/v1/article_search
>
> The code excerpts:
>
> app/controller.py
>
> @articles_service.json
> def get_article():
> from applications.app.modules.article import get_articles
> print(request.post_vars)
> return get_articles(request.post_vars)
>
> app/modules/article.py
>
> def get_articles(json_fields):
> '''
> get with a JSON interface
> '''
> from gluon.contrib.simplejson import loads
> fields = {}
> for i in json_fields.keys():
> fields = loads(i) # crashes here.
> return …
>
> routes.py
>
> routes_in = (  ('/api/v1/$anything', 
> '/app/controller/call/json/$anything')  )
> routes_out = [(x, y) for (y, x) in routes_in]
>
>
>

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

2018-11-03 Thread Carl Hunter Roach
I've had a stable web2py-based service for some years now.
But it broke today with a small change in a data value - that's my working 
hypothesis.

The output of the print statement (see code below):




The value of "page_cursor" sent by the caller is "page_cursor" : 
"A2ebAAFVVvv0OW53MHyzU0VWVVBxb0tiUW9oWkd0UHMzU09aUjIwYUFBPT0jMTA=' i.e. 
there is an "=" suffix. But by the time my controller receives the 
json structure the "=" has been mangled. This obviously defeats the 
simplejson loads function as the data is no longer valid json. Previous to 
today page_cursor values have been more straightforward and not included a 
"=" character and the code has executed fine.

Any suggestions? A fix or a different approach to parsing request.post_vars

The call is to: https://…/api/v1/article_search

The code excerpts:

app/controller.py

@articles_service.json
def get_article():
from applications.app.modules.article import get_articles
print(request.post_vars)
return get_articles(request.post_vars)

app/modules/article.py

def get_articles(json_fields):
'''
get with a JSON interface
'''
from gluon.contrib.simplejson import loads
fields = {}
for i in json_fields.keys():
fields = loads(i) # crashes here.
return …

routes.py

routes_in = (  ('/api/v1/$anything', 
'/app/controller/call/json/$anything')  )
routes_out = [(x, y) for (y, x) in routes_in]


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

2017-09-05 Thread Carl Hunter Roach
placing the tlslite directly in applications/appname/modules enables import 
statements to resolve correctly (just as the manual states! :)
I had incorrectly placed it one level lower to group some other files 
together.


On Monday, 4 September 2017 18:28:48 UTC+1, Carl Hunter Roach wrote:
>
> I'd like to use 
> https://github.com/freshplanet/AppEngine-SocketPool/tree/master/tlslite 
> in a GAE/Web2py project
>
> If I place tlslite in my apps `modules` directory I can then add imports 
> such as `from applications.appname.modules.tlslite import ...`
>
> but tlslite's python source has many `import` statements.
>
> do I need to change each `import` statement to include the path 
> `applications.appname.modules. etc` ?
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] how to import a package that has deeply nested imports

2017-09-04 Thread Carl Hunter Roach
I'd like to 
use https://github.com/freshplanet/AppEngine-SocketPool/tree/master/tlslite 
in a GAE/Web2py project

If I place tlslite in my apps `modules` directory I can then add imports 
such as `from applications.appname.modules.tlslite import ...`

but tlslite's python source has many `import` statements.

do I need to change each `import` statement to include the path 
`applications.appname.modules. etc` ?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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: Documenting a file with sphinx, that has local_import in it

2017-08-08 Thread Carl Hunter Roach
Thanks Richard.
Are you using an alernative to Sphinx with your web2py projects?
I've tried epydoc which is straightforward but I found  its docstring
format a little labourious.

On Tue, 8 Aug 2017 at 18:24, Richard Vézina 
wrote:

> I look at sphinx a long time ago, so you kind of lost me now... But I
> tought after I press send that fact that web2py doc is available with
> readthedoc which is (correct me if I am wrong) base on sphinx, so web2py is
> suppose to work with sphinx... But web2py apps, I guess it another story,
> for some of the reasons you mention... About request and other web2py
> environnement objects maybe you can work something base on this workaround
> related to IDE :
>
>
> http://web2py.com/books/default/chapter/29/14/other-recipes#Using-general-purpose-IDEs-with-web2py
>
> On Tue, Aug 8, 2017 at 12:39 PM, Carl Hunter Roach 
> wrote:
>
>> thanks Richard.
>>
>> I saw the changelog thanking Niphold wrt docstrings but only found
>> Massimo's suggestion of additional code to add to each .py file to get
>> Sphinx to "find" all my project files.
>>
>> Off the bat, after I point Sphinx at gluon, I get errors about request,
>> current et al not being found. This is what I expected given web2py's
>> architecture. I'm just on the hunt for a workaround.
>>
>> I see that gluon/packages/dal has Sphinx definition files but these, I
>> don't think, provide clues to how to deal with request et al. And gluon
>> itself doesn't have Sphinx config files so, perhaps, Sphinx-support has a
>> way to go?
>>
>>
>> On Tue, 8 Aug 2017 at 16:51 Richard Vézina 
>> wrote:
>>
>>> I think web2py is sphinx compliant now, I recall that Simone (Niphold)
>>> had refactor docstring to do so... To be confirmed...
>>>
>>> Richard
>>>
>>> On Tue, Aug 8, 2017 at 11:06 AM, Carl Hunter Roach >> > wrote:
>>>
>>>> Is this still the recommended workaround to get Sphinx to generate
>>>> documentation for projects built upon Web2py?
>>>>
>>>>
>>>>
>>>> On Saturday, 28 May 2011 16:18:42 UTC+1, Massimo Di Pierro wrote:
>>>>>
>>>>> controllers and models in web2py are written in python but are not
>>>>> python modules. They use objects
>>>>> (request,response,...,local_import,...) that are not imported.
>>>>>
>>>>> Sphinx does not understand this.
>>>>>
>>>>> I am sure there is a way around (for example add to your models and
>>>>> controllers:
>>>>>
>>>>> if 1:
>>>>> from gluon import *
>>>>> request,response,session,cache,T = \
>>>>>current.request,current.response,
>>>>>current.session,current.cache,current.T
>>>>> from gluon.compileapp import local_import_aux as local_import
>>>>>
>>>>> ) but I cannot say for sure without details about what you are trying
>>>>> to do.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On May 28, 3:47 am, Vasil Petkov  wrote:
>>>>> > Hello!
>>>>> >
>>>>> > I use web2py 1.94 on Ubuntu with Python 2.7 and Sphinx 1.0.7. For
>>>>> the
>>>>> > documentation purposes, i have created a 'doc'-directory inside my
>>>>> > web2py-application. My web2py project has the following structure:
>>>>> >
>>>>> > web2py
>>>>> >|_ server
>>>>> >|  |_ applications
>>>>> >||_ init
>>>>> >|| |_ controllers
>>>>> >||   |_ myapp.py
>>>>> >   ... ...
>>>>> >||_ modules
>>>>> >|  |_ xml2obj.py
>>>>> >   ...
>>>>> >|_ doc
>>>>> >
>>>>> > When i try to generate documentation for the myapp.py-file with
>>>>> > sphinx, i get the following warning:
>>>>> >
>>>>> >  Traceback (most recent call
>>>>> > last):
>>>>> >   File
>>>>> "/usr/local/lib/python2.7/dist-packages/Sphinx-1.0.7-py2.7.egg/
>>>>> > sphinx/ext/autodoc.py", line 329, in import_object
>>>>> > __import__(self.modname)
&g

Re: [web2py] Re: Documenting a file with sphinx, that has local_import in it

2017-08-08 Thread Carl Hunter Roach
thanks Richard.

I saw the changelog thanking Niphold wrt docstrings but only found
Massimo's suggestion of additional code to add to each .py file to get
Sphinx to "find" all my project files.

Off the bat, after I point Sphinx at gluon, I get errors about request,
current et al not being found. This is what I expected given web2py's
architecture. I'm just on the hunt for a workaround.

I see that gluon/packages/dal has Sphinx definition files but these, I
don't think, provide clues to how to deal with request et al. And gluon
itself doesn't have Sphinx config files so, perhaps, Sphinx-support has a
way to go?


On Tue, 8 Aug 2017 at 16:51 Richard Vézina 
wrote:

> I think web2py is sphinx compliant now, I recall that Simone (Niphold) had
> refactor docstring to do so... To be confirmed...
>
> Richard
>
> On Tue, Aug 8, 2017 at 11:06 AM, Carl Hunter Roach 
> wrote:
>
>> Is this still the recommended workaround to get Sphinx to generate
>> documentation for projects built upon Web2py?
>>
>>
>>
>> On Saturday, 28 May 2011 16:18:42 UTC+1, Massimo Di Pierro wrote:
>>>
>>> controllers and models in web2py are written in python but are not
>>> python modules. They use objects
>>> (request,response,...,local_import,...) that are not imported.
>>>
>>> Sphinx does not understand this.
>>>
>>> I am sure there is a way around (for example add to your models and
>>> controllers:
>>>
>>> if 1:
>>> from gluon import *
>>> request,response,session,cache,T = \
>>>current.request,current.response,
>>>current.session,current.cache,current.T
>>> from gluon.compileapp import local_import_aux as local_import
>>>
>>> ) but I cannot say for sure without details about what you are trying
>>> to do.
>>>
>>>
>>>
>>>
>>>
>>> On May 28, 3:47 am, Vasil Petkov  wrote:
>>> > Hello!
>>> >
>>> > I use web2py 1.94 on Ubuntu with Python 2.7 and Sphinx 1.0.7. For the
>>> > documentation purposes, i have created a 'doc'-directory inside my
>>> > web2py-application. My web2py project has the following structure:
>>> >
>>> > web2py
>>> >|_ server
>>> >|  |_ applications
>>> >||_ init
>>> >|| |_ controllers
>>> >||   |_ myapp.py
>>> >   ... ...
>>> >||_ modules
>>> >|  |_ xml2obj.py
>>> >   ...
>>> >|_ doc
>>> >
>>> > When i try to generate documentation for the myapp.py-file with
>>> > sphinx, i get the following warning:
>>> >
>>> >  Traceback (most recent call
>>> > last):
>>> >   File "/usr/local/lib/python2.7/dist-packages/Sphinx-1.0.7-py2.7.egg/
>>> > sphinx/ext/autodoc.py", line 329, in import_object
>>> > __import__(self.modname)
>>> >   File "/home/vpetkov/Documents/web2py/server/applications/init/
>>> > controllers/myapp.py", line 16, in 
>>> > xml2obj = local_import('xml2obj', reload=False)
>>> > NameError: name 'local_import' is not defined
>>> >
>>> > /home/vpetkov/Documents/web2py/server/doc/myapp.rst:7: (WARNING/2)
>>> > autodoc can't import/find module 'myapp', it reported error: "name
>>> > 'local_import' is not defined", please check your spelling and
>>> > sys.path
>>> >
>>> > Additionally. in conf.py Sphinx file, i added
>>> > sys.path.append(os.path.abspath('../applications/init/modules/'))
>>
>> --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>>
> You received this message because you are subscribed to the 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/cYQTCXeGVdU/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.
>
-- 
Carl D Hunter Roach
Bisham Barn Owl Group
Runnymede Ringing 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: Documenting a file with sphinx, that has local_import in it

2017-08-08 Thread Carl Hunter Roach
Is this still the recommended workaround to get Sphinx to generate 
documentation for projects built upon Web2py?



On Saturday, 28 May 2011 16:18:42 UTC+1, Massimo Di Pierro wrote:
>
> controllers and models in web2py are written in python but are not 
> python modules. They use objects 
> (request,response,...,local_import,...) that are not imported. 
>
> Sphinx does not understand this. 
>
> I am sure there is a way around (for example add to your models and 
> controllers: 
>
> if 1: 
> from gluon import * 
> request,response,session,cache,T = \ 
>current.request,current.response, 
>current.session,current.cache,current.T 
> from gluon.compileapp import local_import_aux as local_import 
>
> ) but I cannot say for sure without details about what you are trying 
> to do. 
>
>
>
>
>
> On May 28, 3:47 am, Vasil Petkov  wrote: 
> > Hello! 
> > 
> > I use web2py 1.94 on Ubuntu with Python 2.7 and Sphinx 1.0.7. For the 
> > documentation purposes, i have created a 'doc'-directory inside my 
> > web2py-application. My web2py project has the following structure: 
> > 
> > web2py 
> >|_ server 
> >|  |_ applications 
> >||_ init 
> >|| |_ controllers 
> >||   |_ myapp.py 
> >   ... ... 
> >||_ modules 
> >|  |_ xml2obj.py 
> >   ... 
> >|_ doc 
> > 
> > When i try to generate documentation for the myapp.py-file with 
> > sphinx, i get the following warning: 
> > 
> >  Traceback (most recent call 
> > last): 
> >   File "/usr/local/lib/python2.7/dist-packages/Sphinx-1.0.7-py2.7.egg/ 
> > sphinx/ext/autodoc.py", line 329, in import_object 
> > __import__(self.modname) 
> >   File "/home/vpetkov/Documents/web2py/server/applications/init/ 
> > controllers/myapp.py", line 16, in  
> > xml2obj = local_import('xml2obj', reload=False) 
> > NameError: name 'local_import' is not defined 
> > 
> > /home/vpetkov/Documents/web2py/server/doc/myapp.rst:7: (WARNING/2) 
> > autodoc can't import/find module 'myapp', it reported error: "name 
> > 'local_import' is not defined", please check your spelling and 
> > sys.path 
> > 
> > Additionally. in conf.py Sphinx file, i added 
> > sys.path.append(os.path.abspath('../applications/init/modules/'))

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

2017-05-16 Thread Carl Hunter Roach
Sorry about the term "crash". "hang" is more accurate. No ticket is issued
and the function db.point.insert does not return although an entry is made
into my GAE data store.

The the following code works without hanging:

for a_point in points:
   db.point.insert(**as_point)

I also realise that there was only one "point" variable in the code and it
should not conflict with the table name. That knowledge stood between me
and the issue for quite some time :)

If I place the hanging code inside a try/except no exception is caught.

On Tue, 16 May 2017 at 17:21 Anthony  wrote:

> # points is a list of dicts defining rows in table point
>> for point in points:
>> db.point.insert(**point)
>>
>> The code would disappear inside db.point.insert without throwing an
>> exception.
>>
>
> It's not clear what the above sentence means.
>
>
>> The table point would receive a row before the crash.
>>
>
> What do you mean by "crash"? A web2py ticket?
>
>
>> All I needed to do was avoid the loop increment variable name 'point'
>> clashing with the table name point 'point'
>>
>
> The Python code you have shown indicates no "clash" -- there is only one
> "point" variable in the code, and it does not conflict with the table name,
> which is an attribute of the db object (i.e., db.point). There must have
> been something else going on, but it is not even clear what problem you
> were having.
>
>
> 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/topic/web2py/zZ1g2S0ywVs/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.
>
-- 
Carl D Hunter Roach
Bisham Barn Owl Group
Runnymede Ringing 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] Caught out by python/web2py syntax

2017-05-16 Thread Carl Hunter Roach
I had (something like) the following code:

In db.py

a table called "point"

In a controller:

# points is a list of dicts defining rows in table point
for point in points: 
db.point.insert(**point)

The code would disappear inside db.point.insert without throwing an 
exception. The table point would receive a row before the crash.

All I needed to do was avoid the loop increment variable name 'point' 
clashing with the table name point 'point' but I thought I'd just document 
my error here in case others come across something similar.

This refers to a GAE-based project.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] How do I make a Web2py threadsafe for GAE?

2017-02-15 Thread Carl Hunter Roach
In my app.yaml file I have:

api_version: 1

runtime: python27
threadsafe: true

handlers:

- url: /_ah/warmup
  script: applications/myapp/mycontroller/warmup

in mycontroller:

def warmup():
'''
called by GAE to ready a Jupiter instance
'''
return dict()

but when I deploy to GAE I get the following error:

appcfg.py: error: Error parsing myapp\app.yaml: threadsafe cannot be 
enabled with CGI handler: applications/myapp/mycontroller/warmup


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

2017-02-14 Thread Carl Hunter Roach
a typo!

GAE (Google App Engine) warmup as document 
here https://cloud.google.com/appengine/docs/python/warmup-requests/ in a 
platform-agnostic way.

On Thursday, 9 February 2017 14:16:32 UTC, Carl Hunter Roach wrote:
>
>
> Anyone with advice on what to put in a GAW warmup() function (
> https://cloud.google.com/appengine/docs/python/warmup-requests/configuring
> )
>
> Is there a minimum for a DAL-based Web2py application?
>
>

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

2017-02-09 Thread Carl Hunter Roach

Anyone with advice on what to put in a GAW warmup() function 
(https://cloud.google.com/appengine/docs/python/warmup-requests/configuring)

Is there a minimum for a DAL-based Web2py application?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] appropriate to ask for a log call to be removed?

2017-02-07 Thread Carl Hunter Roach
In \gluon\packages\dal\pydal\adapters\google_adapters.py there is a single 
log output that writes out a number without a context string. More of a 
debug aid meant to be removed.


554  self.db.logger.info(str(counter))


Is this file part of Web2py or imported, untouched, from another project?

Can it be removed?

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


Re: [web2py] Re: how to access the message parameter of a raise HTTP?

2017-01-19 Thread Carl Hunter Roach
good points!

a wrapper for:
request.wsgi.wsgi_environ['error_message'] = 'Explanation Text'
raise HTTP(400)

would keep it clean and provide a function to document the reason why this
approach is implemented.
You've sold me!
thanks


On Thu, 19 Jan 2017 at 11:39 Anthony  wrote:

> On Thursday, January 19, 2017 at 4:32:51 AM UTC-5, Carl Hunter Roach wrote:
>
> thanks.
>
> I don't like adding UI Text to URLs as it's too easy for 3rd-parties to
> generate URls and have your site serve anything they like :)
>
>
> Note, this is an *internal* redirect, so the end user never sees the
> query string passed to the error handler -- they continue to see the
> original URL in their browser address bar (i.e., the URL of the page that
> triggered the error).
>
>
> Your suggestion of ditching the standard HTTP status codes spurs a
> thought: I could drop Web2py's HTTP altogether and just redirect to my own
> error handler page. That way HTTP remains untouched and it's clearer that
> I've written an alternative implementation.
>
>
> Good point -- since you are triggering the error response yourself, you do
> have more control. However, I wouldn't necessarily do a standard 303
> redirect, as that (a) wastes a round trip to the server, and (b) does not
> return the proper HTTP response code with the initial response. Instead,
> though, you can create an error handling function in a model file or module
> and call it from wherever needed. In that handler, you can set
> response.status to the appropriate HTTP status code, which will get sent to
> the browser (along with whatever response is generated by the handler).
>
>
> 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/topic/web2py/Mg5kK2AuoMQ/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.
>
-- 

Carl D Hunter Roach

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

2017-01-19 Thread Carl Hunter Roach
thanks.

I don't like adding UI Text to URLs as it's too easy for 3rd-parties to
generate URls and have your site serve anything they like :)

Your suggestion of ditching the standard HTTP status codes spurs a thought:
I could drop Web2py's HTTP altogether and just redirect to my own error
handler page. That way HTTP remains untouched and it's clearer that I've
written an alternative implementation.

Has anyone else come across this issue with Web2py's HTTP missing body text?

On Wed, 18 Jan 2017 at 23:18 Anthony  wrote:

> On Wednesday, January 18, 2017 at 10:26:10 AM UTC-5, Carl Hunter Roach
> wrote:
>
> To routes.py I have:
>
> routes_onerror = [
> ('*/400', '/app/controller/error_handler')
> ]
>
> So for a raise HTTP(400, "Explanation Text")
>
> and from error_handler() I can get request.vars.code (400, in this
> example).
>
> How can error_hander() get the text "Explanation Text" ?
>
>
> Looking at the internal code, it doesn't look like you can get the "body"
> argument to HTTP() in the error handler. However, here are a couple of
> hacks:
>
> request.wsgi.wsgi_environ['error_message'] = 'Explanation Text'
> raise HTTP(400)
>
> Then in the error handler:
>
> def error_handler():
> error_message = request.env.error_message
>
> That works because request.wsgi.wsgi_environ is the original WSGI
> environment dictionary for the request, and it gets re-used by the error
> handler (so it ends up in request.env in the error handler).
>
> Alternatively, you can append your error message to request.url, which
> itself is passed to the error handler:
>
> request.url = '%s&error_message=%s' % (request.url, 'Explanation Text')
>
> And in the error handler:
>
> def error_handler():
> error_message = request.vars.error_message
>
> That is really just adding an additional variable to the query string that
> gets passed to the error handler by embedding the new variable within
> request.url.
>
> Alternatively, if you have a limited number of messages, you can simply
> use a different numeric response code for each case to distinguish the
> errors. You don't have to limit yourself to the standard HTTP response
> codes, as in this case, the code is only used internally and never sent to
> the client (you can set a new response status when finally sending a
> response to the client).
>
>
> 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/topic/web2py/Mg5kK2AuoMQ/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.
>
-- 

Carl D Hunter Roach

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

2017-01-18 Thread Carl Hunter Roach
To routes.py I have:

routes_onerror = [
('*/400', '/app/controller/error_handler')
]

So for a raise HTTP(400, "Explanation Text")

and from error_handler() I can get request.vars.code (400, in this example).

How can error_hander() get the text "Explanation Text" ?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] How to set-up function to call via URL on a HTTPS GAE Web2py ?

2017-01-10 Thread Carl Hunter Roach
I have a GAE App built with Web2py.
I've added a SSL cert to the GAE App.

I have URLS like this: https://mydomain/app/controller/function

when function is an undecorated function then all is well and I get back 
some HTML

The problem:
When function is decorated with `@myservice.json`
and `myservice` is `myservice = Service()`

then a web browser is refused connection: Chrome: "mydomain unexpectedly 
closed the connection."

Am I looking in the right place to solve this 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] Using GCD Stackdriver with a Web2py project

2016-12-13 Thread Carl Hunter Roach
I'm using GCD Stackdriver successfully for an App Engine/Web2py-based app.

The only files I can't set breakpoints for are my controllers because 
Stackdriver can't find a Python module.

Would it be recommended to add an __init__.py file to the controllers 
directory?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] For GAE developers. What's missing from a GqlQuery() call?

2016-11-17 Thread Carl Hunter Roach


I have some code running on dev_appserver and on GAE:


gqldb.GqlQuery("SELECT DISTINCT acolumnn FROM atable")


This used to return values from the database. The database (both locally on 
GAE) contain appropriate content for acolumn in atable.

I think I need entries in index.yaml but dev_appserver isn't creating such 
a file. If I populate a file as below the GqlQuery(…) still doesn't return 
any rows.


indexes:

# AUTOGENERATED

- kind: atable
  properties:
  - name: acolumn
direction: desc


Is it my GqlQuery string, my index.yaml file or somewhere else?


If I write a Web2py db query then I get rows returned.
db = current.db
rows = db().select(db.atable.acolumn)


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

2016-09-09 Thread Carl Hunter Roach
Did the "custom_qualifier" patch make it into root?
I can see it is used in dal/pydal/adapters/google_adapters.py but with any 
values passed straight through it's not easy to work out what is/isn't 
supported.


On Sunday, 10 March 2013 02:51:11 UTC, Christian Foster Howes wrote:
>
> Massimo, Scott,
>
> i filed https://code.google.com/p/web2py/issues/detail?id=1373 with a 
> patch against trunk.  Looks like my first patch on this thread made it to 
> the latest release, but the second patch did not.  If that can be applied i 
> think we'll be all set.
>
> perhaps i now need to start submitting book patches to write up these 
> features!
>
> cfh
>
> On Thursday, February 28, 2013 9:35:33 AM UTC-8, Scott Hunter wrote:
>>
>> Sorry, I thought I had -- it works like a champ.  Would be nice if there 
>> were a way to mark the signature fields as unindexed w/o having to recreate 
>> them (not as simple as cut and paste, as the table def uses a bunch of 
>> local definitions, but not hard), but definitely workable.  And lowers the 
>> index overhead a LOT; in my case, from 15K to <3K.
>>
>> - Scott
>>
>> On Thursday, February 28, 2013 11:12:52 AM UTC-5, howesc wrote:
>>>
>>> can you let me know if it works as desired now?  if so, i'll submit the 
>>> patch to massimo for review and possible inclusion in the next release of 
>>> web2py.
>>>
>>> thanks,
>>>
>>> cfh
>>>
>>> On Tuesday, February 26, 2013 6:31:52 PM UTC-8, Scott Hunter wrote:

 With the latest patch, I was able to disable indices on the string 
 fields I wanted to.  Unfortunately (for me), I've just about used up my 
 quota, so I'll have to wait until tomorrow to see how much doing so saves 
 me.

 Thanks,
 Scott

 On Tuesday, February 26, 2013 8:50:29 PM UTC-5, howesc wrote:
>
> here's an updated DAL patch to try.
>
> thanks for trudging through this with us!
>
> cfh
>
> On Tuesday, February 26, 2013 3:36:30 PM UTC-8, Scott Hunter wrote:
>>
>> I'm working from Version 2.3.2 (2012-12-17 15:03:30) stable
>>
>> Here's the table in question (I've commented-out the custom_qualifier 
>> for the string fields):
>>
>> db.define_table('t_run',
>> Field('f_trial', type='reference t_trial',
>>   label=T('Trial')),
>> Field('f_when', type='date',
>>   label=T('When')),
>> Field('f_dog', type='reference t_dog',
>>   label=T('Dog')),
>> Field('f_name', type='string',
>> #custom_qualifier={'indexed':False},
>>   label=T('Name')),
>> Field('f_breed', type='string',
>> #custom_qualifier={'indexed':False},
>>   label=T('Breed')),
>> Field('f_jump_height', type='integer',custom_qualifier={'indexed'
>> :False},
>>   label=T('Jump Height')),
>> Field('f_level', type='string',
>> #custom_qualifier={'indexed':False},
>>   label=T('Level')),
>> Field('f_class', type='string',
>> #custom_qualifier={'indexed':False},
>>   label=T('Class')),
>> Field('f_pref', type='boolean',custom_qualifier={'indexed':False
>> },
>>   label=T('Preferred')),
>> Field('f_armband', type='string',
>> #custom_qualifier={'indexed':False},
>>   label=T('Armband')),
>> Field('f_yards', type='integer',custom_qualifier={'indexed':False
>> },
>>   label=T('Yards')),
>> Field('f_sct', type='integer',custom_qualifier={'indexed':False},
>>   label=T('SCT')),
>> Field('f_judge', type='string',
>> #custom_qualifier={'indexed':False},
>>   label=T('Judge')),
>> Field('f_score', type='integer',custom_qualifier={'indexed':False
>> },
>>   label=T('Score')),
>> Field('f_time', type='double',custom_qualifier={'indexed':False},
>>   label=T('Time')),
>> Field('f_faults', type='string',
>> #custom_qualifier={'indexed':False},
>>   label=T('Faults')),
>> Field('f_handler', type='string',
>> #custom_qualifier={'indexed':False},
>>   label=T('Handler')),
>> Field('f_order', type='integer',
>>   label=T('Order')),
>> auth.signature,
>> format='%(f_key)s',
>> migrate=settings.migrate)
>>
>>
>> P.S. Turning off the indexes DOES make a difference; with the changes 
>> above, instead of using up over 30% of my quota, I'm "only" using 23%.  
>> If 
>> I can get the strings unindexed, and take out the web2py-supplied fields 
>> (created_by & _on, modified_by & _on, and maybe is_active), that should 
>> get 
>> it down to something manageable.  (Not clear on how to handle the 
>> web2py-supplied fields, as I don't know what parameters were using in 
>> making them, making it difficult to know just how to "supply my own 
>> definitions".)
>>
>> O

[web2py] Deploying Web2py on AWS Mobile Hub

2016-04-13 Thread Carl Hunter Roach
With AWS Mobile Hub supporting Python and deployment zip files for any 
libraries has anyone taken this route and have AWS Lambda backed by 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: Support for GQL DISTINCT

2015-10-26 Thread Carl Hunter Roach
Here's my Web2py-driven Python:

db = current.db
rows = db().select(db.person.name, distinct=db.person.name)
for row in rows:
logging.info('name: %s' % row.name)

This logs all rows from person, listing many duplicate name values.

The equivalent GQL I've tried is:

rows = gqldb.GqlQuery("SELECT DISTINCT iso31661 FROM geoPt")
for row in rows:
logging.info(row._entity['iso31661'])

and this lists each unique name once.

If I have 1,000 rows with 10 unique names then the the first example logs 
1,000 names and the GQL example, 10.

Can anyone help?


On Monday, 26 October 2015 10:57:53 UTC, Carl Hunter Roach wrote:
>
> Google slipped in support for DISTINCT in its GQL SELECT in 2013.
>
> Are there any plans to add this to the DAL?
>
> Ref: https://cloud.google.com/datastore/docs/apis/gql/gql_reference
>

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

2015-10-26 Thread Carl Hunter Roach
Google slipped in support for DISTINCT in its GQL SELECT in 2013.

Are there any plans to add this to the DAL?

Ref: https://cloud.google.com/datastore/docs/apis/gql/gql_reference

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

2015-10-13 Thread Carl Hunter Roach
apologies for this question - I see it's been popular over the years - but 
I can't find the definitive answer.

How can I either:
a) handle the case of have no references to insert? or
b) avoid the duplication of two db inserts that are identical except one is 
missing a field that can't be set to None.?

Note: I am not building a HTML ui from the database definition but 
inserting data via code.

in my db.py:

db.define_table('item', ..., Field('geoPts', 'list:reference geoPt'), ...)

in a module:

pts = # set to a list of zero or more db id values

if pts:
db.item.insert(
...
geoPts=pts,
)

else:
db.item.insert(
...
# note that we don't try and set geoPts to None
)

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

2015-10-13 Thread Carl Hunter Roach
I've dropped my attempt to use validate_and_update_or_insert() and have 
this workaround whereby I do a search and then call either 
validate_and_update() or validate_and_insert() ...

user = [
Storage(username="u1", password='p1', field2='field2'),
   Storage(username="u1", password='p1', field2='field2')]

for user in users:

rows = 
db(db.auth_user.username==user.username).select(db.auth_user.ALL)
if rows:
row = rows[0]
db(db.auth_user.id==row.id).validate_and_update(
password=user.password,
field2=user.field2)
else:
db.auth_user.validate_and_insert(
username=user.username,
password=user.password,
field2=user.field2)



On Monday, 12 October 2015 20:08:38 UTC+1, Carl Hunter Roach wrote:
>
> I'm trying to use validate_and_update_or_insert() to update/insert users 
> into my auth_user table. 
>
> user = [
> Storage(username="u1", password='p1', field2='field2'),
>Storage(username="u1", password='p1', field2='field2')]
>
> for user in users:
> res = 
> db(db.auth_user.username==user).validate_and_update_or_insert(password=user.password,
>  
> field2=user.field2)
>
> When a user is inserted all is well.
> *But when a user is to be updated then Web2py throws an exception finding 
> that "object has no attribute 'primary_key'"*
> What have I misunderstood?
>
> I can't find any documentation for validate_and_update_or_insert() but it 
> operates very similarly to validate_and_update or validate_and_insert
>
> My Auth is as follows:
> https_secure = False if isGAELocal() else True
> auth = Auth(db, secure=https_secure)
>
> The execution, above, is local and therefore over http but will be over 
> https when it goes into production. i.e. testing using dev_appserver and 
> targetting App Engine Big Table.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] can validate_and_update_or_insert() be used with Auth on GAE?

2015-10-12 Thread Carl Hunter Roach
I'm trying to use validate_and_update_or_insert() to update/insert users 
into my auth_user table. 

user = [
Storage(username="u1", password='p1', field2='field2'),
   Storage(username="u1", password='p1', field2='field2')]

for user in users:
res = 
db(db.auth_user.username==user).validate_and_update_or_insert(password=user.password,
 
field2=user.field2)

When a user is inserted all is well.
*But when a user is to be updated then Web2py throws an exception finding 
that "object has no attribute 'primary_key'"*
What have I misunderstood?

I can't find any documentation for validate_and_update_or_insert() but it 
operates very similarly to validate_and_update or validate_and_insert

My Auth is as follows:
https_secure = False if isGAELocal() else True
auth = Auth(db, secure=https_secure)

The execution, above, is local and therefore over http but will be over 
https when it goes into production. i.e. testing using dev_appserver and 
targetting App Engine Big Table.

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

2015-02-05 Thread Carl Hunter Roach
My back-brain has obviously not let this go :)


I think it would be an improvement to Web2py for it to not use an XML file 
extension for non-XML content  (or a HTML extension for non-HTML content).



If every project/application did this it would soon make file extensions 
much less useful.
 :)



On Thursday, 15 January 2015 15:53:20 UTC, Massimo Di Pierro wrote:
>
> To rephrase what Niphlod is saying. generic.xml contains code (web2py 
> template language) used to generate XML but it does not contain XML. 
> Eclipse thinks it should contain XML and complains. I guess there is some 
> Eclipse settings to make it ignore this file validation.
>
> On Wednesday, 14 January 2015 13:51:32 UTC-6, Niphlod wrote:
>>
>> if you have set up eclipse to be foolish you can't follow the warnings it 
>> outputs. It's treating "generic.xml" as something with valid XML markup 
>> inside, while web2py's generic.xml is filled with templating functions that 
>> are NOT static xml. 
>>
>> On Tuesday, January 13, 2015 at 10:38:00 AM UTC+1, Carl Hunter Roach 
>> wrote:
>>>
>>> In today's Web2py source I get a "" for the contents of 
>>> applications/x/views/generic.xml
>>> with the default content: {{from gluon.serializers import 
>>> xml}}{{=XML(xml(response._vars,quote=False))}}
>>>
>>> The error is: Content is not allowed in prolog
>>>
>>> This error doesn't prevent the application from working but I'd like to 
>>> get to the IDE to a zero error, zero warning state.
>>>
>>> Any suggestions?
>>>
>>

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

2015-01-16 Thread Carl Hunter Roach
thanks Massimo.

To allow Web2py to use non-XML content in a XML file without generating 
errors, Eclipse has options to disable validation completely, on a per 
project, folder or file basis.
Some pointers to doing so:
http://stackoverflow.com/questions/7489510/disable-xml-validation-in-eclipse



On Thursday, 15 January 2015 15:53:20 UTC, Massimo Di Pierro wrote:
>
> To rephrase what Niphlod is saying. generic.xml contains code (web2py 
> template language) used to generate XML but it does not contain XML. 
> Eclipse thinks it should contain XML and complains. I guess there is some 
> Eclipse settings to make it ignore this file validation.
>
> On Wednesday, 14 January 2015 13:51:32 UTC-6, Niphlod wrote:
>>
>> if you have set up eclipse to be foolish you can't follow the warnings it 
>> outputs. It's treating "generic.xml" as something with valid XML markup 
>> inside, while web2py's generic.xml is filled with templating functions that 
>> are NOT static xml. 
>>
>> On Tuesday, January 13, 2015 at 10:38:00 AM UTC+1, Carl Hunter Roach 
>> wrote:
>>>
>>> In today's Web2py source I get a "" for the contents of 
>>> applications/x/views/generic.xml
>>> with the default content: {{from gluon.serializers import 
>>> xml}}{{=XML(xml(response._vars,quote=False))}}
>>>
>>> The error is: Content is not allowed in prolog
>>>
>>> This error doesn't prevent the application from working but I'd like to 
>>> get to the IDE to a zero error, zero warning state.
>>>
>>> Any suggestions?
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] Error in Eclipse kepler for Web2py source: generics.xml

2015-01-14 Thread Carl Hunter Roach
In today's Web2py source I get a "" for the contents of 
applications/x/views/generic.xml
with the default content: {{from gluon.serializers import 
xml}}{{=XML(xml(response._vars,quote=False))}}

The error is: Content is not allowed in prolog

This error doesn't prevent the application from working but I'd like to get 
to the IDE to a zero error, zero warning state.

Any suggestions?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] What is the correct parser to use for web2py template HTML files in Eclipse?

2015-01-14 Thread Carl Hunter Roach
Eclipse's standard HTML parser kicks our errors and warnings when 
validating Web2py HTML template files.

e.g.,  appadmin.html line 66
{{if stop" delimiter.

But this is {{embedded}} Python 

Any tips on what validator to use for such a file that will a) not produce 
a slew of warnings and the odd error and b) optionally, provide syntax 
checking. I rank a) over b).

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

2014-08-05 Thread Carl Hunter Roach
Each file in applications/app/languages has a line:
# -*- coding: utf8 -*-

I've had to ammend this to:
# -*- coding: utf-8 -*-

otherwise an exception is thrown in \Python\lib\encodings\utf_8.py (see 
below).

utf-8 is the standard term rather than utf8.

My question: does anyone know why all the language files in Web2py are 
parsed when using GAE Search? It'd be good if I could get the system to 
skip this step.

Exception stack...

  File 
"F:\projects\workspace\jupiter\applications\jupiterapi\controllers/default.py", 
line 276, in 

  File "F:\projects\workspace\jupiter\gluon\globals.py", line 385, in 


self._caller = lambda f: f()

  File 
"F:\projects\workspace\jupiter\applications\jupiterapi\controllers/default.py", 
line 107, in results

options=options)

  File "applications\jupiterapi\modules\indexer\indexer.py", line 42, in 
searchWithOptions

resultObj = index.search(query)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\datastore\datastore_rpc.py", 
line 103, in positional_wrapper

return wrapped(*args, **kwds)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
2802, in search

return self._NewSearchResults(response, cursor)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
2678, in _NewSearchResults

result_pb.expression_list(), per_result_cursor))

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
2663, in _NewScoredDocumentFromPb

expressions=_NewFieldsFromPb(expressions), cursor=cursor)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
1327, in _NewFieldsFromPb

return [_NewFieldFromPb(f) for f in field_list]

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
1140, in _NewFieldFromPb

value = _DecodeValue(_GetValue(pb.value()), val_type)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
1132, in _DecodeValue

return _DecodeUTF8(pb_value)

  File "C:\Program Files 
(x86)\Google\google_appengine\google\appengine\api\search\search.py", line 
1125, in _DecodeUTF8

return pb_value.decode('utf-8')

  File "C:\Python\lib\encodings\utf_8.py", line 16, in decode

return codecs.utf_8_decode(input, errors, True)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the 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] app engine bug? Invalid view reported for app engine but not elsewhere

2014-07-11 Thread Carl Hunter Roach
In my default.py I add a function newview

when running locally on 127.0.0.1:8000 all is fine but if I try 
dev_appserver or GAE then newview runs but on returning my browser displays 
the error "invalid view (default/newview.html)

If I add a new html file all runs fine

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

2014-07-11 Thread Carl Hunter Roach
I am using Web2py on an appengine project and each of my tables include two 
'datetime' fields cDate and mDate to record when the record was created and 
modified respectively.

Last time I used Web2py I'd check if  a record existed and call insert() or 
update_record() appropriately.

Now, I can potentially use update_or_insert() but I don't see how I can 
pass in cDate and mDate for "insert" but mDate only for "update_record"

Does web2py have create/modify fields like it adds an "id" to all tables 
and handle this for 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.