Re: [web2py] Restful authentication and CORS

2014-08-10 Thread Christian Foster Howes

Albert,

when we built our oauth implementation we build it ourselves on top of 
the python oauth2 lib.  it's been a while since we built it so i can't 
remember if that web2py-oauth2 lib had not been written yet.  we also 
are doing a slightly modified form of auth with our users - they start 
as anonymous users but still have access tokens, later they register 
or login with a 3rd party oauth provider and then we are just an oauth 
client.


if that sounds at all like what you are doing maybe i can distill some 
of what we had into a format that i can share.'


christian

On 08/05/2014 05:57 AM, Albert Abril wrote:

Hi Christian,

I'm trying to set up my app as a oauth2 provider too,
did you use https://github.com/SamuelMarks/web2py-oauth2 , or another
source? do you have any tutorials or documentation about it? I'll
appreciate it so much.

Cheers,
Albert.


On 29 May 2013 00:21, Christian Foster Howes cfho...@gmail.com wrote:


i have configured my system to be an oauth provider and added a decorator
to all RESTful calls to validate the oauth signature.  yes, i do this on
each request that i require authentication for.


On Tuesday, May 28, 2013 6:01:11 AM UTC-7, Ruben D. Orduz wrote:


Yes, most REST patterns I've seen are handled either by http basic auth
or else request signing. Either option requires handling that on each call.


On Tue, May 28, 2013 at 4:54 AM, Michele Comitini michele@gmail.com
wrote:


  REST is stateless so you should not rely on session, hence you can use

auth.settings.allow_basic_login = True

see here
http://web2py.com/books/default/chapter/29/10#Access-Control

for proper (as per RFC) authentication challenge with realm use:

@auth.basich(basic_auth_real=True|any string)

An alternative is to pass an argument or a parameter with authencation
info and use
auth.login_bare

Anyway you must pass authentication info with each call since being the
service stateless the server has no way to recognize the client.

mic


2013/5/27 Ray (a.k.a. Iceberg) ice...@qq.com


Hi Alec,

On Tuesday, July 17, 2012 1:03:04 AM UTC+8, Alec Taylor wrote:


On Tue, Jul 17, 2012 at 2:20 AM, David Marko dma...@tiscali.cz
wrote:

+1 from me having this. Btw. On client side i'm using AngularJS and

Trigger.io (instead of PhoneGap)

I've been looking around, and will have one of the following setups:

- *AngularJS http://angularjs.org/* with *BarristerRPC
http://barrister.bitmechanic.com/*
- *BackboneJS http://backbonejs.org/* with *Backbone.Rpc
https://github.com/asciidisco/Backbone.Rpc*
- *JQuery mobile* http://jquerymobile.com/ with *jquery-jsonrpc*
https://github.com/datagraph/jquery-jsonrpc (or plain
JSON.stringify)

All within a *PhoneGap http://phonegap.com/* (*Apache Cordova
http://incubator.apache.org/cordova/*) app using the* Facebook
connect plugin
https://github.com/davejohnson/phonegap-plugin-facebook-connect*
for authentication (for graceful downgrade from Facebook mobile app
https://www.facebook.com/mobile/ to Facebook website auth
https://touch.facebook.com).

I should have a PoC http://en.wikipedia.org/wiki/Proof_of_Concept
on August 2 with a full backend written in web2py and two frontends (one in
web2py views; the other in one of the above frameworks).

Subsequently I'll release it under a full open-source license onto
Bitbucket. I'll post to the web2py list with link + slides when the repo is
live



Sorry for late response. I am a web2py veteran who dives into restful
world only recently. Do you have any finding to share about the restful
authentication in web2py? Thanks in advance!

Regards,
Ray

--

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





  --

---
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/FyxbO0WGMhU/unsubscribe?hl=en.
  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/groups/opt_out.





  --


---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an
email to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.







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

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr

[web2py] Re: Image upload GAE: Can't find file_blob

2014-05-06 Thread Christian Foster Howes
Stephen,

i don't see your usage of file_blob or file_data in the sample.  did you 
mean bild_blob is empty?

last time i implemented file upload on GAE i was writing to blobstore 
(cause cloud storage didn't exist yet).  i haven't ported that code to 
cloud storagebut the blobstore code was *very* fiddly!

may i suggest that you use an HTTP inspector (the network tab in the chrome 
developer tools is a decent one) to see what you are actually posting to 
the server?  that should help you to see what the fields are that are being 
posted and what their names are.  hopefully from there you can make some 
sense of it all.

if you are curious of the blobstore upload code check out 
http://www.web2pyslices.com/slice/show/1388/google-app-engine-blobstore-api-support
  
caution:  GAE has changed a *lot* since that has been written.  there are 
much better ways to do that now i think.

hope that helps a little!

cfh

On Monday, May 5, 2014 11:37:31 AM UTC-7, St. Pirsch wrote:

 Hi, 
 I'm trying to catch image data on upload to GAE, in order to store it in 
 the google cloud. 

 My model: 
 db.define_table('fragen',
 ...
 Field('bild','upload'),
 ...
 As far as I understand, web2py generates a blob field automatically on GAE 
 enviroment, so I didn't implement it in the model.


 My cloud-upload controller looks like this:
 def cloudupload(form):
 from google.appengine.api import app_identity
 bucket_name = os.environ.get('BUCKET_NAME', 
 app_identity.get_default_gcs_bucket_name())
 bucket = '/' + bucket_name
 filename = bucket + '/'+ str(form.vars.bild)
 from gluon import contenttype
 mime = contenttype.contenttype(form.vars.bild)
 my_default_retry_params = gcs.RetryParams(initial_delay=0.2,
   max_delay=5.0,
   backoff_factor=2,
   max_retry_period=15)
 gcs.set_default_retry_params(my_default_retry_params)
 write_retry_params = gcs.RetryParams(backoff_factor=1.1)
 gcs_file = gcs.open(filename,
 'w',
 content_type= mime,
 retry_params=write_retry_params)
 gcs_file.write(form.vars.bild_blob)
 gcs_file.close()
 return()

 I'm calling it from a form a grid. I have tried 'onvalidate= first', but 
 the fieldstorage doesn't provide me with the filename web2py is storing 
 finally in the image field. So I employed oncreate. 

 def fragen_cms():
 '''
 Eingabe für die Fragen
 '''
 grid = SQLFORM.smartgrid(db.fragen, orderby=db.fragen.contents, 
 oncreate=cloudupload)
 return dict(grid=grid)

 Image name is fine, cloud upload works as well, but it seems that there is 
 no data in file_blob, nor in file_data. Is there a way to retrieve the file 
 from the form?

 Thanks for Your help,
 Stephan


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

2014-05-02 Thread Christian Foster Howes
did you use a SQLForm?  if not then you probably didn't trigger the 
validators to run.

On Thursday, May 1, 2014 9:14:28 AM UTC-7, Thomas Neubrand wrote:

 Hello,

 I have two validators in my db.py for my *auth_user* table for the 
 password and the domain field, but both don´t work. When I type in a domain 
 name that is already in the table, there occurs a 
 *duplicate entry 'test' for key 'domain' *error. Can you tell me why 
 the validators don´t work?
 auth = Auth(db)

 auth.settings.extra_fields['auth_user'] = [Field('domain', length=16,unique
 =True)]
 auth.define_tables(username=False, signature=True)

 db.auth_user.domain.requires=[IS_NOT_IN_DB(db, db.auth_user.domain),IS_MATCH
 ('^[0-9a-zA-Z]{4,16}$')]
 db.auth_user.password.requires=IS_MATCH(
 '^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=\S+$).{8,}$')

 Thank you for your help,

 Thomas


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

2014-05-01 Thread Christian Foster Howes

sounds good.  good luck!

note that if i was re-implementing it right now i would take a serious 
look at using google cloud storage to put the images in.  i'm not sure 
but it might be easier to access files as a site owner that are in cloud 
storage.


cfh

On 5/1/14, 1:31 , St. Pirsch wrote:

Thank You for the hind. They are stored in the datastore at the moment. I
found a description for blobstore-uploads from web2py work here:
http://www.web2pyslices.com/slice/showcomment/948
I think that was made by you, a couple of years ago. I'll try to make it
work that way.
thanks,
Stephan

Am Mittwoch, 30. April 2014 16:28:08 UTC+2 schrieb Christian Foster Howes:


are you storing your images in the datastore or in blobstore, or in google
cloud storage?  if blobstore you can use
https://developers.google.com/appengine/docs/python/images/functions#Image_get_serving_urlto
 store a URL that serves it directly from blobstore.


cfh

On Monday, April 28, 2014 3:28:24 PM UTC-7, St. Pirsch wrote:


Hi,
i am trying to find an efficient way to display images uploaded to GAE.
Currently, im using the download action:
* background-image: url({{=URL('download',
args=line.contents.vorschaubild)}});*
Since there are a lot images to display, there should be a less power
consuming way to get the image files.
Is it possible to let GAE directly serve the images, without the web2py
download action, like it works for static files?
Or is it possible to cache the output of the download action?
Thanks for Your help.
Stephan







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

2014-04-30 Thread Christian Foster Howes
are you storing your images in the datastore or in blobstore, or in google 
cloud storage?  if blobstore you can use 
https://developers.google.com/appengine/docs/python/images/functions#Image_get_serving_url
 
to store a URL that serves it directly from blobstore.


cfh

On Monday, April 28, 2014 3:28:24 PM UTC-7, St. Pirsch wrote:

 Hi,
 i am trying to find an efficient way to display images uploaded to GAE.
 Currently, im using the download action:
 * background-image: url({{=URL('download', 
 args=line.contents.vorschaubild)}});*
 Since there are a lot images to display, there should be a less power 
 consuming way to get the image files.
 Is it possible to let GAE directly serve the images, without the web2py 
 download action, like it works for static files?
 Or is it possible to cache the output of the download action?
 Thanks for Your help.
 Stephan


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

2014-04-27 Thread Christian Foster Howes
attached is our auth code.  i made a few minor adjustments to remove some 
things that are specific to our app - hopefully it still runs.

note that we use this as a decorator to controller methods.

On Saturday, April 26, 2014 6:09:13 PM UTC-7, samuel bonill wrote:

 Yes Christian, I'd like take a look...


 2014-04-26 17:24 GMT-05:00 Christian Foster Howes:

 i have an oauth implementation that i used on app engine.  i can try and 
 clean it up a touch and share it if you would like.

 cfh


 On Saturday, April 26, 2014 7:05:55 AM UTC-7, samuel bonill wrote:

 thanks Marks, i'm using phonegap(android, iOS) as my client and 
 angularjs consume the API Rest.
 x509 its grate but, work x509 on app engine ?,  or what do you think 
 about use Oauth 2.0 http://oauth.net/2/ ?


 2014-04-25 21:41 GMT-05:00 Samuel Marks:

 Sure, take a look at x509 at http://web2py.com/books/
 default/chapter/29/09/access-control


 Samuel Marks
 http://linkedin.com/in/samuelmarks


 On Sat, Apr 26, 2014 at 12:33 PM, samuel bonill wrote:

 is there an example of API Rest authentication based in private/public 
 key with web2py?? 
 i don't want use username and password tokens for each request
  
 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the 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/lXfe0tpGi8U/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/lXfe0tpGi8U/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.
import logging
import json
# using oauth2 lib from https://github.com/simplegeo/python-oauth2
import oauth2 as oauth
import uuid
from functools import wraps

from gluon.http import HTTP
from gluon.globals import current
from google.appengine.api import memcache

# before conditional models we came up with our own way to do this
# you probably have a different implementation
from datamodel import models
# a utitlity for figuring out client versions etc from a user agent
# specific to our app
from apprequest import parse_user_agent

class Consumer(dict):
pass


class XAuthServer(oauth.Server):
timestamp_threshold = 86400 # In seconds, 1 day

def generate_consumer_token(self):
key = str(uuid.uuid4())
secret = str(uuid.uuid4())
return oauth.Token(key, secret)

def generate_access_token(self):
key = str(uuid.uuid4())
secret = str(uuid.uuid4())
return oauth.Token(key, secret)


class XAuthProvider(object):
def __init__(self, *args, **kwargs):
self._server = XAuthServer()
self._server.add_signature_method(oauth.SignatureMethod_HMAC_SHA1())

def get_client(self, request=None):
Return the client from the OAuth parameters.
if not isinstance(request, oauth.Request):
raise ValueError('Request is not an oauth request.')
client_key = request.get_parameter('oauth_consumer_key')
if not client_key:
raise Exception('Missing oauth_consumer_key parameter in ' \
'OAuth Authorization header')

client = models.client.get_client_by_oauth_key(client_key)
if not client:
raise Exception('Client %s

Re: [web2py] API Rest authenticatio

2014-04-26 Thread Christian Foster Howes
i have an oauth implementation that i used on app engine.  i can try and 
clean it up a touch and share it if you would like.

cfh

On Saturday, April 26, 2014 7:05:55 AM UTC-7, samuel bonill wrote:

 thanks Marks, i'm using phonegap(android, iOS) as my client and angularjs 
 consume the API Rest.
 x509 its grate but, work x509 on app engine ?,  or what do you think 
 about use Oauth 2.0 http://oauth.net/2/ ?


 2014-04-25 21:41 GMT-05:00 Samuel Marks samuelma...@gmail.com:

 Sure, take a look at x509 at 
 http://web2py.com/books/default/chapter/29/09/access-control


 Samuel Marks
 http://linkedin.com/in/samuelmarks


 On Sat, Apr 26, 2014 at 12:33 PM, samuel bonill pythonn...@gmail.comwrote:

 is there an example of API Rest authentication based in private/public 
 key with web2py?? 
 i don't want use username and password tokens for each request
  
 -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.com/web2py/web2py (Source code)
 - https://code.google.com/p/web2py/issues/list (Report Issues)
 --- 
 You received this message because you are subscribed to the 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/lXfe0tpGi8U/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: how to add web2py app into a hosted web2py in command line

2014-04-26 Thread Christian Foster Howes
the command line way to deploy to the running server is to zip the 
contents of your application directory, transfer to the host, and unzip to 
the host's applications directory.  assuming the your code has no 
additional dependencies it should work.

depending on how you do URL routing you may need to update the server's 
routing file and restart the service on the server.

cfh

On Friday, April 25, 2014 3:51:51 AM UTC-7, Aby Thachet Jose wrote:

 hello
 i have developed a web2py web app in my local system how can i host that 
 into the server web2py ,it has web2y and is running a app i am not getting 
 the user interface to just upload this 

  


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

2014-04-26 Thread Christian Foster Howes
auto increment IDs are implemented differently on different databases.  the 
instructions for mysql vs postgres are different for example.  It's best to 
check the documentation for the database that you are using.

i'm assuming that you have already removed all rows from the table. :)

cfh

On Thursday, April 24, 2014 2:42:05 PM UTC-7, Flavio Santos wrote:

 How to set an auto increment id back to zero (automatically) table 
 auth_user?


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

2014-02-28 Thread Christian Foster Howes
It's been some time since I connected to cloud SQL myself, but I would suggest 
triple check the connection string and permissions.  You should not have to 
connect with any other client first.

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


[web2py] Re: GAE localhost mysql instance

2014-02-15 Thread Christian Foster Howes
did you invoke dev_appserver.py with the options to enable mysql?  there's 
a couple of options that you must pass to dev_appserver to tell it to load 
and connect to mysql for local emulation of google cloud sql.  i haven't 
done it for a while so i don't remember the exact magic incantations

cfh

On Wednesday, February 12, 2014 3:53:56 AM UTC-8, Juslin Guo wrote:

 Hi,

 Can anyone point me to any resource that show me how to use CloudSQL+GAE 
 together with a local mysql development environment on mac..It can't seem 
 to connect to the local mysql for development purposes.

 I did this: 

 if not request.env.web2py_runtime_gae:
 db = DAL(mysql://root:123@localhost/testing) 
 else:
 db = DAL(google:sql://juslintest:data/testgae)
 session.connect(request, response, db=db)


 Error:

 RuntimeError(Failure to connect, tried %d times:\n%s % (attempts, tb))
 RuntimeError: Failure to connect, tried 5 times:

 RuntimeError: no driver available ('MySQLdb', 'pymysql', 'mysqlconnector')


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


[web2py] Re: Virtual field for latitude and longitude from geometry field?

2014-01-02 Thread Christian Foster Howes
i bet that by the time your lambda is running the point has been converted 
to a string already.  can you see if that is true?  i'm not sure how to 
invoke db functions in a lambda of a virtual field. :(

On Wednesday, January 1, 2014 5:50:54 PM UTC-8, User wrote:

 Suppose I have a table like:

 db.define_table('location',
 Field(name, 'string'),
 Field('point', 'geometry()')
 )

 I want to have the latitude and longitude as attributes also (whose value 
 can be derived from the point field).  So I try this:

 db.define_table('location',
 Field(name, 'string'),
 Field('point', 'geometry()'),
 Field.Virtual('latitude', lambda row: row.location.point.st_x()),
 Field.Virtual('longitude', lambda row: row.location.point.st_y()),
 )

 But it doesn't work and fails silently.  The model just doesn't have 
 latitude or longitude fields. I also tried with Field.Method but this 
 complains that 'point' is of typer str.

 I guess the complication is that st_x() translates into a database 
 function.  I'm thinking about parsing the point string which is of the form 
 POINT(x y) as a workaround but I'd rather use st_x if someone can show me 
 how.


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


[web2py] Re: How to measure conversion rate with google analytics?

2013-12-07 Thread Christian Foster Howes
can't you just add google analytics to your site.  from there you can see 
referrers and funnels and conversions etc. with almost no extra work.

On Friday, December 6, 2013 12:48:31 PM UTC-8, Mika Sjöman wrote:

 Hi

 I was wondering if it is possible to measure the conversion rate of how 
 many people sign up to our service www.dominochinese.com with google 
 analytics? If I understand it correct, I need to set up a goal URL with 
 google analytics, but I then wonder how to redirect new users to that URL? 
 Is there anything built into web2py so the stats become correct? I was just 
 thinking that if I just redirect people who never signed in, I could 
 possibly mess things up. 

 Maybe I could just run a ajax call to the goal URL, if they are missing a 
 database row value with the name has_signed_in_before? But will this give 
 me the correct stats? 

 Also any ideas on how to connect this to an Ad-words campaign?

 I use both email login and Janrain for people to sign up. 

 Cheers!


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


Re: [web2py] Re: bulk_upload to GAE development datastore no longer works?

2013-12-05 Thread Christian Foster Howes
ok, it must be a different error.  this is the bulkupload error that i 
am watching: https://code.google.com/p/googleappengine/issues/detail?id=9666


there are several issues logged against the bulkuploader though: 
https://code.google.com/p/googleappengine/issues/list?can=2q=bulkloadercolspec=ID+Type+Component+Status+Stars+Summary+Language+Priority+Owner+Logcells=tiles


On 12/5/13, 12:39 , David Manns wrote:

Do you have a reference for this? I went back to 1.8.0 and problem is same.
Also tried some 1.7x versions, higher versions with same result. Early 1.7x
versions I think ran only on Python 2.5 and probably because of other
changes in the yaml file and the --use_sqlite app parameter can't get these
to run at all.

Thanks!

On Thursday, December 5, 2013 1:39:37 AM UTC-5, Christian Foster Howes
wrote:


this is a documented GAE SDK bug.  you'll have to downgrade your GAE SDK
to the last working version of this.  i *think* the last working version is
1.8.1

On Wednesday, December 4, 2013 8:46:31 AM UTC-8, David Manns wrote:


My application runs on GAE. Using Google's bulk loader I make occasional
backups of the database. It used to be that I could use the GAE SDK (appcfg
tool in this case) to upload all the data into the development server on my
development machine, thus creating the full data context for the SDK.

This now fails. I'm not sure (or if) how the remote_api validates the
provided email/password, but the results are the same failure with all
sensible choices of password, e.g. the primary google account password (the
account owns the app on GAE), the application specific password used for
the bulk download for GAE (the gmail account uses 2 factor authentication),
or no password.

I attach the script used to run the development upload (which used to
work until recently) and the command window output from running it. Also
the app.yaml file.

Anyone have any idea what the problem might be?







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

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: How would you implement paging on a google-results-like page?

2013-12-05 Thread Christian Foster Howes
can you create a module and/or a base template that you can put the 
boilerplate code in so you don't have to duplicate the stuffs in each 
individual controller and view?  or can you write a generic controller that 
based on parameters/POST data adjusts its queries.

On Thursday, December 5, 2013 12:32:06 PM UTC-8, Jim S wrote:

 Looking for advice here.

 Traditionally I've used SQLFORM.grid when I want to have a list where 
 people can select what record they want to work with.  That works fine for 
 me but a new app on working on has a requirement to have it's list pages 
 look more like a google search results page.  No table like features like 
 headings, columns, etc.  Just one list with a header row and a variable 
 amount of data below it.

 I don't have a problem creating the page, but am not sure the best way to 
 implement the paging controls.  I've got the functionality all working 
 based on 
 http://web2py.com/books/default/chapter/29/14/other-recipes#Paginationfrom 
 the book.  However, seems like a lot of boilerplate code I need to put 
 in each of my list controllers (there around 20 of these list controllers). 
  

 Wondering how others have handled similar requirements and would 
 appreciate comments from anyone who wishes to share.

 Thanks!

 -Jim


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


Re: [web2py] Re: GAE - Not Working || Full Code Attached

2013-12-05 Thread Christian Foster Howes
also Prachi, can you visit the GAE logs and paste in the error you are 
getting?  that might make it even quicker for us to help you sort it out.

On Thursday, December 5, 2013 1:07:37 PM UTC-8, James Burke wrote:

 Hi Prachi

 When I ran the code the form appeared. 

 I didn't try the form. Will do so when I get home

 James Burke 


 On 6/12/2013, at 8:28 am, PRACHI VAKHARIA prachiv...@gmail.comjavascript: 
 wrote:




 Dear James,

 First, thank you very much for the response, and taking the effort to try 
 out the application on GAE.



 The *app.yaml* file I am using is configured just as you have stated.

  
 runtime: python27
 threadsafe: true

  

  
 - url: .*
   script: gaehandler.wsgiapp# WSGI (Python 2.7 only)
   secure: optional

  


  

 I also have the *wsgihandler.py* and *gaehandler.py* in the *root web2py 
 folder* — *I think it was already there to begin with and I did not 
 tamper with it at all.*


 I have used the same application and app.yaml file to upload the 
 application to GAE before. Since I got a new computer, installed python2.7 
 and the latest w2p and GAE-launcher, I was trying to see if everything is 
 set up right and working. But it seems that it is not working once uploaded 
 to GAE, whether it is from my new computer or even my old computer.



 QUESTION

 Were you able to upload and run the application on GAE? Did the Forms 
 appear and insert-append records properly?



 Eagerly awaiting your reply.



 Gratefully,

 PRACHI 

  

  

  

  

  



 On Thursday, December 5, 2013 1:44:56 PM UTC-5, James Burke wrote:

 Hi Prachi,

 Your code works fine for me, uploading to GAE.

 It may be that your app.yaml file is configured incorrectly. Do you have 
 it setup to use python 2.5 or 2.7?

 # use this line for Python 2.5
 #
 #runtime: python


 # use these lines for Python 2.7
 # upload app with: appcfg.py update web2py (where 'web2py' is web2py's 
 root directory)
 #
 runtime: python27
 threadsafe: true# true for WSGI  concurrent requests (Python 2.7 
 only)


 - url: .*
   #script: gaehandler.py # CGI
   script: gaehandler.wsgiapp# WSGI (Python 2.7 only)
   secure: optional

 Is how mine is setup, if you don't have wsgihandler.py or gaehandler.py 
 in your root web2py folder then you will also need to copy them from the 
 examples folder.

  -- 
 Resources:
 - http://web2py.com
 - http://web2py.com/book (Documentation)
 - http://github.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/ms87Y02KlIg/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/groups/opt_out.



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


[web2py] Re: Running instantpress in GAE: Internal error Ticket issued: unrecoverable

2013-12-05 Thread Christian Foster Howes
i suspect that instapress needs to use a relational database and that if 
you use google cloud SQL you are more likely to get it to work.

the traceback from the logs would be most helpful in debugging.

On Thursday, December 5, 2013 2:55:36 AM UTC-8, peibol wrote:

 No, I didn't find any solution...


 El jueves, 5 de diciembre de 2013 07:51:07 UTC+1, PRACHI VAKHARIA escribió:


  

 *Did you find a Solution?*

 *If yes, what is the Solution?*

  

 Thank you.





 On Thursday, June 13, 2013 11:29:35 AM UTC-4, peibol wrote:

 Hi all:

 Everything is running smoothly at localhost, but when deploying a raw 
 instantpress on GAE I get Internal error Ticket issued: unrecoverable when 
 trying to register or login. I'm using python 2.7, but the same thing 
 happens with 2.5.

 Any hints there?

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


Re: [web2py] Re: GAE - Not Working || Full Code Attached

2013-12-05 Thread Christian Foster Howes
this strikes me as an old version of web2py.  GAE upgraded IDs to be 
longs a few months back and i know we made sure the DAL in the latest 
version supports that, yet this looks like such an error. :(


On 12/5/13, 21:42 , Massimo Di Pierro wrote:

When posting a comment the last 5 lines are usually sufficient:

'Traceback (most recent call last):\n File /base/data/home/apps/s~pv-4-
vp/1.372124618390164258/gluon/main.py, line 551, in wsgibase\n
session._try_store_in_db(request, response)\n File
/base/data/home/apps/s~pv-4-vp/1.372124618390164258/gluon/globals.py,
line 728, in _try_store_in_db\n record_id = table.insert(**dd)\n File
/base/data/home/apps/s~pv-4-vp/1.372124618390164258/gluon/dal.py, line
7806, in insert\n ret = self._db._adapter.insert(self,self._listify(fields))\n
File /base/data/home/apps/s~pv-4-vp/1.372124618390164258/gluon/dal.py,
line 4618, in insert\n rid = Reference(tmp.key().id())\nOverflowError:
Python int too large to convert to C long\n' p6570 s.

This looks like a bug in DAL but what web2py version are you using?



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

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: uploading files on GAE - 404 NOT FOUND

2013-12-04 Thread Christian Foster Howes
Can you share the log/stack trace from when that happens?  does the form 
post to the same function that generated it?

i have not tried upload in grid()wonder if there is something there 
that doesn't quite work on app engine?

On Tuesday, December 3, 2013 10:49:47 AM UTC-8, James Burke wrote:

 Hi,

 Uploading files into my table on GAE, when I hit submit I'm presented with 
 a 404 NOT FOUND error message.

 Works fine using Rocket, but not in GAE SDK or when uploaded to GAE.

 _tables.py - in models
 db.define_table('file',
 Field('name', unique=True, compute=lambda r: db.file.file.retrieve(r.
 file)[0]),
 Field('file', 'upload'),
 Field('created_on', 'datetime', default=request.now),
 Field('created_by', 'reference auth_user', default=auth.user_id),
 format='%(name)s')


 admin.py - in controllers
 @auth.requires_membership(admin)
 def file():
  links = [dict(header='URL', body=lambda row: '/init/default/download/%s' 
 %(db.file.file.retrieve(row.file)[0]))]
  form = SQLFORM.grid(db.file, links=links, searchable=False, 
 csv=False,user_signature
 =False)


  return dict(form=form)



 Cheers

 -James


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


[web2py] Re: bulk_upload to GAE development datastore no longer works?

2013-12-04 Thread Christian Foster Howes
this is a documented GAE SDK bug.  you'll have to downgrade your GAE SDK to 
the last working version of this.  i *think* the last working version is 
1.8.1

On Wednesday, December 4, 2013 8:46:31 AM UTC-8, David Manns wrote:

 My application runs on GAE. Using Google's bulk loader I make occasional 
 backups of the database. It used to be that I could use the GAE SDK (appcfg 
 tool in this case) to upload all the data into the development server on my 
 development machine, thus creating the full data context for the SDK.

 This now fails. I'm not sure (or if) how the remote_api validates the 
 provided email/password, but the results are the same failure with all 
 sensible choices of password, e.g. the primary google account password (the 
 account owns the app on GAE), the application specific password used for 
 the bulk download for GAE (the gmail account uses 2 factor authentication), 
 or no password.

 I attach the script used to run the development upload (which used to work 
 until recently) and the command window output from running it. Also the 
 app.yaml file.

 Anyone have any idea what the problem might be?


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


Re: [web2py] Re: uploads GAE

2013-11-24 Thread Christian Foster Howes
i haven't used the default that writes to bigtable in a while, but i 
believe it just works.


i use the image library against images uploaded to blobstore: 
https://developers.google.com/appengine/docs/python/images/  it looks 
like that has been improved to have more flexibility then when i first 
implemented it.


cfh

On 11/23/13, 15:10 , Scott Hunter wrote:

OK, but the manual (page 563, 5th ed) says:

On Google App Engine, files are stored by default in the database without

the need to define an uploadfield, since one is created by default.



Which sounds like my Sqllite-using app which has upload fields can handle
uploading files w/o modification.  My question, then, is what would be the
analogy to response.download be for such fields?  Does it also just work
as when an app has access to the DB?  Will the URL used be the same?  And
how would the app access these files directly (for example, if they were
image files that needed to be modified using the GAE analogy of PIL)?

On Saturday, November 23, 2013 4:32:57 PM UTC-5, Christian Foster Howes
wrote:


Niphlod is correct - no storing on the filesystem.  datastore or blobstore
to store your uploaded files on GAE.

On Saturday, November 23, 2013 11:24:31 AM UTC-8, Niphlod wrote:


If I'm not mistaken, GAE filesystem is not writable your only option
is to store the file into the database

On Saturday, November 23, 2013 1:36:43 PM UTC+1, Scott Hunter wrote:


Are there any issues with using the various upload-related Field options
when runnning under GAE?  In particular, I'm wondering about the
uploadfolder  uploadseparate options.  How would using these affect using
response.download in a controller?

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


Re: [web2py] Re: uploads GAE

2013-11-24 Thread Christian Foster Howes
that simply does not work.  you'll have to write custom code to store in 
blobstore or cloud storage if you don't want to keep uploaded images in 
the DB.


note that images that are static that you deploy with the application 
can be stored in a static folder and mapped via app.yaml to be handled 
with a static file handler and caching policies set in app.yaml


cfh

On 11/24/13, 2:43 , St. Pirsch wrote:

I am experiencing the same problem right now. I am running an application
with version 2.51 on GAE, where images are uploaded via the standard
Field('file', 'upload'),
and retrieved using the download helper, which continues to work correctly.

Today, I tried to launch an application on ver. 2.7.4  using a static
upload path:
Field('logo', 'upload', uploadfolder=request.folder+'static/images'),
Images are embedded via:
img src={{=URL('static', '/images/'+kopf.projekt.logo)}} border=0
which does not work.
In the edit menu of the GRID-helper all uploaded images are displayed
correctly in GAE.

If someone knows how to handle this, she/he would be of great help for me.

Thanks,
Stephan




Le samedi 23 novembre 2013 13:36:43 UTC+1, Scott Hunter a écrit :


Are there any issues with using the various upload-related Field options
when runnning under GAE?  In particular, I'm wondering about the
uploadfolder  uploadseparate options.  How would using these affect using
response.download in a controller?

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


[web2py] Re: uploads GAE

2013-11-23 Thread Christian Foster Howes
Niphlod is correct - no storing on the filesystem.  datastore or blobstore 
to store your uploaded files on GAE.

On Saturday, November 23, 2013 11:24:31 AM UTC-8, Niphlod wrote:

 If I'm not mistaken, GAE filesystem is not writable your only option 
 is to store the file into the database

 On Saturday, November 23, 2013 1:36:43 PM UTC+1, Scott Hunter wrote:

 Are there any issues with using the various upload-related Field options 
 when runnning under GAE?  In particular, I'm wondering about the 
 uploadfolder  uploadseparate options.  How would using these affect using 
 response.download in a controller?

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


[web2py] Re: OAuth2.0 and Facebook (as from the book)

2013-10-29 Thread Christian Foster Howes
the problem is that facebook is not returning an email.

i know, i know, you told facebook that email is required and you can't 
reproduce such a state.  i'm 100% with you, but i see the exact same 
behavior with my users!  i suspect that these are actually returning users 
who granted email access when they first created an account, but then they 
changed their facebook permissions to remove email access and when they 
return to your site and login, facebook lets them (because they have 
before), but does not give you the email address.   i have not confirmed 
this theory, but it's my running theory.

other potential issue is the expiration of the facebook access token.  
those rules changed this spring and i'm not 100% up to date on the rules 
right now.

cfh

On Monday, October 28, 2013 10:57:06 AM UTC-7, Lisandro wrote:

 I'm having a similar problem with KeyError: 'email'.

 I have a site in production that uses oauth2 and offers the possibility of 
 register/login using personal facebook account. 
 I created a Facebook app and set permissions to get user's email (so I can 
 create the account on my site). Everything works perfect, lots of users 
 have registered in my site using their Facebook accounts. Even myself.

 However, there are some error tickets created with this error of 
 KeyError:email. First I thought that some users didn't let the 
 application get their emails, but that's not possible. When you try to log 
 in my site using Facebook, facebook tells you that te application will get 
 your email, and you only can accept or decline. If you decline, you're not 
 registered. And if you accept, my site gets your email and creates the 
 account.

 So, I don't know which could be the problem. This is the traceback of the 
 error:

 Traceback (most recent call last):
   File /var/www/vendosimple/gluon/restricted.py, line 212, in restricted
 exec ccode in environment
   File /var/www/vendosimple/applications/init/controllers/default.py, line 
 645, in module
   File /var/www/vendosimple/gluon/globals.py, line 194, in lambda
 self._caller = lambda f: f()
   File /var/www/vendosimple/applications/init/controllers/default.py, line 
 380, in user
 form = auth()
   File /var/www/vendosimple/gluon/tools.py, line 1250, in __call__
 return getattr(self, args[0])()
   File /var/www/vendosimple/gluon/tools.py, line 2128, in login
 cas_user = cas.get_user()
   File applications/init/modules/globales.py, line 41, in get_user
 username=user['id'], registration_id=user['id'], email=user['email'])
 KeyError: 'email'


 Any ideas? 


 El martes, 7 de junio de 2011 01:00:33 UTC-3, Massimo Di Pierro escribió:

 I am not familiar with facebook email. 

 If this (username + @facebook) is avlid email, perhaps web should set 
 that even if username=True 

 On Jun 6, 7:15 pm, Sebastian E. Ovide sebastian.ov...@gmail.com 
 wrote: 
  I do not see major pros and cons... it is a matter of precerences... 
  
  1) setting username=True in auth.define_tables(), define_tables will 
 add a 
  field on the table (username) and if that field is present, 
 authentication 
  will be done using username. Personally I prefer to use emails rather 
 than 
  usernames, and as I am using BOTH web2py auth and facebook at the same 
  time 
  for authentication (two different links for different logins), I didn't 
 want 
  to force my application to use usernames so I've used the second 
 option 
  
  2) in this case I'm adding an email created by the facebook username + 
  @facebook and therefore auth will keep using email for 
 authentication... 
  
  no web2py code has been touched, although I'm extending Auth and 
  overriding navbar to display a second login link (facebook) and hide 
  change_password when it is logged in via facebook. 
  
  if session.login_method_used is None: 
  if not 'change_password' in 
 self.settings.actions_disabled: 
  bar.insert(-1, ' | ') 
  bar.insert(-1, password) 
  
  and in my controller: 
  
  def user(): 
  if auth.user_id: 
  if request.args[0] == 'logout': 
  session.login_method_used=None 
  else: 
  if request.args[0] == 'login': 
  session.login_method_used=None 
  elif request.args[0] == 'login_fb': 
  session.login_method_used=facebook 
  request.args[0]='login' 
  
  if session.login_method_used==facebook: 
  auth.settings.login_form=FaceBookAccount(globals()) 
  
  return dict(form=auth()) 
  
  On Mon, Jun 6, 2011 at 11:16 PM, Massimo Di Pierro  
  
  
  
  
  
  
  
  
  
  massimo.dipie...@gmail.com wrote: 
   if there is agreement on one, please send me a patch. 
  
   On Jun 6, 4:31 pm, Sebastian E. Ovide sebastian.ov...@gmail.com 
   wrote: 
Hi Mic, 
  
thanks for that. 
  
actually I've debugged web2py and figure it out for myself. There 
 are two 
easy ways to fix it (I've 

Re: [web2py] Re: OAuth2.0 and Facebook (as from the book)

2013-10-29 Thread Christian Foster Howes

Lisandro,

the ratio of users without email is so low that i would just block the 
user telling them that they must grant email permissions to use your 
site.  detect that there was no email returned from facebook and send a 
response to the browser that prompts the user to try again and add the 
email permission.


in the event that this is the login of an existing user, your database 
will already have an email and maybe you prompt them to verify that the 
saved email is still correct.


good luck!

cfh

On 10/29/13, 8:05 , Lisandro Rostagno wrote:

Thanks, you're right, Facebook documentation is very poor and is often
outdated.  That page says that anyone can send you an email from external
mail services (gmail, yahoo, etc).. but I tried that and I receive a
response from Facebook saying that there is a permission problem... I
suppose that the user can choose not to be contacted outside facebook :/

So in my case, I have no way to avoid this problem. Maybe creating that
fake email address and asking the user to enter a valid emai addres and
then verify it... but that deviates from the goal of register/login with
facebook, that should be a simple and fast method, mostly for the user.

Anyway, thanks a lot for the help and the answers!

Off the topic, I'm starting to think that Facebook is kind of an ·internet
explorer experience for developers, where developers have to work extra to
cover inconsistency or problems like this :/


2013/10/29 Michele Comitini michele.comit...@gmail.com


this is what they say:

https://www.facebook.com/help/224049364288051

facebook documentation for developers is incomplete, so to say, on many
occasions...

mic




2013/10/29 Lisandro Rostagno rostagnolisan...@gmail.com


Thanks for the answer. The problem is that I really need a valid email
address, because in my site I use that email to send important
notifications to the user.
I already tried with facebook mail, that is, joining the user name with
@facebook.com. But it didn't work. When I send an email to a facebook
mail, I receive an automatic response from Facebook saying that there is a
permission problem. I understand that @facebook email addresses are only
for communication between Facebook users :/


2013/10/29 Michele Comitini michele.comit...@gmail.com


  create a fake email...

something like the following (check for errors I did not test it)

if user:
   if not user.has_key('email') or user['email'] == '' or user['email']
is None:
  user['email'] = user['first_name'] + '.' + user['last_name'] + '.'
+ user['id'] + '@facebook.email.is.not.valid'



2013/10/29 Lisandro rostagnolisan...@gmail.com


  I see, your theory is pretty much accurate (sorry for my english, I
hope that phrase is correct). What I mean is that your theory is the most
addecuate for this case, thought it can't be proved. Actually, there is
another error that says something about access token been already used, but
happens very little.

My question now is: ¿can I avoid this situation and do something?

I have this in one of my models:

if session.login_facebook:
 from globales import FaceBookAccount
 auth.settings.login_form = FaceBookAccount(globals())

  And this is te dfinition of FaceBookAccount class:

class FaceBookAccount(OAuthAccount):
 AUTH_URL=https://graph.facebook.com/oauth/authorize;
 TOKEN_URL=https://graph.facebook.com/oauth/access_token;

 def __init__(self, g):
 OAuthAccount.__init__(self, g, current.FACEBOOK_APP_ID,
current.FACEBOOK_APP_SECRET_KEY, \
   self.AUTH_URL, self.TOKEN_URL, scope='email')
 self.graph = None

 def get_user(self):
 if not self.accessToken():
 return None
 if not self.graph:
 self.graph = GraphAPI((self.accessToken()))
 user = None
 try:
 user = self.graph.get_object(me)
 except GraphAPIError, e:
 self.session.token = None
 self.graph = None
 if user:
 return dict(first_name='%s %s' %(user['first_name'],
user['last_name']), \
   username=user['id'], registration_id=user['id'],
email=user['email'])

I would like to, at least, show an error message to the user saying
that something went wrong trying to get his/her email from Facebook, and
that he/she should try again. Can't figure it out how to do it :/


El martes, 29 de octubre de 2013 03:48:36 UTC-3, Christian Foster Howes
escribió:


the problem is that facebook is not returning an email.

i know, i know, you told facebook that email is required and you can't
reproduce such a state.  i'm 100% with you, but i see the exact same
behavior with my users!  i suspect that these are actually returning users
who granted email access when they first created an account, but then they
changed their facebook permissions to remove email access and when they
return to your site and login, facebook lets them (because they have
before), but does not give you the email address.   i

[web2py] Re: Python vs Mavericks

2013-10-28 Thread Christian Foster Howes
thanks!  i didn't remember that i had installed python 2.7 myself and had 
to hack it to run with 10.9!

cfh

On Sunday, October 27, 2013 1:46:49 PM UTC-7, Jonathan Lundell wrote:

 Just FYI, in case this bites you. 

 I had installed Python 2.7.2 on my Mac some time back, and had an override 
 of PATH in .bash_profile to cause it to run. Today I noticed some odd 
 crashes of Python (doing simple stuff from a CLI). I removed the PATH 
 override, and got the (I guess) system default 2.7.5, which is working 
 fine, and is the current production version of Python 2. 



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


[web2py] Re: transfer local database to Google App Engine website

2013-10-28 Thread Christian Foster Howes
Also, keep in mind that there is not really a model on GAE big table 
(google datastore), so there is nothing to view in the console until you 
write rows to the database.  once you write data, you will be able to see 
the schema of the data that was written.

cfh

On Sunday, October 27, 2013 3:06:23 AM UTC-7, Niphlod wrote:

 any migration mentioned in the book refers to altering the table on the 
 backend (i.e. adding/removing columns, tables, and so on).
 You instead want to move the data within the local database to what is in 
 appspot.com  you need to do that AFTER you moved the application 
 directly on .appspot.com .
 If the model is not complicated, you can succesfully export all the local 
 data to a csv file and reimport that on appspot.com


 http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Exporting-and-importing-data

 On Sunday, October 27, 2013 3:36:24 AM UTC+1, books2be...@gmail.com wrote:

 I am trying to deploy my app on Google App Engine. I have a set of 
 databases that I've built up locally on my laptop that have been 
 interfacing just fine with my app when the app is running locally. However, 
 when I visit the .appspot.com address for my app, none of the databases 
 are present. Also, when I check my datastore on the GAE dashboard, it says 
 that I don't have any of those databases present. 
 I read the deployment recipe for GAE and it talks about migrating 
 databases. What I gleaned from reading that info was that if migrate was 
 set to true in the database definition, then the local-to-GAE-server 
 migration should take place automatically. However, this does not seem to 
 be working.

 Can someone help me out with this? Is my thought process for migrating 
 databases from my local computer to the GAE servers completely wrong? If 
 so, can you step through how exactly I can perform the transfer of the 
 databases?



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


[web2py] Re: NDB support for GAE

2013-10-28 Thread Christian Foster Howes
interesting  i as skim the NDB docs very quickly and the patch above i 
see that it is *very* similar to the DB Datastore/Big Table.  if the APIs 
are the same then we should just use the same DAL adapter with a parameter 
to use NDB.  Though because of the caching nature of NDB there may be a 
whole set of additional/different methods that need to be supported.

Saisha D: yes, the google:datastore in web2py currently is using the type 
of DB storage that you linked to (the only type of storage supported when 
web2py first integrated with GAE).

cfh

On Sunday, October 27, 2013 4:37:07 PM UTC-7, Massimo Di Pierro wrote:

 Thank you for the patch. I guess my question is why do we need a new 
 adapter? Is this for backward compatibility because otherwise it would 
 break apps that use Field('...',type='decimal(...)')?

 On Sunday, 29 September 2013 11:49:36 UTC-5, Quint wrote:

 Hi,

 I think web2py should support NDB for the Google Datastore.
 NDB a newer datastore api which has automatic caching features built in.

 https://developers.google.com/appengine/docs/python/ndb/

 I think it would be great for GAE users to be able to use NDB because it 
 potentially has better performance and can reduce the costs of your app 
 (dependent of the type of app off course).

 In fact, i think it wouldn't be that hard to integrate it.

 I had a go at it and i only had to change a couple of lines in dal.py and 
 it seems to work.
 You can switch between NDB and DB because they both should store exactly 
 the same data in the datastore.

 I attached a patch i made based on version 2.6.4
 Maybe one of the developers could have a look.

 I'm not a web2py expert so this does need to be reviewed by someone with 
 more in depth knowledge.
 But maybe this could serve as a starting point.

 resources:


 https://docs.google.com/document/d/1AefylbadN456_Z7BZOpZEXDq8cR8LYu7QgI7bt5V0Iw/mobilebasic

 http://dylanv.org/2012/08/22/a-hitchhikers-guide-to-upgrading-app-engine-models-to-ndb/

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


[web2py] Re: web2py vs webapp2 for bootstrap+gae combo

2013-10-17 Thread Christian Foster Howes
the setup is trivial to use bigtable (datastore).  once you have it running 
you'll never think about it again. ;)

i have not kept up to date with the default welcome app, but it used to 
just use the GAE bigtable if it noticed that it's running on GAE.  
bootstrap i think is used in the welcome app as well.

there is no current NDB support for web2py at this time.

cfh

On Tuesday, October 15, 2013 5:51:44 PM UTC-7, Saisha D wrote:

 Hi,

  I'm trying to quickly set up a website w/o prior experience. Pretty 
 familiar with Python and hence leaning towards web2py 
 since I heard good things and am impressed by the support/community around 
 it.

 I am going to use AppEngine for backend store with NDB API, and am 
 considering Twitter boostrap for UI as well since my friend who'll work 
 with me knows bootstrap decently.

 This is the other one I'm considering, 
 https://github.com/coto/gae-boilerplate
 It has a bunch of things set up that I need (gae ndb, twitter bootstrap, 
 login support etc)
 but my main worry is that there does not seem to be as much 
 traction/support around it as web2py.

 Am I going along the right path?
 Is the integration with GAE and twitter bootstrap easy and tried before so 
 that I can focus on building my app?  (sorry my search so far in this group 
 did not throw up anything obvious)

 many thanks in advance!!

 S




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


[web2py] Re: GAE: Running test. issue with exec_environment()

2013-10-15 Thread Christian Foster Howes
unittest on GAE has been a challenge for us as well.  right now we trigger 
our unittests via a controller run in the GAE dev server.  it's not pretty, 
but it mostly works and has the proper GAE env setup.  I'd love to figure 
out a cleaner way to make this happen.

here's the controller that we use to run the unittests:

def unittests():

Admin page from which the unit tests can be run


import os
from os.path import isfile, join
import sys
import glob
import logging

#get a list of the modules to test, and make it nice and readable
cdir = os.path.join('applications', request.application, 'tests')
if not os.path.isdir(cdir):
die(applications/%s/tests is not a directory%request.application)

# Get the files in the /tests directory
onlyfiles = [ f for f in os.listdir(cdir) if isfile(join(cdir,f)) ]

# Strip __init__.py
onlyfiles.remove('__init__.py')

# Name them nicely, for the javascript
correctly_named_files = [ f[:-3] for f in onlyfiles if f[-3:] == '.py']

return dict(
filename_list=correctly_named_files
)

def run_one_test():
Controller that ajax POSTs too from the unittest page to
get the result of one unit test in html form.

Returns this result as a string

import os
import sys
import cStringIO

from gluon.shell import env
from google.appengine.api import namespace_manager

#save stdout so we can capture data and reset it.
stdout = sys.stdout
stderr = sys.stderr

#get a list of the modules to test
test_file = os.path.join('applications', request.application, 'tests/', 
'%s.py'%request.args[0])

html = ''
namespace_manager.set_namespace('myapp_test')
globs = env(request.application, c='default', f='index',
import_models=True, extra_request={'test_db':True})

sys.stdout = cStringIO.StringIO()
execfile(test_file, globs)
report = sys.stdout.getvalue().strip()
if report.find('FAIL') = 0:
html += 'h3 class=failedFAILED/h3\n'
html += CODE(report, language='web2py', \
 link='/examples/global/vars/').xml()
else:
html += 'h3 class=passedPASSED/h3\n'

sys.stdout = stdout
return html


So then we launch GAE dev server, and visit our tests/unittests 
controller.  from there we select a test to run and it is run in the GAE 
environment.  note that we set a different GAE namespace for running tests 
in a clean DB.  We found that executing in a running controller was easier 
to setup the GAE environment properly then to get all the needed WSGI vars 
in the shell.

cfh

On Sunday, October 13, 2013 5:35:14 AM UTC-7, Quint wrote:

 Hi,

 I am trying to create a test for one of my modules.
 This module depends on several global variables like Resonse and some 
 extra things i store in current from one of my Models. (current.myapp.*** ).
 So to be able to run the test i need to execute some of the models like 
 this. (Is this the correct way?)
 (The testbed stuff is for GAE to create stubs for GAE services)

 def setUp (self):
 self.testbed = testbed.Testbed()
 self.testbed.activate()
 self.testbed.init_datastore_v3_stub()
 self.testbed.init_memcache_stub()
 exec_environment('applications/init/models/0.py')
 exec_environment('applications/init/models/db.py')

 I am using GAE with web2py 2.6.4 source and Python 2.7.3

 Now when i run the test i get this error:

 No handlers could be found for logger web2py
 DEBUG: connect attempt 0, connection error:
 Traceback (most recent call last):
   File C:\Users\Quint\Documents\Projects\GAE\***\gluon\dal.py, l
 ine 7854, in __init__
 self._adapter = ADAPTERS[self._dbname](**kwargs)
   File C:\Users\Quint\Documents\Projects\GAE\***\gluon\dal.py, l
 ine 2288, in __init__
 if do_connect: self.find_driver(adapter_args)
   File C:\Users\Quint\Documents\Projects\GAE\***\gluon\dal.py, l
 ine 791, in find_driver
 raise RuntimeError(no driver available %s % str(self.drivers))
 RuntimeError: no driver available ('sqlite2', 'sqlite3')

 So it looks like DAL is instantiated and by default it tries to connect to 
 sqlite?

 What can i do about this?

 BTW when i try to start the web2py shell i get a similar error only now i 
 says that it find a google driver:

 No handlers could be found for logger web2py
 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2013
 Version 2.6.4-stable+timestamp.2013.09.22.01.43.37
 Database drivers available: google
 DEBUG: connect attempt 0, connection error:
 Traceback (most recent call last):
   File X:\GAE\***\gluon\dal.py, line 7854, in __init__
 self._adapter = ADAPTERS[self._dbname](**kwargs)
   File X:\GAE\***\gluon\dal.py, line 2288, in __init__
 if do_connect: self.find_driver(adapter_args)
   File X:\GAE\***\gluon\dal.py, line 791, in find_driver
 raise RuntimeError(no driver 

Re: [web2py] Re: OFF topic - Git question

2013-09-26 Thread Christian Foster Howes
i believe that git submodules can also do what you are looking for.  not 
sure if that is easier/harder then symlinks.

On Wednesday, September 25, 2013 3:59:18 AM UTC-7, Marin Pranjić wrote:

 Yes gitignore is the answer but I have been burned once trying to git 
 reset so I lost my app repo.
 Now I am using symbolic links inside /applications folder and I keep 
 applications separated.

 Marin


 On Wed, Sep 25, 2013 at 12:49 PM, António Ramos 
 ramst...@gmail.comjavascript:
  wrote:

 This in gitignore is the answer right?

 applications/*
 !applications/welcome
 !applications/welcome/*
 !applications/examples
 !applications/examples/*
 !applications/admin
 !applications/admin/*
 applications/*/databases/*
 applications/*/sessions/*
 applications/*/errors/*
 applications/*/cache/*
 applications/*/uploads/*
 applications/*/*.py[oc]
 applications/examples/static/epydoc
 applications/examples/static/sphinx


 2013/9/25 António Ramos ramst...@gmail.com javascript:

 Hello , i´m starting to learn git but have a question

 I have my web2py cloned from git
 inside web2py i have the application folder
 if i git init inside app1 is there some kind of conflict with the web2py 
 folder git?


 Thank you

 António


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




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


[web2py] Re: How can I give google map javascript api marker title a suitably encoded string?

2013-09-26 Thread Christian Foster Howes
can you use an inspector to see the actual generated javascript?  it's 
possible that web2py is escaping the apostrophe.  you can try 
{{=XML(myobject.name)}}

On Tuesday, September 24, 2013 5:26:29 PM UTC-7, User wrote:

 I'm using the google map javascript api (v3). I have a google map in one 
 of my views.  I want to display the location name as the marker title (used 
 when hovering over the marker).  I'm using the following code in my view:
  
 {{block head}}
 script type=text/javascript
 function init_map() {
 var myLatlng = new google.maps.LatLng({{=myobject.lat}}, {{=
 myobject.lng}});
 var mapOptions = {
 center: myLatlng,
 zoom: 12,
 mapTypeId: google.maps.MapTypeId.ROADMAP
 };
 var map = new google.maps.Map(document.getElementById(map-canvas
 ),
 mapOptions);
 var marker = new google.maps.Marker({
 position: myLatlng,
 map: map,
 title: {{=myobject.name}}
 });
 }
 google.maps.event.addDomListener(window, 'load', init_map);
 /script
 {{end}}


  
 This works to output a map but when I mouse over the marker, the character 
 encoding is not right.  For example, if  myobject.name contains the 
 string John's Place then the marker tooltip will literally display 
 John#x27;s Place (that is, with the ampersand and hash).  How can I get 
 it to display the string as John's Place in a web safe manner?
  

  


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


Re: [web2py] Re: How can I give google map javascript api marker title a suitably encoded string?

2013-09-26 Thread Christian Foster Howes
i agree that if the data is from user input you want to make sure it is 
escaped.  the JSON might work for you.  one tip - if you are using 
python 2.7 it comes with a json lib (import json) that is written in c 
and probably faster then simplejson.


cfh

On 9/26/13 14:37 , User wrote:

Looking online people seem to suggest json encoding.  So what I'm doing now
is

def view():
 import gluon.contrib.simplejson.encoder
 myobject = db(db.objects.id == request.args(0)).select().first()
 myobject.nameJson = gluon.contrib.simplejson.encoder.encode_basestring(
myobject.name)
 return dict(myobject=myobject)


(Not sure if that's the correction json method to use) And then in the view
using XML as suggested by Christian.  This seems to properly escape
embedded quotes.  However as I am new to web2py I would appreciate others
input about the correctness of this.


On Thursday, September 26, 2013 5:14:40 PM UTC-4, User wrote:


Yes I by viewing source I could see that generated javascript string had
the character entity in it, so I knew the question was how to get web2py to
output it correctly.  Using XML works! thank you. By using XML the
generated string becomes John's Place

My next question is why? And is it still safe from user injected code?  At
first glance it looks like someone could possibly inject something (
myobject.name ultimately comes from user input).  Maybe I can just strip
out double quotes to make sure they can't close the string?

On Thursday, September 26, 2013 12:02:55 PM UTC-4, Christian Foster Howes
wrote:


can you use an inspector to see the actual generated javascript?  it's
possible that web2py is escaping the apostrophe.  you can try {{=XML(
myobject.name)}}

On Tuesday, September 24, 2013 5:26:29 PM UTC-7, User wrote:


I'm using the google map javascript api (v3). I have a google map in one
of my views.  I want to display the location name as the marker title (used
when hovering over the marker).  I'm using the following code in my view:

{{block head}}
script type=text/javascript
 function init_map() {
 var myLatlng = new google.maps.LatLng({{=myobject.lat}}, {{=
myobject.lng}});
 var mapOptions = {
 center: myLatlng,
 zoom: 12,
 mapTypeId: google.maps.MapTypeId.ROADMAP
 };
 var map = new google.maps.Map(document.getElementById(
map-canvas),
 mapOptions);
 var marker = new google.maps.Marker({
 position: myLatlng,
 map: map,
 title: {{=myobject.name}}
 });
 }
 google.maps.event.addDomListener(window, 'load', init_map);
/script
{{end}}



This works to output a map but when I mouse over the marker, the
character encoding is not right.  For example, if  myobject.namecontains the string 
John's Place then the marker tooltip will literally
display John#x27;s Place (that is, with the ampersand and hash).  How
can I get it to display the string as John's Place in a web safe manner?










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

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: How can I give google map javascript api marker title a suitably encoded string?

2013-09-26 Thread Christian Foster Howes
Niphlod is most likely right herei do so much on google app engine 
where their version JSON is faster since i can't upload a custom c lib.


thanks for the correction!

cfh

On 9/26/13 15:04 , Niphlod wrote:

offtopicsimplejson is always faster, make sure it's upgraded with pip
install --upgrade simplejson/offopic

On Thursday, September 26, 2013 11:50:18 PM UTC+2, Christian Foster Howes
wrote:


i agree that if the data is from user input you want to make sure it is
escaped.  the JSON might work for you.  one tip - if you are using
python 2.7 it comes with a json lib (import json) that is written in c
and probably faster then simplejson.

cfh






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

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Some forms need to be submitted multiple times.

2013-09-22 Thread Christian Foster Howes
i have noticed that if in the same browser i open the same page with the 
same form in multiple tabs my stored session data only stores 1 form key, 
so the most recently loaded tab will submit the form fine, the others will 
be denied until i reload the page.  any chance you have form key 
duplication?  or are losing the form key somehow?

On Saturday, September 21, 2013 7:16:17 AM UTC-7, Ian W. Scott wrote:

 Thanks Niphlod. I submit the form and get back the same form, empty. It's 
 as if the submitted data is just dumped and the page reloads as if nothing 
 had been sent.

 I'll try the replacement you suggest and get back to you.

 Ian

 On Friday, September 20, 2013 5:12:35 PM UTC-4, Niphlod wrote:

 I can't replicate it  but 1st thing to debug: remove that requires 
 and replace with a requires=IS_IN_SET(('America/Toronto')) ... 

 BTW: submitting 2 or 3 times what means exactly? that you put email and 
 password and you hit submit and you get back an error, the same login form, 
 the login form empty,  (fill the blanks :-P) ?

 On Friday, September 20, 2013 10:26:39 PM UTC+2, Ian W. Scott wrote:

 Sorry for the slow response. I'm experiencing this with 2.6.3 but have 
 also had the problem with the last couple of versions. It has been the kind 
 of thing that I keep putting off debugging because I'm not sure where to 
 start.

 Could it have to do with the way I'm extending the auth_user table? In 
 my db.py I have

 auth = Auth(db, hmac_key=Auth.get_or_create_key())  # 
 authent/authorization

 #adding custom field for user time zone
 auth.settings.extra_fields['auth_user'] = [
 Field('time_zone',
   'string',
   default='America/Toronto',
   requires=IS_IN_SET((common_timezones)),
   widget=SQLFORM.widgets.options.widget
   )
 ]

 Although I'm able to use the data from that field without any trouble.

 Ian

 On Wednesday, September 18, 2013 12:41:19 PM UTC-4, Massimo Di Pierro 
 wrote:

 Which version?

 On Wednesday, 18 September 2013 10:15:46 UTC-5, Ian W. Scott wrote:

 I'm experiencing an odd problem where some of my forms (including 
 registration and login forms) need to be submitted 2 or 3 times before 
 they 
 are processed. It's been hard to solve because it doesn't seem entirely 
 consistent. Has anyone run into this, and does anyone have any idea what 
 the cause would be?

 Thanks,

 Ian



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


Re: [web2py] Re: Some forms need to be submitted multiple times.

2013-09-22 Thread Christian Foster Howes
and i don't mind the design at alli can't think of a good reason 
that a real user would be in this situation.  i tend to break things 
when testing or doing rote admin tasks (with my admin forms not web2py 
admin)


cfh


On 9/22/13 9:11 , Massimo Di Pierro wrote:

That is by design. Perhaps we should change it. The problem is how not to
pollute the session with un-used keys.

On Sunday, 22 September 2013 10:53:26 UTC-5, Christian Foster Howes wrote:


i have noticed that if in the same browser i open the same page with the
same form in multiple tabs my stored session data only stores 1 form key,
so the most recently loaded tab will submit the form fine, the others will
be denied until i reload the page.  any chance you have form key
duplication?  or are losing the form key somehow?

On Saturday, September 21, 2013 7:16:17 AM UTC-7, Ian W. Scott wrote:


Thanks Niphlod. I submit the form and get back the same form, empty. It's
as if the submitted data is just dumped and the page reloads as if nothing
had been sent.

I'll try the replacement you suggest and get back to you.

Ian

On Friday, September 20, 2013 5:12:35 PM UTC-4, Niphlod wrote:


I can't replicate it  but 1st thing to debug: remove that requires
and replace with a requires=IS_IN_SET(('America/Toronto')) ...

BTW: submitting 2 or 3 times what means exactly? that you put email
and password and you hit submit and you get back an error, the same login
form, the login form empty,  (fill the blanks :-P) ?

On Friday, September 20, 2013 10:26:39 PM UTC+2, Ian W. Scott wrote:


Sorry for the slow response. I'm experiencing this with 2.6.3 but have
also had the problem with the last couple of versions. It has been the kind
of thing that I keep putting off debugging because I'm not sure where to
start.

Could it have to do with the way I'm extending the auth_user table? In
my db.py I have

auth = Auth(db, hmac_key=Auth.get_or_create_key())  #
authent/authorization

#adding custom field for user time zone
auth.settings.extra_fields['auth_user'] = [
 Field('time_zone',
   'string',
   default='America/Toronto',
   requires=IS_IN_SET((common_timezones)),
   widget=SQLFORM.widgets.options.widget
   )
]

Although I'm able to use the data from that field without any trouble.

Ian

On Wednesday, September 18, 2013 12:41:19 PM UTC-4, Massimo Di Pierro
wrote:


Which version?

On Wednesday, 18 September 2013 10:15:46 UTC-5, Ian W. Scott wrote:


I'm experiencing an odd problem where some of my forms (including
registration and login forms) need to be submitted 2 or 3 times before they
are processed. It's been hard to solve because it doesn't seem entirely
consistent. Has anyone run into this, and does anyone have any idea what
the cause would be?

Thanks,

Ian







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

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: (GAE) periodic updates

2013-08-25 Thread Christian Foster Howes
if you have a large number of users running this once a week might take a 
long time...

on app engine, use the app engine cron functionality to schedule a request 
once a week.  i'd point that to an instance that can run for long time 
periods (these were called backends and then in a recent release of the GAE 
SDK they created a new way to configure these instance and called them by a 
new name)

cfh

On Thursday, August 15, 2013 7:06:12 AM UTC-7, jjg0 wrote:

 (Using google app engine if that matters)

 I have a table that I want to update on a weekly basis.  Basically it's a 
 simple table of users with a date field that gets set to the last time they 
 did something and a field to indicate that they are active. I want to check 
 every Monday which users weren't active for the prior week and  set them to 
 inactive.  Is this possible?  What would I use to do this so this check is 
 only done once every week.  I could set this up to run every time someone 
 requests a page but that seems like a waste. I want this to somehow trigger 
 on its own.

 Thanks!


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: GAE Cron, or some equivelant

2013-08-25 Thread Christian Foster Howes
which version of the SDK are you using?  try visiting http://localhost:8000 
or http://127.0.0.1:8000  you should then see the GAE SDK admin console, 
and hopefully there is a link to cron from there.

also when you deploy you'll see cron jobs and their status in the gae admin 
console.

On Wednesday, August 21, 2013 10:23:07 AM UTC-7, jjg0 wrote:

 I am using the gae python sdk at the moment.  when I go to 
 http://localhost:8000/cron i see an invalid request.  

 On Tuesday, August 20, 2013 4:10:04 PM UTC-4, Niphlod wrote:

 I'm just reading through the docs.
 *Cron support in the development server* 

 When using the Python SDK, the dev_appserver has an admin interface that 
 allows you to view cron jobs at http://localhost:8000/cron.

 The development server doesn't automatically run your cron jobs. You can 
 use your local desktop's cron or scheduled tasks interface to trigger the 
 URLs of your jobs with curl http://curl.haxx.se/ or a similar tool.
 Are you on the dev server ?

 On Tuesday, August 20, 2013 10:00:41 PM UTC+2, jjg0 wrote:

 Still not getting this.  
 The gae docs says 'A cron.yaml file in the root directory of your 
 application (alongside app.yaml) configures scheduled tasks for your 
 Python application.'
 so I made a cron.yaml file in my root directory in /web2py folder right 
 where the app.yaml file is.  Looking at their example I set my cron.yaml 
 file to:

 cron:
 - description: test
 url: /default/test
 schedule: every 1 minutes

 where default/test is a function that adds an entry to a database.  I 
 can open my browser and go to myApp/default/test and see the entry gets 
 added, so it's safe to say the function works, however the cron.yaml file 
 doesn't seem to be doing anything.  I would expect this to be called every 
 minute but nothing happens.  What am I missing?



 On Tuesday, August 20, 2013 2:31:04 PM UTC-4, Niphlod wrote:

 Scheduler in GAE is not allowed. I'd go for their cron or their task 
 queue...

 https://developers.google.com/appengine/docs/python/config/cron?hl=itcsw=1

 https://developers.google.com/appengine/docs/python/taskqueue/?hl=itcsw=1#Using_Task_Queues_in_Python
 There's also a presentation that explains a little bit what they are

 http://dl.google.com/io/2009/pres/Th_1045_Offline_Processing_On_App_Engine_A_Look_Ahead.pdf

 On Tuesday, August 20, 2013 7:54:10 PM UTC+2, jjg0 wrote:

 nothing?

 On Monday, August 19, 2013 7:49:03 AM UTC-4, jjg0 wrote:

 I was referring to google app engine...
 The book hasn't been very helpful

 On Friday, August 16, 2013 6:05:41 PM UTC-4, Massimo Di Pierro wrote:

 It all depends on how you run web2py. If you run it with web2py.py 
 thank you can pass a command line option to enable cron and then you 
 need a 
 applications/app/cron/crontab file. if you run web2py with apache or 
 other 
 server via fcgi or wsgi, than you should use the scheduler instead. 
 This is 
 described in some detail in the book.


 On Friday, 16 August 2013 11:59:27 UTC-5, jjg0 wrote:

 I asked this in another topic but did not get any answers:(

 I have a table I want to update on a weekly basis and I'm trying to 
 find a way to have this run automatically.  I've looked around and it 
 seems 
 like I can use cron for this.  I am using google app engine and their 
 docs 
 on cron are different than whats in the web2py book.  After reading 
 both I 
 am still lost as to what I need to do.  

 Should I create a cron.yaml file in the web2py folder, or do I need 
 to use a crontab file in the applications \cron\crontab folder?  
 Is a crontab something completely different?  
 How do I turn cron on for gae? The book says cron is off and it 
 wants to use some experimental schedulers instead.
 Are there any good examples or tutorials on how to do this?  I see 
 a contrab.example file comes with web2py, but it is empty.

 Thanks



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: We need a new plan for javascript validators

2013-08-25 Thread Christian Foster Howes
joe,

about the money validator - if you set widget *and* requires on the Field 
object then you won't have the default integer validator.  just make sure 
that your validator converts the string/decimal number to an int so that it 
can be stored in the DB (which expects an int).

good luck!

cfh

On Sunday, August 25, 2013 12:42:27 PM UTC-7, Joe Barnhart wrote:

 I seem to keep underestimating the widget classes and their power.  

 Reading the code I can see that widgets pretty much own the fields and 
 their representation in all respects.  I can change input class, 
 represents, requires and pretty much anything else the Field needs to 
 show itself.

 class MoneyWidget(StringWidget):
 _class = 'money'
 ...etc...

 Some custom widgets and I think I'll be in business -- plus I can 
 selectively use or not use the javascript validators where I want.

 EDIT:

 Oope.  It isn't simple after all.  The form processing adds its OWN 
 validators according to... you guessed it... the type of the FIELD.  In 
 my case, I've changed the INPUT type to money but the FIELD type is still 
 integer (as required by SQL) so the automatic integer validator gets 
 added to my money validator and fails every attempt to edit the field in 
 appadmin.  I see no way to defeat the AUTOTYPES used in dictform which 
 in turn is used by appadmin.

 Sometimes these automatic helpers are really a pain in the rear.  it is 
 one of the few places where web2py falls down just a bit.

 -- Joe 

 On Sunday, August 25, 2013 7:00:54 AM UTC-7, Anthony wrote:

 Also, note that in this case, I think you can just do:

 Field('myfield', 'integer',
   widget=SQLFORM.widgets.string.widget)

 Anthony



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: WEB2PY iOS install APP

2013-08-25 Thread Christian Foster Howes
to run a web2py server on iOS that would require a python interpreter on 
iOS, and i don't know of one that exists.

cfh

On Saturday, August 24, 2013 5:26:34 PM UTC-7, vince wrote:

 i believe what he means is, create an ios app actually running web2py on 
 the device as backend server and with uiwebview accessing it.

 i've been looking for it too.

 On Friday, May 17, 2013 10:21:13 PM UTC+8, Christian Foster Howes wrote:

 i don't understand the question.  what are you trying to do?

 web2py can run the server code of a client-server application.  web2py 
 has nothing specific for iOS and has no control over the installation of 
 iOS apps.

 On Tuesday, May 14, 2013 3:51:06 PM UTC-7, Allan K wrote:

 Hi, 

 I need to work with an app for web2py, but I do not know if I can use 
 web2py with iOS and install apps as I can with windows and macOS.

 Thanks.



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: db.py size

2013-08-11 Thread Christian Foster Howes
i personally like to break things into logical units.  from an execution 
perspective i don't think it makes much of a difference how many files your 
model is broken into, but if there are groups of related tables that can be 
broken out it might make your editing much faster.

On Sunday, August 11, 2013 6:45:08 AM UTC-7, Alex Glaros wrote:

 Is the size of a model or controller file a reason for breaking it into 
 smaller files?

 my default/db.py file has over 100 tables and sometimes editing it is 
 slow.  Is editing speed by itself a reason for splitting up the file?

 thanks,

 Alex


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: deployment to google app engine did not include my static files

2013-08-10 Thread Christian Foster Howes
you need to change some other parts of app.yaml to enable threadsafeyou 
can't use a cgi handler.  i'll try and look up the answer in the next 
couple of days


On Thursday, August 8, 2013 7:47:10 PM UTC-7, davedigerati wrote:

 Christian - I'm a total n00b so unable to help as much as I would like, 
 but upon deployment of my app via the GoogleAppEngineLauncher on OS X 
 10.8.4, it fails with 

 Error parsing yaml file:

 threadsafe cannot be enabled with CGI handler: gaehandler.py

  in /Users/usernamehere/Dropbox/web2py/app.yaml, line 95, column 15

 If deploy fails you might need to 'rollback' manually.

 The Make Symlinks... menu option can help with command-line work.

 *** appcfg.py has finished with exit code 1 ***


 and my app.yaml referenced is

 application: sportssquaresonline
 version: 1
 api_version: 1

 # use this line for Python 2.5
 #
 #runtime: python

 # use these lines for Python 2.7
 # upload app with: appcfg.py update web2py (where 'web2py' is web2py's 
 root directory)
 #
 runtime: python27
 threadsafe: true# true for WSGI  concurrent requests (Python 2.7 only)

 default_expiration: 24h   # for static files

 let me know if you would like me to test anything...
 Dave

 On Sunday, August 4, 2013 7:59:54 PM UTC-4, Christian Foster Howes wrote:

 if you get a chance, can you describe how threadsafe==True was failing on 
 GAE?  i'm hoping to focus on making that work here in the next couple of 
 weeks

 thanks,

 christian

 On Sunday, August 4, 2013 12:16:02 PM UTC-7, davedigerati wrote:

 and I only updated the app name in app.yaml and runtime to 2.7 and 
 threadsafe to False since true was bombing and I need this dang thing 
 running an hour ago...

 On Sunday, August 4, 2013 3:12:16 PM UTC-4, davedigerati wrote:

 as you can see from here: http://sportssquaresonline.appspot.com/
 it did upload most of the static files, specifically 30, but the ones I 
 added, both images and a css file, it did not.
 any idea why???

 deployed both through the web2py admin feature and the GAE Launcher



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Deploying on GAE through the Admin interface

2013-08-07 Thread Christian Foster Howes
is it hard to warn users of that or disable the button in the admin 
interface?  i probably wouldn't have caught that detail. :(

On Wednesday, August 7, 2013 4:26:50 PM UTC-7, Massimo Di Pierro wrote:

 No no no. You need the source version to be able to deploy on GAE.

 On Wednesday, 7 August 2013 13:54:21 UTC-5, Morten Jeppesen wrote:

 Hi all

 I am trying to deploy on GAE through the admin interface (using the 
 latest web2py build on Mac OS X).

 However I get this error message:

 Traceback (most recent call last):
   File /usr/local/bin/appcfg.py, line 171, in 
 run_file(__file__, globals())
   File /usr/local/bin/appcfg.py, line 167, in run_file
 execfile(script_path, globals_)
   File 
 /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py,
  line 77, in 
 from google.appengine.tools import bulkloader
   File 
 /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py,
  line 139, in 
 from google.appengine.ext.bulkload import bulkloader_config
   File 
 /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/bulkload/bulkloader_config.py,
  line 47, in 
 from google.appengine.ext.bulkload import simplexml_connector
   File 
 /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/bulkload/simplexml_connector.py,
  line 40, in 
 from xml.etree import cElementTree as ElementTree
 ImportError: cannot import name cElementTree


 When executing 'from xml.etree import cElementTree as ElementTree' in Python 
 (launched in the terminal window) everything works fine...


 Any help would be very much appreciated.


 Thanks,

 Morten





-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Problem with function [pyfpdf] add_font() on GAE.

2013-08-04 Thread Christian Foster Howes
after a quick moment of asking google i saw the suggestions that your error 
indicates something wrong with the pickled itemwhich i think in this 
case is the font file.  is your font file in the right format to be loaded 
by fpdf?  (i have no familiarity with this error or fpdf so i'm just 
throwing out suggestions).

good luck!

cfh

On Saturday, August 3, 2013 4:40:10 AM UTC-7, Brez Yl wrote:

 In FILE: 
 /base/data/home/apps/s~myapp/web2py-04.369240954601780983/applications/app3/controllers/default.py

 Traceback (most recent call last):
   File 
 /base/data/home/apps/s~myapp/web2py-04.369240954601780983/gluon/restricted.py,
  line 212, in restricted
 exec ccode in environment
   File 
 /base/data/home/apps/s~myapp/web2py-04.369240954601780983/applications/app3/controllers/default.py,
  line 674, in module
   File 
 /base/data/home/apps/s~myapp/web2py-04.369240954601780983/gluon/globals.py, 
 line 194, in lambda
 self._caller = lambda f: f()
   File 
 /base/data/home/apps/s~myapp/web2py-04.369240954601780983/applications/app3/controllers/default.py,
  line 493, in up_plik
 pdf.add_font('DejaVu', '', 'DejaVuSansCondensed.ttf', uni=True)
   File 
 /base/data/home/apps/s~myapp/web2py-04.369240954601780983/gluon/contrib/fpdf/fpdf.py,
  line 432, in add_font
 font_dict = pickle.load(fh)
   File 
 /base/data/home/runtimes/python27p/python27_dist/lib/python2.7/pickle.py, 
 line 1378, in load
 return Unpickler(file).load()
   File 
 /base/data/home/runtimes/python27/python27_dist/lib/python2.7/pickle.py, 
 line 858, in load
 dispatch[key](self)
   File 
 /base/data/home/runtimes/python27/python27_dist/lib/python2.7/pickle.py, 
 line 966, in load_string
 raise ValueError, insecure string pickle
 ValueError: insecure string pickle




 On Saturday, August 3, 2013 10:24:28 AM UTC+2, Christian Foster Howes 
 wrote:

 can you post the stack trace to help us understand what went wrong?

 On Friday, August 2, 2013 3:19:43 AM UTC-7, Brez Yl wrote:

 Hello!

 I'm writing an app, which results with pdf file with some text with 
 unicode characters. On local GAE it works good, but after deploy it can't 
 import crash after add_font() (pyfpdf).

 The code is:

 # -*- coding: utf-8 -*-
 def fun1(): 

 from gluon.contrib.pyfpdf import FPDF, HTMLMixin
 class MyFPDF(FPDF, HTMLMixin):
 pass

 pdf =MyFPDF()
 pdf.add_font('DejaVu', '', 'DejaVuSansCondensed.ttf', uni=True)
 pdf.add_page()
 pdf.set_font('DejaVu','',16)
 pdf.write(10,'testąśł')
 
 response.headers['Content-Type']='application/pdf'
 return pdf.output(dest='S')

 The font files (with a file *DejaVuSansCondensed.pkl* generated after 
 first run on web2py server...) is in /gluon/contrib/fpdf/font. I didn't 
 add anything to routers.py (I'm using Pattern-based system) also app.yaml 
 is not changed.

 As I said on local (both web2py and gae) it works well. After deploy 
 only something like this works:
 pdf =MyFPDF()
 pdf.add_page()
 pdf.set_font('Arial','',16)
 pdf.write(10,'testąśł')

 But without unusual characters...

 The best solution would be to add my font files (like DejaVu), but 
 basically I need unicode characters in any font... maybe some 
 half-solution to use generic GAE unicode fonts... if it exist something 
 like this...



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Problem with function [pyfpdf] add_font() on GAE.

2013-08-04 Thread Christian Foster Howes
perhaps try printing the string fh at line 42 of 
gluon/contrib/fpdf/fpdf.py ?  maybe that will shed some light


do you know if the path to the font you are adding in your controller is 
correct for GAE?  i don't remember off the top of my head the default 
file path on GAE.


cfh

On 8/4/13 9:47 , Brez Yl wrote:

I think, the file is ok, for pdf/pyfpdf (as I said, it works good on
devservers). But maybe it is, in some way wrong for GAE... I'm confused.
But thanks for suggestion.

On Sunday, August 4, 2013 6:42:28 PM UTC+2, Christian Foster Howes wrote:


after a quick moment of asking google i saw the suggestions that your
error indicates something wrong with the pickled itemwhich i think in
this case is the font file.  is your font file in the right format to be
loaded by fpdf?  (i have no familiarity with this error or fpdf so i'm just
throwing out suggestions).

good luck!

cfh

On Saturday, August 3, 2013 4:40:10 AM UTC-7, Brez Yl wrote:


In FILE: 
/base/data/home/apps/s~myapp/web2py-04.369240954601780983/applications/app3/controllers/default.py

Traceback (most recent call last):
   File 
/base/data/home/apps/s~myapp/web2py-04.369240954601780983/gluon/restricted.py,
 line 212, in restricted
 exec ccode in environment
   File 
/base/data/home/apps/s~myapp/web2py-04.369240954601780983/applications/app3/controllers/default.py,
 line 674, in module
   File /base/data/home/apps/s~myapp/web2py-04.369240954601780983/gluon/globals.py, 
line 194, in lambda
 self._caller = lambda f: f()
   File 
/base/data/home/apps/s~myapp/web2py-04.369240954601780983/applications/app3/controllers/default.py,
 line 493, in up_plik
 pdf.add_font('DejaVu', '', 'DejaVuSansCondensed.ttf', uni=True)
   File 
/base/data/home/apps/s~myapp/web2py-04.369240954601780983/gluon/contrib/fpdf/fpdf.py,
 line 432, in add_font
 font_dict = pickle.load(fh)
   File 
/base/data/home/runtimes/python27p/python27_dist/lib/python2.7/pickle.py, 
line 1378, in load
 return Unpickler(file).load()
   File 
/base/data/home/runtimes/python27/python27_dist/lib/python2.7/pickle.py, line 
858, in load
 dispatch[key](self)
   File 
/base/data/home/runtimes/python27/python27_dist/lib/python2.7/pickle.py, line 
966, in load_string
 raise ValueError, insecure string pickle
ValueError: insecure string pickle




On Saturday, August 3, 2013 10:24:28 AM UTC+2, Christian Foster Howes
wrote:


can you post the stack trace to help us understand what went wrong?

On Friday, August 2, 2013 3:19:43 AM UTC-7, Brez Yl wrote:


Hello!

I'm writing an app, which results with pdf file with some text with
unicode characters. On local GAE it works good, but after deploy it can't
import crash after add_font() (pyfpdf).

The code is:

# -*- coding: utf-8 -*-
def fun1():

 from gluon.contrib.pyfpdf import FPDF, HTMLMixin
 class MyFPDF(FPDF, HTMLMixin):
 pass

 pdf =MyFPDF()
 pdf.add_font('DejaVu', '', 'DejaVuSansCondensed.ttf', uni=True)
 pdf.add_page()
 pdf.set_font('DejaVu','',16)
 pdf.write(10,'testąśł')

 response.headers['Content-Type']='application/pdf'
 return pdf.output(dest='S')

The font files (with a file *DejaVuSansCondensed.pkl* generated after
first run on web2py server...) is in /gluon/contrib/fpdf/font. I
didn't add anything to routers.py (I'm using Pattern-based system) also
app.yaml is not changed.

As I said on local (both web2py and gae) it works well. After deploy
only something like this works:
 pdf =MyFPDF()
 pdf.add_page()
 pdf.set_font('Arial','',16)
 pdf.write(10,'testąśł')

But without unusual characters...

The best solution would be to add my font files (like DejaVu), but
basically I need unicode characters in any font... maybe some
half-solution to use generic GAE unicode fonts... if it exist something
like this...







--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: deployment to google app engine did not include my static files

2013-08-04 Thread Christian Foster Howes
if you get a chance, can you describe how threadsafe==True was failing on 
GAE?  i'm hoping to focus on making that work here in the next couple of 
weeks

thanks,

christian

On Sunday, August 4, 2013 12:16:02 PM UTC-7, davedigerati wrote:

 and I only updated the app name in app.yaml and runtime to 2.7 and 
 threadsafe to False since true was bombing and I need this dang thing 
 running an hour ago...

 On Sunday, August 4, 2013 3:12:16 PM UTC-4, davedigerati wrote:

 as you can see from here: http://sportssquaresonline.appspot.com/
 it did upload most of the static files, specifically 30, but the ones I 
 added, both images and a css file, it did not.
 any idea why???

 deployed both through the web2py admin feature and the GAE Launcher



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Google crawler error

2013-08-04 Thread Christian Foster Howes
there is some variable in index.html that is none, but you are trying to 
access it as a Storage or dict i bet.   does you app expect/require login?  
is there something that is set conditionally based on the user agent?

On Saturday, August 3, 2013 9:07:45 PM UTC-7, James Burke wrote:

 Hi,

 My site seems to be working fine, but when I go onto Google Webmaster 
 Tools there are crawler errors.

 So I run the Fetch as Google tool and get *Unreachable page*. Which 
 produces the following ticket:

 Traceback (most recent call last):
 File 
 /base/data/home/apps/s~kaosaerialart/1.369256777018743792/gluon/restricted.py,
  
 line 212, in restricted
 exec ccode in environment\n File 
 /base/data/home/apps/s~kaosaerialart/1.369256777018743792/applications/init/views/default/index.html,
  
 line 32, in module
 TypeError: \'NoneType\' object has no attribute \'__getitem__\'

 My website is running on GAE.

 Any help appreciated!

 -James


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: IS web2py good for largescale

2013-08-03 Thread Christian Foster Howes
i service about 25 requests per second average 24 hours a day on google app 
engine.  perhaps that's only considered medium size these days, but it's 
running pretty well.

cfh

On Friday, August 2, 2013 2:46:31 PM UTC-7, Aurelio Tinio wrote:

 Curious to hear, what do you consider large scale?
 The more detailed you are about your project the better the response the 
 community can provide.

 Fwiw, having only worked with web2py since the beginning of the year I've 
 been contemplating similar questions too and essentially the answer is... 
 *it depends*. I've predominantly worked with other web frameworks (mainly 
 Django) in the past and there are definite pros/cons/tradeoffs in my mind 
 of why it'd be better to choose one versus the other. Happy to elaborate 
 but again, please provide more info so the reply could be more targeted.

 Cheers.

 On Thursday, August 1, 2013 8:04:27 PM UTC-7, hello world wrote:

 Hey
 I would like to know if web2py framework ...is a good framework for 
 making large scale websites...???..



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Problem with function [pyfpdf] add_font() on GAE.

2013-08-03 Thread Christian Foster Howes
can you post the stack trace to help us understand what went wrong?

On Friday, August 2, 2013 3:19:43 AM UTC-7, Brez Yl wrote:

 Hello!

 I'm writing an app, which results with pdf file with some text with 
 unicode characters. On local GAE it works good, but after deploy it can't 
 import crash after add_font() (pyfpdf).

 The code is:

 # -*- coding: utf-8 -*-
 def fun1(): 

 from gluon.contrib.pyfpdf import FPDF, HTMLMixin
 class MyFPDF(FPDF, HTMLMixin):
 pass

 pdf =MyFPDF()
 pdf.add_font('DejaVu', '', 'DejaVuSansCondensed.ttf', uni=True)
 pdf.add_page()
 pdf.set_font('DejaVu','',16)
 pdf.write(10,'testąśł')
 
 response.headers['Content-Type']='application/pdf'
 return pdf.output(dest='S')

 The font files (with a file *DejaVuSansCondensed.pkl* generated after 
 first run on web2py server...) is in /gluon/contrib/fpdf/font. I didn't 
 add anything to routers.py (I'm using Pattern-based system) also app.yaml 
 is not changed.

 As I said on local (both web2py and gae) it works well. After deploy only 
 something like this works:
 pdf =MyFPDF()
 pdf.add_page()
 pdf.set_font('Arial','',16)
 pdf.write(10,'testąśł')

 But without unusual characters...

 The best solution would be to add my font files (like DejaVu), but 
 basically I need unicode characters in any font... maybe some 
 half-solution to use generic GAE unicode fonts... if it exist something 
 like this...


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: strange decimal form field comparison result

2013-07-25 Thread Christian Foster Howes
never trust  or  on decimal or floats.  both are an in-exact 
representations of numbers and can have unexpected behaviors for numbers 
that are close to each other.  i have converted my applications that use 
prices to store all prices in the DB in cents as integers and convert on 
display to the format people are used to seeing.

On Wednesday, July 24, 2013 1:58:23 AM UTC-7, 黄祥 wrote:

 hi folks,

 i have a decimal form field that validate during submit (running on web2py 
 2.5.1):

 e.g. on controller
 def product():
 grid=SQLFORM.grid(db.product, onvalidation=__onvalidation_product)
 return locals()

 def __onvalidation_product(form):
 *if form.vars.price_list = form.vars.selling_price:*
 form.errors.selling_price = 'Selling Price must Greater than Price 
 List'

 when i insert price_list = 3 and selling_price = 3 the notification 
 appears in the form field  prevent the data to be inserted. i think, it 
 should be : when i insert price_list = 3 and selling_price = 3 the 
 notification not appears and the data can be inserted

 but
 def __onvalidation_product(form):
 *if form.vars.price_list  form.vars.selling_price:*
 form.errors.selling_price = 'Selling Price must Greater than Price 
 List'

 when i insert price_list = 3 and selling_price = 3 the notification not 
 appears and the data can be insert. i think, it should be : when i insert 
 price_list = 3 and selling_price = 3 the notification appears to prevent 
 the data to be inserted

 is there any mistake in my logic or code above?

 thanks and best regards


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Front-end dev workflow on OS X?

2013-07-20 Thread Christian Foster Howes
also note that you can install web2py from source and then browse the 
folders as you normally would.  you just might have to start the web2py 
server manually rather then click an icon.

On Friday, July 19, 2013 9:27:42 AM UTC-7, Massimo Di Pierro wrote:

 Sorry now I understand. I do not have a solution other then create a 
 symbolic link:
 http://hints.macworld.com/article.php?story=2001110610290643

 open the OSX Terminal and type

 ln -s /Applications/web2py.app/Contents/Resources/ 
 /Users/you/Desktop/web2py_contents

 then edit the files inside /Users/you/Desktop/web2py_contents

 On Friday, 19 July 2013 07:51:13 UTC-5, davedigerati wrote:

 Massimo, first and foremost kudos and thanks to you for leading such a 
 fabulous framework!  I am a former php'er learning python through web2py 
 and enjoying it immensely.

 I am able to find the files as you describe, but the problem is not for 
 me to find the files, but for programs.  Applications such as text editors 
 can not see these files in this way.  To them they can only see the one 
 app/package.  So normally where a program like Coda would be able to 
 'import' all the files of a project for the designer to then edit css, html 
 code, Coda can not.

 With the number of designers on Mac I'm assuming there is a way for this 
 to work, but could not find it in google/this group/or the documentation.  

 I tried coping them outside the package to then edit them, but of course 
 they were no longer seen by the app and previewing them as raw html is next 
 to useless then.

 Basically I need to globally reset the apps views and static files path 
 to one outside the package, perform some sort of symlink magic, start 
 exploring compiling from source which I suspect will not be a tidy app and 
 editable files, or hope that someone here has already solved this;)

 Thanks!

 On Friday, July 19, 2013 4:49:48 AM UTC-4, Massimo Di Pierro wrote:

 A Mac Package is nothing but a folder with name ending in .app. Right 
 click on it from Finder and click on Show Package Contents. This will 
 open the package and you will be able to browse it and edit the fields it 
 contains, in particular Contents/Resources/applications/

 On Thursday, 18 July 2013 22:26:48 UTC-5, davedigerati wrote:


 Newbie, first app with web2py, on OS X, have tried google/group/docs 
 and am struggling with workflow:

 The Mac binary is a package so the views  static files are hidden from 
 the system- how are people designing front ends without pulling the files 
 out (which breaks previewing) ?



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Mobile and Tablets detection

2013-07-20 Thread Christian Foster Howes
is the WURFL library of devices more or less complete then the mobile 
browser list?  http://wurfl.sourceforge.net/  I used the WURFL 5-6 years 
ago and found it to be the most complete open-source list at the time.

On Wednesday, July 17, 2013 11:57:28 PM UTC-7, AngeloC wrote:

 Hi Marcio,

 I'm planning to grow the supported mobile devices list in web2py, but the 
 support right now is fairly extensive. 
 I got the user agent strings here 
 http://www.useragentstring.com/pages/Mobile%20Browserlist/ and added at 
 least one of the devices for each family to the unit test of 
 gluon/contrib/user_agent_parser.py .

 That class right now could discriminate between phone and tablets, so I 
 think you can't find somany differences with http://mobiledetect.net/ .

 Sincerly,
 Angelo

 -- 
 Profile: http://it.linkedin.com/in/compagnucciangelo 


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Errors after upgrade

2013-07-18 Thread Christian Foster Howes
on google app engine i had a module called utils that started to conflict 
with a module of the same name in the gluon directory with the updated 
importer.  there is no web2py module called utility that i see, but still 
you might check for module name collusion.

cfh

On Tuesday, July 16, 2013 4:59:10 PM UTC-7, Maggs wrote:

 So I upgraded from web2py version 1.99.7, which I've been using for some 
 time, to version 2.5.1. I have a module called utility under my modules 
 folder that has multiple functions and is imported at the top of the 
 controller. When I upgraded to version 2.5.1 I am now getting this error:
 type 'exceptions.AttributeError' 'module' object has no attribute 
 'sortSUs'
 when calling a function in the utility module. Which worked just fine in 
 version 1.99.7. Any ideas why this may be happening? I am using Eclipse and 
 have the web2py folder in the python path.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Session Issues seen when users log into Web2py with an Andriod App

2013-07-13 Thread Christian Foster Howes
massimo's statement is a good starting point.  for debugging i highly 
recommend getting charles http proxy: http://www.charlesproxy.com/  it's my 
best friend in debugging network calls from mobile apps!

once you have some details about the networks calls and cookies etc we 
should be able to help you more.

good luck,

cfh

On Thursday, July 11, 2013 8:19:38 PM UTC-7, Ravindra Pai wrote:

 We have decided to use Web2py Framework to develop an Android app. As a 
 part of the app, we would like to know the users who have logged in.

 My problem is that I can easily accomplish it ( auth.user_id ) though 
 browser. However, when used with Andriod App, auth.user_id returns NONE. 

 a) Because it works fine on Browser, the auth table is populated 
 correctly. So, the AUTH settings are fine.

 b) The session ID is okay ( though the IP address is not populated 
 correctly ). 

 [Thu Jul 11 19:40:15 2013] [error] in Json to g [Thu Jul 11 19:40:15 2013] 
 [error] auth.user_id = None [Thu Jul 11 19:40:15 2013] [error] 
 response.session_id = None:93a38-4854-441f-a8c8-bcce624b1aff

 c) However, as seen above, the user_id returns null. 

 d) The events table is also empty.

 Can anyone please tell me how to debug this issue? 


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: upgrading appengine has broken web2py

2013-07-12 Thread Christian Foster Howes
I'm storing session in the database given the large number of active 
users i have at anytime and the un-predictable eviction of GAE memcache.


sorry that's not very helpful. :(

cfh

On 7/12/13 7:36 , Carl wrote:

Chrtistian... are you using MemcacheClient in your db.py file?
I've take a copy of the master source code and moved to db =
DAL('google:datastore') but I'm not sure if I need to set-up session
management differently to earlier versions of Web2py.

I currently have session.connect(request, response,
MEMDB(MemcacheClient(request))



On Tuesday, 18 June 2013 14:20:07 UTC+1, Christian Foster Howes wrote:


Carl,

i have been working through my web2py upgrade to 2.5.1 + GAE SDK 1.8.1
upgrade and am not seeing any problems with DAL or GQL.  i did have to
change some cache.ram.flush_all() to cache.ram.clear() to work with the
latest web2py, and am making adjustments to work with the updated
custom_import code.

cfh

On 6/18/13 1:57 , Massimo Di Pierro wrote:

None except that some very old web2py GAE applications may be doing

import

gql. It is there only for backward compatibility.

On Tuesday, 18 June 2013 03:21:00 UTC-5, Carl wrote:


hi Massimo,

What would be the implications of removing the gql modulefrom Web2py?




On 12 April 2013 16:17, Massimo Di Pierro massimo@gmail.comjavascript:



wrote:



I proposed in web2py 2.5 we remove the gql module.


On Friday, 12 April 2013 05:21:10 UTC-5, Carl wrote:


Removing the line from gluon.contrib.gql import * removed the error
and allows my app to launch.

I next run into this error:
File F:\wp\TestEnvoy\web2py\gluon\**main.py, line 555, in

wsgibase

  session._try_store_in_db(**request, response)
File F:\wp\TestEnvoy\web2py\gluon\**globals.py, line 747, in
_try_store_in_db
  record_id = table.insert(**dd)
File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 256,

in

insert
  id = self._create_id()
File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 291,

in

_create_id
  id = self._tableobj.incr(shard_id)
AttributeError: 'MemcacheClient' object has no attribute 'incr'

One for me to investigate.



On Friday, 12 April 2013 11:06:38 UTC+1, Carl wrote:


has my db.py content fallen out of date?

it includes:
from gluon.sql import SQLCustomType

if request.env.web2py_runtime_**gae: # if running on Google App

Engine

  from gluon.contrib.gql import *
  db = DAL('gae')


On Friday, 12 April 2013 11:00:09 UTC+1, Carl wrote:


actually.. while getting an unknown ticket if I request the url a
second time I get this:

File

F:\wp\TestEnvoy\web2py\**applications\init\models\db.**py,

line 13, in module
  from gluon.contrib.gql import *
File F:\wp\TestEnvoy\web2py\gluon\**custom_import.py, line

100,

in custom_importer
  return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named gql

That's fairly obvious because I've just delete gql.py! :)


On Friday, 12 April 2013 07:48:27 UTC+1, Carl wrote:


If I remove the file (and its .pyc) then I get a web2py Ticket
issued: unknown

I'll try upgrading again.



On Friday, 12 April 2013 02:58:27 UTC+1, Massimo Di Pierro wrote:


What if you delete that file?

On Thursday, 11 April 2013 12:31:15 UTC-5, Carl wrote:


With an update to appengine, all is still fine when running

web2py

locally.
but if I run dev_appserver then on start-up I get the following
kicked out at the console...

   File F:\wp\TestEnvoy\web2py\gluon\**contrib\gql.py, line 5,

in

module
  from gluon.dal import DAL, Field, Table, Query, Set,
Expression, Row, Rows, *drivers*, BaseAdapter, SQLField,

SQLTable,

SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB,

SQLALL,

SQLCustomType, gae
ImportError: cannot import name *drivers*
*
*
\contrib\gql.py exists for backward compatibility.

This looks like I've tripped up somewhere really simple. Can

anyone

point me in the right direction?


   --


---
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/0XH6l1394mA/unsubscribe?hl=en.



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














--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: upgrading appengine has broken web2py

2013-07-12 Thread Christian Foster Howes
bummer.  i am successfully using memcache in other parts of my GAE app, 
so maybe it's a problem with how memdb uses GAE memcache?


cfh

On 7/12/13 10:56 , Carl Roach wrote:

that's great to know!
that's probably why Web2py didn't break for you but did for me... it broke
GAE memcache.

thanks for getting back to me.




On 12 July 2013 18:26, Christian Foster Howes cfho...@gmail.com wrote:


I'm storing session in the database given the large number of active users
i have at anytime and the un-predictable eviction of GAE memcache.

sorry that's not very helpful. :(

cfh

On 7/12/13 7:36 , Carl wrote:


Chrtistian... are you using MemcacheClient in your db.py file?
I've take a copy of the master source code and moved to db =
DAL('google:datastore') but I'm not sure if I need to set-up session
management differently to earlier versions of Web2py.

I currently have session.connect(request, response,
MEMDB(MemcacheClient(request))



On Tuesday, 18 June 2013 14:20:07 UTC+1, Christian Foster Howes wrote:



Carl,

i have been working through my web2py upgrade to 2.5.1 + GAE SDK 1.8.1
upgrade and am not seeing any problems with DAL or GQL.  i did have to
change some cache.ram.flush_all() to cache.ram.clear() to work with the
latest web2py, and am making adjustments to work with the updated
custom_import code.

cfh

On 6/18/13 1:57 , Massimo Di Pierro wrote:


None except that some very old web2py GAE applications may be doing


import


gql. It is there only for backward compatibility.

On Tuesday, 18 June 2013 03:21:00 UTC-5, Carl wrote:



hi Massimo,

What would be the implications of removing the gql modulefrom Web2py?




On 12 April 2013 16:17, Massimo Di Pierro massimo@gmail.com**
javascript:




  wrote:




  I proposed in web2py 2.5 we remove the gql module.



On Friday, 12 April 2013 05:21:10 UTC-5, Carl wrote:



Removing the line from gluon.contrib.gql import * removed the error
and allows my app to launch.

I next run into this error:
 File F:\wp\TestEnvoy\web2py\gluon\main.py, line 555, in


wsgibase



session._try_store_in_db(request, response)

 File F:\wp\TestEnvoy\web2py\gluon\globals.py, line 747, in
_try_store_in_db
   record_id = table.insert(**dd)
 File F:\wp\TestEnvoy\web2py\gluon\contrib\memdb.py, line
256,


in



  insert

   id = self._create_id()
 File F:\wp\TestEnvoy\web2py\gluon\contrib\memdb.py, line
291,


in



  _create_id

   id = self._tableobj.incr(shard_id)
AttributeError: 'MemcacheClient' object has no attribute 'incr'

One for me to investigate.



On Friday, 12 April 2013 11:06:38 UTC+1, Carl wrote:



has my db.py content fallen out of date?

it includes:
from gluon.sql import SQLCustomType

if request.env.web2py_runtime_gae: # if running on Google App


Engine



from gluon.contrib.gql import *

   db = DAL('gae')


On Friday, 12 April 2013 11:00:09 UTC+1, Carl wrote:



actually.. while getting an unknown ticket if I request the url a
second time I get this:

 File


F:\wp\TestEnvoy\web2py\applications\init\models\db.py,



  line 13, in module

   from gluon.contrib.gql import *
 File F:\wp\TestEnvoy\web2py\gluon\custom_import.py, line


100,



  in custom_importer

   return NATIVE_IMPORTER(name, globals, locals, fromlist,
level)
ImportError: No module named gql

That's fairly obvious because I've just delete gql.py! :)


On Friday, 12 April 2013 07:48:27 UTC+1, Carl wrote:



If I remove the file (and its .pyc) then I get a web2py Ticket
issued: unknown

I'll try upgrading again.



On Friday, 12 April 2013 02:58:27 UTC+1, Massimo Di Pierro wrote:



What if you delete that file?

On Thursday, 11 April 2013 12:31:15 UTC-5, Carl wrote:



With an update to appengine, all is still fine when running


web2py



  locally.

but if I run dev_appserver then on start-up I get the following
kicked out at the console...

File F:\wp\TestEnvoy\web2py\gluon\contrib\gql.py,
line 5,


in



  module

   from gluon.dal import DAL, Field, Table, Query, Set,
Expression, Row, Rows, *drivers*, BaseAdapter, SQLField,


SQLTable,



  SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB,



SQLALL,



  SQLCustomType, gae

ImportError: cannot import name *drivers*
*
*
\contrib\gql.py exists for backward compatibility.

This looks like I've tripped up somewhere really simple. Can


anyone



  point me in the right direction?


 --





---
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/0XH6l1394mA/**
unsubscribe?hl=enhttps://groups.google.com/d/topic/web2py/0XH6l1394mA/unsubscribe?hl=en
.




  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/**groups/opt_outhttps://groups.google.com/groups/opt_out

Re: [web2py] Re: Error writing to session with latest Google App Engine 1.8.1

2013-07-06 Thread Christian Foster Howes
we did the upgrade and are running latest web2py release + GAE latest 
SDK.  we pulled forward 2 patches - one for using custom tables with 
auth (so if you use standard auth tables you don't need that patch), and 
one for handling JSON lists as post data for restful requests.


we also had to update our cache.ram.flush_all() to just 
catch.ram.flush()  (i think that was the changethe details are foggy 
right now).


everything else just worked for us.

cfh

On 7/5/13 23:54 , Aravindan Rs wrote:

hi cfh,

did you complete the move to the recent web2py version? does it solve the
issue and work well with GAE version 1.8.1? i want to move now and any
notes from you would be helpful.

thanks,
aravind.

On Saturday, 15 June 2013 06:18:06 UTC+5:30, Christian Foster Howes wrote:


Yup, that change is why i'm upgrading web2py now.  Other GAE users have
reported issues with the recent web2py versions, and i think i found an
issue in the auth module when using custom table names.  I'll let you
know my results as i do my testing

cfh

On 6/14/13 17:33 , Aravindan Rs wrote:

Thanks - I assume you are talking about the change from class
Reference(int) to class Reference(long). Should work I think.
Btw: This fix was done quite some time ago (on Jan 1st 2013 -


https://github.com/web2py/web2py/commit/dd3055836a3f8fbc5b06763710c369cab3f3fc40)


- so patch might not be necessary. I'll move to latest web2py and check.

Thanks again,
Aravind.


On Friday, 14 June 2013 20:16:41 UTC+5:30, Christian Foster Howes wrote:


Aravind,

I see that in trunk (and perhaps the latest web2py release) i think

that

this has been fixed.  Please make sure you are using the latest web2py
version.  I'm working on upgrading to the latest web2py version and

then

the latest GAE SDK to get things working for me.  There may be some

patches

coming, hopefully later today

cfh

On Thursday, June 13, 2013 2:15:46 AM UTC-7, Aravindan Rs wrote:


Hi,

I get the following error stack on login / logout when session object

is

attempted to be written to the database:

Traceback (most recent call last):
File

/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/main.py,
line 551, in wsgibase

  session._try_store_in_db(request, response)
File

/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/globals.py,
line 728, in _try_store_in_db

  record_id = table.insert(**dd)
File

/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py,
line 7806, in insert

  ret =  self._db._adapter.insert(self,self._listify(fields))
File

/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py,
line 4618, in insert

  rid = Reference(tmp.key().id())
OverflowError: Python int too large to convert to C long



I'm using Google App Engine - with python 2.7 and web2py.

I have one version of application which was deployed yesterday - this

is

still working (i.e. no such errors during login/logout). I deploy the

same

code today and it does not work. This morning google sent a release
announcement for google app engine 1.8.1. The change was related to
scattered auto ID (64 bits). I'm guessing my problem could be due app
engine change.

Are others facing similar problem? Any known solutions?

Warm Regards,
Aravind.











--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: GAE 1.8.1 and logging doesn't work

2013-06-20 Thread Christian Foster Howes
i have not updated my local launcher to 1.8.1 yethopefully tomorrow.  
but in past versions of GAE i have changed line 74 of gaehandler.py (at the 
web2py top-level) to:

#logging.basicConfig(level=logging.INFO)
#access the GAE logging handler and set level to ignore debug logs
logging.getLogger().handlers[0].setLevel(logging.INFO)

that seemed to help me weed out some extra logs (i never had luck with 
logging.conf and GAE).  can you try and see if that helps?  if so let's 
submit an patch to massimo!

thanks,

christian

On Wednesday, June 19, 2013 8:26:54 AM UTC-7, José Manuel López wrote:


 Hi!,
 I've change to GAE 1.8.1 and suddenly (before, with GAE 1.7.5 everything 
 worked ok) the LOG is not working. None of my debugs lines are dump to 
 console. Then I've see that my logging.conf was not being used. This is my 
 log config:

 [loggers]
 keys=root,rocket,markdown,web2py,rewrite,cron,app,welcome, myApp

 [logger_myApp]
 level=DEBUG
 qualname=web2py.app.myApp
 handlers=consoleHandler
 propagate=0
 and in my controller:
 import logging
 logger = logging.getLogger(request.application)
 logger.setLevel(logging.DEBUG)

 Anyone knows why this is happening  or any clue at least?
 Any help will be very appreciated. 
 Thank you in advance


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How should we work to sync localhost development with GAE?

2013-06-19 Thread Christian Foster Howes
Are you using BigTable or Google Cloud SQL for data storage?  i'm 
surprised that import to BigTable would give an integrity error.


note that if you are import/export as a controller you will be limited 
by what you can do in 128MB of ram and 60 seconds of processing unless 
you use larger instance classes and/or backend instances.


cfh

On 6/19/13 4:05 , peibol wrote:

Thanks Cristian. What I'm considering is use a export/import function in
the app, only visible to the administrator. Because I want to develop a
kind of wiki, with its content, on local. So I'll use export_to_csv_file
and import_from_csv_file.

The export process is working for me right now, but the import process
gives an integrity error.

Reading the book, it must be some issue with the uuids...



El miércoles, 19 de junio de 2013 07:28:02 UTC+2, Christian Foster Howes
escribió:


  i wouldn't copy data personally, i consider localhost a test environment,
and GAE proper production and i just make my production data there.

if you do want to copy data look at the GAE bulk loader:
https://developers.google.com/appengine/docs/python/tools/uploadingdata




--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] upgrading appengine has broken web2py

2013-06-19 Thread Christian Foster Howes

patch submitted here: https://code.google.com/p/web2py/issues/detail?id=1546

note that i had been using cache.ram.flush_all() for clearing GAE 
memcache, but that changed to using cache.ram.clear() in this version. 
i just updated my source. :)


i also had to tweak my path configs for unit testing, and rename a 
module that i had called utils.py to work with the new 
custom_import.py (my utils module was clashing with gluon/utils.py with 
the updated importer).


christian

On 6/18/13 6:36 , Massimo DiPierro wrote:

I did see two problems addressed in a commit today.

gql imports drivers from dal.py but drivers was renamed DRIVERS. If people did 
not notice this it means they are not importing gql. This is great. It means 
this backward compatibility file can be removed. So I just did.

The second issue is that gae_memcache has an increment method instead of incr, 
as expected by memdb. This is now fixed too.

Please submit any patch you may have, even if partial.

massimo

On Jun 18, 2013, at 8:20 AM, Christian Foster Howes wrote:


Carl,

i have been working through my web2py upgrade to 2.5.1 + GAE SDK 1.8.1 upgrade 
and am not seeing any problems with DAL or GQL.  i did have to change some 
cache.ram.flush_all() to cache.ram.clear() to work with the latest web2py, and 
am making adjustments to work with the updated custom_import code.

cfh

On 6/18/13 1:57 , Massimo Di Pierro wrote:

None except that some very old web2py GAE applications may be doing import
gql. It is there only for backward compatibility.

On Tuesday, 18 June 2013 03:21:00 UTC-5, Carl wrote:


hi Massimo,

What would be the implications of removing the gql modulefrom Web2py?




On 12 April 2013 16:17, Massimo Di Pierro massimo@gmail.comjavascript:

wrote:



I proposed in web2py 2.5 we remove the gql module.


On Friday, 12 April 2013 05:21:10 UTC-5, Carl wrote:


Removing the line from gluon.contrib.gql import * removed the error
and allows my app to launch.

I next run into this error:
   File F:\wp\TestEnvoy\web2py\gluon\**main.py, line 555, in wsgibase
 session._try_store_in_db(**request, response)
   File F:\wp\TestEnvoy\web2py\gluon\**globals.py, line 747, in
_try_store_in_db
 record_id = table.insert(**dd)
   File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 256, in
insert
 id = self._create_id()
   File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 291, in
_create_id
 id = self._tableobj.incr(shard_id)
AttributeError: 'MemcacheClient' object has no attribute 'incr'

One for me to investigate.



On Friday, 12 April 2013 11:06:38 UTC+1, Carl wrote:


has my db.py content fallen out of date?

it includes:
from gluon.sql import SQLCustomType

if request.env.web2py_runtime_**gae: # if running on Google App Engine
 from gluon.contrib.gql import *
 db = DAL('gae')


On Friday, 12 April 2013 11:00:09 UTC+1, Carl wrote:


actually.. while getting an unknown ticket if I request the url a
second time I get this:

   File F:\wp\TestEnvoy\web2py\**applications\init\models\db.**py,
line 13, in module
 from gluon.contrib.gql import *
   File F:\wp\TestEnvoy\web2py\gluon\**custom_import.py, line 100,
in custom_importer
 return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named gql

That's fairly obvious because I've just delete gql.py! :)


On Friday, 12 April 2013 07:48:27 UTC+1, Carl wrote:


If I remove the file (and its .pyc) then I get a web2py Ticket
issued: unknown

I'll try upgrading again.



On Friday, 12 April 2013 02:58:27 UTC+1, Massimo Di Pierro wrote:


What if you delete that file?

On Thursday, 11 April 2013 12:31:15 UTC-5, Carl wrote:


With an update to appengine, all is still fine when running web2py
locally.
but if I run dev_appserver then on start-up I get the following
kicked out at the console...

  File F:\wp\TestEnvoy\web2py\gluon\**contrib\gql.py, line 5, in
module
 from gluon.dal import DAL, Field, Table, Query, Set,
Expression, Row, Rows, *drivers*, BaseAdapter, SQLField, SQLTable,
SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, SQLALL,
SQLCustomType, gae
ImportError: cannot import name *drivers*
*
*
\contrib\gql.py exists for backward compatibility.

This looks like I've tripped up somewhere really simple. Can anyone
point me in the right direction?


  --


---
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/0XH6l1394mA/unsubscribe?hl=en.
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/groups/opt_out.












--

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

Re: [web2py] Re: How should we work to sync localhost development with GAE?

2013-06-19 Thread Christian Foster Howes

I haven't used that code in a long time as my tables are too big. :(

what's the traceback that you get?

On 6/19/13 7:23 , peibol wrote:

Bigtable. I don't have any other models but the standard auth ones and the
builtin wiki ones and I'm using this code (just the one stated in the book):

def import_and_sync():
 form = FORM(INPUT(_type='file', _name='data'), INPUT(_type='submit'))
 if form.process().accepted:
 db.import_from_csv_file(form.vars.data.file,unique=False)
 # for every table
 for table in db.tables:
 # for every uuid, delete all but the latest
 items = db(db[table]).select(db[table].id,
db[table].uuid,
orderby=db[table].modified_on,
groupby=db[table].uuid)
 for item in items:

db((db[table].uuid==item.uuid)(db[table].id!=item.id)).delete()
 return dict(form=form)


def export():
 s = cStringIO.StringIO()
 db.export_to_csv_file(s)
 response.headers['Content-Type'] = 'text/csv'
 return s.getvalue()





El miércoles, 19 de junio de 2013 15:14:57 UTC+2, Christian Foster Howes
escribió:


Are you using BigTable or Google Cloud SQL for data storage?  i'm
surprised that import to BigTable would give an integrity error.

note that if you are import/export as a controller you will be limited
by what you can do in 128MB of ram and 60 seconds of processing unless
you use larger instance classes and/or backend instances.

cfh

On 6/19/13 4:05 , peibol wrote:

Thanks Cristian. What I'm considering is use a export/import function in
the app, only visible to the administrator. Because I want to develop a
kind of wiki, with its content, on local. So I'll use export_to_csv_file
and import_from_csv_file.

The export process is working for me right now, but the import process
gives an integrity error.

Reading the book, it must be some issue with the uuids...



El mi�rcoles, 19 de junio de 2013 07:28:02 UTC+2, Christian Foster

Howes

escribi�:


   i wouldn't copy data personally, i consider localhost a test

environment,

and GAE proper production and i just make my production data there.

if you do want to copy data look at the GAE bulk loader:
https://developers.google.com/appengine/docs/python/tools/uploadingdata








--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: How should we work to sync localhost development with GAE?

2013-06-19 Thread Christian Foster Howes
check your CSV file - that error looks to me like there are 2 columns 
with the name title and therefore the DB does not know what data to 
store where.


On 6/19/13 8:38 , peibol wrote:

Here is what I get:


Error ticket for myeducenterTicket ID

127.0.0.1.2013-06-19.17-34-43.e551a8f8-a45b-4b22-9e22-e76381dc5977
class 'sqlite3.IntegrityError' column title is not uniqueVersiónweb2py™Version
2.5.1-stable+timestamp.2013.06.11.08.00.05PythonPython 2.7.5:
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.

Traceback (most recent call last):
   File E:\My Dropbox\myWebs\MyApps\myeduapps\gluon\restricted.py, line 212, 
in restricted
 exec ccode in environment
   File E:/My 
Dropbox/myWebs/MyApps/myeduapps/applications/myeducenter/controllers/default.py 
http://127.0.0.1:8083/admin/default/edit/myeducenter/controllers/default.py, line 116, in 
module
   File E:\My Dropbox\myWebs\MyApps\myeduapps\gluon\globals.py, line 194, in 
lambda
 self._caller = lambda f: f()
   File E:/My 
Dropbox/myWebs/MyApps/myeduapps/applications/myeducenter/controllers/default.py 
http://127.0.0.1:8083/admin/default/edit/myeducenter/controllers/default.py, line 97, 
in import_and_sync
 db.import_from_csv_file(form.vars.data.file,unique=False)
   File E:\My Dropbox\myWebs\MyApps\myeduapps\gluon\dal.py, line 8046, in 
import_from_csv_file
 *args, **kwargs)
   File E:\My Dropbox\myWebs\MyApps\myeduapps\gluon\dal.py, line 8737, in 
import_from_csv_file
 curr_id = self.insert(**dict(items))
   File E:\My Dropbox\myWebs\MyApps\myeduapps\gluon\dal.py, line 8579, in 
insert
 ret =  self._db._adapter.insert(self, self._listify(fields))
   File E:\My Dropbox\myWebs\MyApps\myeduapps\gluon\dal.py, line 1210, in 
insert
 raise e
IntegrityError: column title is not unique



El miércoles, 19 de junio de 2013 17:31:49 UTC+2, Christian Foster Howes
escribió:


I haven't used that code in a long time as my tables are too big. :(

what's the traceback that you get?

On 6/19/13 7:23 , peibol wrote:

Bigtable. I don't have any other models but the standard auth ones and

the

builtin wiki ones and I'm using this code (just the one stated in the

book):


def import_and_sync():
  form = FORM(INPUT(_type='file', _name='data'),

INPUT(_type='submit'))

  if form.process().accepted:
  db.import_from_csv_file(form.vars.data.file,unique=False)
  # for every table
  for table in db.tables:
  # for every uuid, delete all but the latest
  items = db(db[table]).select(db[table].id,
 db[table].uuid,
 orderby=db[table].modified_on,
 groupby=db[table].uuid)
  for item in items:

db((db[table].uuid==item.uuid)(db[table].id!=item.id)).delete()
  return dict(form=form)


def export():
  s = cStringIO.StringIO()
  db.export_to_csv_file(s)
  response.headers['Content-Type'] = 'text/csv'
  return s.getvalue()





El mi�rcoles, 19 de junio de 2013 15:14:57 UTC+2, Christian Foster

Howes

escribi�:


Are you using BigTable or Google Cloud SQL for data storage?  i'm
surprised that import to BigTable would give an integrity error.

note that if you are import/export as a controller you will be limited
by what you can do in 128MB of ram and 60 seconds of processing unless
you use larger instance classes and/or backend instances.

cfh

On 6/19/13 4:05 , peibol wrote:

Thanks Cristian. What I'm considering is use a export/import function

in

the app, only visible to the administrator. Because I want to develop

a

kind of wiki, with its content, on local. So I'll use

export_to_csv_file

and import_from_csv_file.

The export process is working for me right now, but the import process
gives an integrity error.

Reading the book, it must be some issue with the uuids...



El mi�rcoles, 19 de junio de 2013 07:28:02 UTC+2, Christian Foster

Howes

escribi�:


i wouldn't copy data personally, i consider localhost a test

environment,

and GAE proper production and i just make my production data there.

if you do want to copy data look at the GAE bulk loader:


https://developers.google.com/appengine/docs/python/tools/uploadingdata












--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: upgrading appengine has broken web2py

2013-06-18 Thread Christian Foster Howes

Carl,

i have been working through my web2py upgrade to 2.5.1 + GAE SDK 1.8.1 
upgrade and am not seeing any problems with DAL or GQL.  i did have to 
change some cache.ram.flush_all() to cache.ram.clear() to work with the 
latest web2py, and am making adjustments to work with the updated 
custom_import code.


cfh

On 6/18/13 1:57 , Massimo Di Pierro wrote:

None except that some very old web2py GAE applications may be doing import
gql. It is there only for backward compatibility.

On Tuesday, 18 June 2013 03:21:00 UTC-5, Carl wrote:


hi Massimo,

What would be the implications of removing the gql modulefrom Web2py?




On 12 April 2013 16:17, Massimo Di Pierro massimo@gmail.comjavascript:

wrote:



I proposed in web2py 2.5 we remove the gql module.


On Friday, 12 April 2013 05:21:10 UTC-5, Carl wrote:


Removing the line from gluon.contrib.gql import * removed the error
and allows my app to launch.

I next run into this error:
   File F:\wp\TestEnvoy\web2py\gluon\**main.py, line 555, in wsgibase
 session._try_store_in_db(**request, response)
   File F:\wp\TestEnvoy\web2py\gluon\**globals.py, line 747, in
_try_store_in_db
 record_id = table.insert(**dd)
   File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 256, in
insert
 id = self._create_id()
   File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 291, in
_create_id
 id = self._tableobj.incr(shard_id)
AttributeError: 'MemcacheClient' object has no attribute 'incr'

One for me to investigate.



On Friday, 12 April 2013 11:06:38 UTC+1, Carl wrote:


has my db.py content fallen out of date?

it includes:
from gluon.sql import SQLCustomType

if request.env.web2py_runtime_**gae: # if running on Google App Engine
 from gluon.contrib.gql import *
 db = DAL('gae')


On Friday, 12 April 2013 11:00:09 UTC+1, Carl wrote:


actually.. while getting an unknown ticket if I request the url a
second time I get this:

   File F:\wp\TestEnvoy\web2py\**applications\init\models\db.**py,
line 13, in module
 from gluon.contrib.gql import *
   File F:\wp\TestEnvoy\web2py\gluon\**custom_import.py, line 100,
in custom_importer
 return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named gql

That's fairly obvious because I've just delete gql.py! :)


On Friday, 12 April 2013 07:48:27 UTC+1, Carl wrote:


If I remove the file (and its .pyc) then I get a web2py Ticket
issued: unknown

I'll try upgrading again.



On Friday, 12 April 2013 02:58:27 UTC+1, Massimo Di Pierro wrote:


What if you delete that file?

On Thursday, 11 April 2013 12:31:15 UTC-5, Carl wrote:


With an update to appengine, all is still fine when running web2py
locally.
but if I run dev_appserver then on start-up I get the following
kicked out at the console...

  File F:\wp\TestEnvoy\web2py\gluon\**contrib\gql.py, line 5, in
module
 from gluon.dal import DAL, Field, Table, Query, Set,
Expression, Row, Rows, *drivers*, BaseAdapter, SQLField, SQLTable,
SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, SQLALL,
SQLCustomType, gae
ImportError: cannot import name *drivers*
*
*
\contrib\gql.py exists for backward compatibility.

This looks like I've tripped up somewhere really simple. Can anyone
point me in the right direction?


  --


---
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/0XH6l1394mA/unsubscribe?hl=en.
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/groups/opt_out.










--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How should we work to sync localhost development with GAE?

2013-06-18 Thread Christian Foster Howes
 i wouldn't copy data personally, i consider localhost a test environment, 
and GAE proper production and i just make my production data there.

if you do want to copy data look at the GAE bulk loader:  
https://developers.google.com/appengine/docs/python/tools/uploadingdata

-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to use shell with GAE dev server

2013-06-14 Thread Christian Foster Howes
i'm not sure how to get the web2py shell to work with GAE, but how about 
you use http://127.0.0.1:8000/console that is started when you run the GAE 
dev server?

On Wednesday, June 12, 2013 10:20:16 AM UTC-7, Quint wrote:

 Hello,

 I'm trying to use the interactive shell with the GAE dev server on Windows.
 Wahet do i need to do to getthis working?

 I'm now getting this error 5 times:

 web2py Web Framework
 Created by Massimo Di Pierro, Copyright 2007-2013
 Version 2.4.7-stable+timestamp.2013.05.24.17.48.47
 Database drivers available: SQLite(sqlite3), PostgreSQL(pg8000), 
 MSSQL(pyodbc),
 DB2(pyodbc), Teradata(pyodbc), Ingres(pyodbc), CouchDB(couchdb), 
 IMAP(imaplib)
 DEBUG: connect attempt 0, connection error:
 Traceback (most recent call last):
   File C:\Users\*\gluon\dal.py, line
 7429, in __init__
 self._adapter = ADAPTERS[self._dbname](**kwargs)
   File *\gluon\dal.py, line
 2220, in __init__
 if do_connect: self.reconnect()
   File C:\Users\*\gluon\dal.py, line
 603, in reconnect
 self.connection = f()
   File C:\Users\*\gluon\dal.py, line
 2218, in connector
 return self.driver.Connection(dbpath, **driver_args)
 OperationalError: unable to open database file


 I'v tried adding this folder to my PATH with the GAE modules.

 PATH=%PATH%;C:\Program Files 
 (x86)\Google\google_appengine\google\appengine\ext

 Thanks!



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Running instantpress in GAE: Internal error Ticket issued: unrecoverable

2013-06-14 Thread Christian Foster Howes
can you paste the traceback, teh web2py version, and the GAE SDK version 
you are using?  i'm currently dealing with some problems with the GAE SDK 
version 1.8.1 released 2 days ago.

On Thursday, June 13, 2013 8:29:35 AM UTC-7, peibol wrote:

 Hi all:

 Everything is running smoothly at localhost, but when deploying a raw 
 instantpress on GAE I get Internal error Ticket issued: unrecoverable when 
 trying to register or login. I'm using python 2.7, but the same thing 
 happens with 2.5.

 Any hints there?

 Thanks!


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Error writing to session with latest Google App Engine 1.8.1

2013-06-14 Thread Christian Foster Howes
Aravind,

I see that in trunk (and perhaps the latest web2py release) i think that 
this has been fixed.  Please make sure you are using the latest web2py 
version.  I'm working on upgrading to the latest web2py version and then 
the latest GAE SDK to get things working for me.  There may be some patches 
coming, hopefully later today

cfh

On Thursday, June 13, 2013 2:15:46 AM UTC-7, Aravindan Rs wrote:

 Hi,

 I get the following error stack on login / logout when session object is 
 attempted to be written to the database:

 Traceback (most recent call last):
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/main.py, 
 line 551, in wsgibase
 session._try_store_in_db(request, response)
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/globals.py, 
 line 728, in _try_store_in_db
 record_id = table.insert(**dd)
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, line 
 7806, in insert
 ret =  self._db._adapter.insert(self,self._listify(fields))
   File 
 /base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, line 
 4618, in insert
 rid = Reference(tmp.key().id())
 OverflowError: Python int too large to convert to C long



 I'm using Google App Engine - with python 2.7 and web2py.

 I have one version of application which was deployed yesterday - this is 
 still working (i.e. no such errors during login/logout). I deploy the same 
 code today and it does not work. This morning google sent a release 
 announcement for google app engine 1.8.1. The change was related to 
 scattered auto ID (64 bits). I'm guessing my problem could be due app 
 engine change.

 Are others facing similar problem? Any known solutions?

 Warm Regards,
 Aravind.




-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Error writing to session with latest Google App Engine 1.8.1

2013-06-14 Thread Christian Foster Howes
Yup, that change is why i'm upgrading web2py now.  Other GAE users have 
reported issues with the recent web2py versions, and i think i found an 
issue in the auth module when using custom table names.  I'll let you 
know my results as i do my testing


cfh

On 6/14/13 17:33 , Aravindan Rs wrote:

Thanks - I assume you are talking about the change from class
Reference(int) to class Reference(long). Should work I think.
Btw: This fix was done quite some time ago (on Jan 1st 2013 -
https://github.com/web2py/web2py/commit/dd3055836a3f8fbc5b06763710c369cab3f3fc40)
- so patch might not be necessary. I'll move to latest web2py and check.

Thanks again,
Aravind.


On Friday, 14 June 2013 20:16:41 UTC+5:30, Christian Foster Howes wrote:


Aravind,

I see that in trunk (and perhaps the latest web2py release) i think that
this has been fixed.  Please make sure you are using the latest web2py
version.  I'm working on upgrading to the latest web2py version and then
the latest GAE SDK to get things working for me.  There may be some patches
coming, hopefully later today

cfh

On Thursday, June 13, 2013 2:15:46 AM UTC-7, Aravindan Rs wrote:


Hi,

I get the following error stack on login / logout when session object is
attempted to be written to the database:

Traceback (most recent call last):
   File 
/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/main.py, line 
551, in wsgibase
 session._try_store_in_db(request, response)
   File 
/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/globals.py, 
line 728, in _try_store_in_db
 record_id = table.insert(**dd)
   File 
/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, line 
7806, in insert
 ret =  self._db._adapter.insert(self,self._listify(fields))
   File 
/base/data/home/apps/s~nittio-live/24.368055561930403768/gluon/dal.py, line 
4618, in insert
 rid = Reference(tmp.key().id())
OverflowError: Python int too large to convert to C long



I'm using Google App Engine - with python 2.7 and web2py.

I have one version of application which was deployed yesterday - this is
still working (i.e. no such errors during login/logout). I deploy the same
code today and it does not work. This morning google sent a release
announcement for google app engine 1.8.1. The change was related to
scattered auto ID (64 bits). I'm guessing my problem could be due app
engine change.

Are others facing similar problem? Any known solutions?

Warm Regards,
Aravind.







--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Scheduler task in GAE

2013-06-07 Thread Christian Foster Howes
you may use the taskqueue from inside your controllers or modules.

here's a sample invocation that i used recently:

taskqueue.add(
url=URL(r=request, f=function_to_run),
params={
'created_on':start,
'end':chunk_end,
'prefix':request.vars.prefix or '',
'email_to':request.vars.email_to,
},
method='GET',
)

using additional parameter you can specify which queue to target and how 
long to wait before the task is run.

i also use GAE cron.yaml to schedule the execution of controller methods at 
specified times each day.

On Tuesday, June 4, 2013 3:09:26 AM UTC-7, José Manuel López wrote:

 Hi Niphlod, 
 Do you have any example about how use GAE tash queue from web2py?, can I 
 use it inside my main controller without problem?
 something like this:

 # Add the task to the default queue.
 taskqueue.add(url='/worker', params={'key': key})


 I've see this example: 
 https://developers.google.com/appengine/docs/python/taskqueue/overview-pushbut
  I'm lost about how to use it from my controller and Web2Py. 
 Thanks! 


 On Monday, June 3, 2013 9:12:14 PM UTC+2, Niphlod wrote:

 ehmm.. scheduler is NOT meant to be run on GAE. They have task queue 
 for that.

 On Monday, June 3, 2013 7:59:45 PM UTC+2, José Manuel López wrote:

 Hi Massimo, 
 this is my Web2Py version: Version 
 2.4.6-stable+timestamp.2013.04.06.17.37.38
 And I'm running on 2.5 Python version, maybe I've to switch to 2.7?. 


 On Monday, June 3, 2013 6:56:16 PM UTC+2, Massimo Di Pierro wrote:

 Which web2py version? Which Python version? You may be on an early 
 Python version that does include multiprocessing.

 On Monday, 3 June 2013 11:01:38 UTC-5, José Manuel López wrote:

 Hi,
 I've a function call SendReport that send an email to every user in my 
 system every day (morning), something like a newsletter. 
 Now, I've to make this task with the scheduler but I'm not sure how to 
 do it. 
 I've see the video (thanks Massimo), but I'm not sure where I've to do 
 it. 
 This is my code:

 Scheduler(db, dict(sendReport=sendReport()))


 I've done it in a file task.py inside models and inside my main 
 controller... but it's not working it throws me this trace:

 ImportError: Cannot import module 'multiprocessing'

 What I'm doing wrong?. 
 Thank you for your help!







-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Problem running web2py with Google Appengine - invalid controller (default/index)

2013-06-07 Thread Christian Foster Howes
if some pages/apps load but some pages give you invalid controller i bet 
there is an error in your routing.  check both app.yaml (the GAE specific 
routing) and your web2py routing config.  remember that it's best to 
restart the GAE SDK each time you change app.yaml or a web2py route.

cfh

On Wednesday, June 5, 2013 1:26:57 PM UTC-7, John Drake wrote:

 I have been trying for some time now to get an application that I 
 developed using web2py to run on the Google app engine.  I tried to follow 
 the web tutorial here: https://www.youtube.com/watch?v=YZTG2IBMXeU but to 
 no avail.  The web2py welcome page comes up as expected.  But when
 I try to get to my application, or even the built in example applications, 
 I get:

 invalid controller (default/index)


 Everything works fine when I run web2py by itself.  Any ideas?


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Web2py Restful api authentication for android app

2013-06-07 Thread Christian Foster Howes
for my resful APIs i use an oauth library to sign the requests.  i then use 
oauth as my authentication mechanism.

On Wednesday, June 5, 2013 5:29:23 PM UTC-7, Saurabh Kumar wrote:

 Hi,

 I am writing an android app which has web2py as the server side backend. 
 What are the authentication protocols while using Restful api from Java 
 code. There are two scenarios:
 1) HTTP (will need something like oauth2.0 )
 2) HTTPS (can do basic auth)

 Which is the best way for authentication in this scenario. Are there any 
 authentication libraries that can help me setup the authentication for 
 restful apis? 


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Web2py Restful api authentication for android app

2013-06-07 Thread Christian Foster Howes
we are using a modified form of 
https://github.com/simplegeo/python-oauth2  modified to make it run on 
GAE and also some tweaks in usage to handle some special-case requirements.


cfh

On 6/7/13 11:26 , Saurabh Kumar wrote:

Can you give pointers to the library you are using?

On Fri, Jun 7, 2013 at 11:40 PM, Christian Foster Howes
cfho...@gmail.comwrote:


for my resful APIs i use an oauth library to sign the requests.  i then
use oauth as my authentication mechanism.


On Wednesday, June 5, 2013 5:29:23 PM UTC-7, Saurabh Kumar wrote:


Hi,

I am writing an android app which has web2py as the server side backend.
What are the authentication protocols while using Restful api from Java
code. There are two scenarios:
1) HTTP (will need something like oauth2.0 )
2) HTTPS (can do basic auth)

Which is the best way for authentication in this scenario. Are there any
authentication libraries that can help me setup the authentication for
restful apis?


  --

---
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/i1DJatX4P58/unsubscribe?hl=en.
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/groups/opt_out.







--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: upgrading appengine has broken web2py

2013-06-05 Thread Christian Foster Howes

Hi Carl,

i've been spread pretty thin lately and have not tried the updated 
web2py yet.  If i'm lucky I can play with it on sunday for a bit and see 
how it works for me.


christian

On 6/5/13 7:15 , Carl wrote:

hi Christian,

Have you gotten round to upgrading a test version of your app to the latest
Web2py version?
[I don't think there can be many users of Web2py who deploy on GAE - this
forum is very quiet considering Web2py hasn't supported GAE for around two
months now.]



On Friday, 12 April 2013 23:34:13 UTC+1, Christian Foster Howes wrote:


i'm not having any problems with GAE + web2py.though i'm not fully
upgraded on my web2py versions...perhaps i should do a test upgrade and see
if i hit the same issues.

On Friday, April 12, 2013 9:10:10 AM UTC-7, Carl wrote:


Perhaps 2.5 isn't far away given 2.4.6 is out.

I'll be happy to a version of web2py with it removed.


On 12 April 2013 16:17, Massimo Di Pierro massimo@gmail.com wrote:


I proposed in web2py 2.5 we remove the gql module.


On Friday, 12 April 2013 05:21:10 UTC-5, Carl wrote:


Removing the line from gluon.contrib.gql import * removed the error
and allows my app to launch.

I next run into this error:
   File F:\wp\TestEnvoy\web2py\gluon\**main.py, line 555, in wsgibase
 session._try_store_in_db(**request, response)
   File F:\wp\TestEnvoy\web2py\gluon\**globals.py, line 747, in
_try_store_in_db
 record_id = table.insert(**dd)
   File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 256, in
insert
 id = self._create_id()
   File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 291, in
_create_id
 id = self._tableobj.incr(shard_id)
AttributeError: 'MemcacheClient' object has no attribute 'incr'

One for me to investigate.



On Friday, 12 April 2013 11:06:38 UTC+1, Carl wrote:


has my db.py content fallen out of date?

it includes:
from gluon.sql import SQLCustomType

if request.env.web2py_runtime_**gae: # if running on Google App Engine
 from gluon.contrib.gql import *
 db = DAL('gae')


On Friday, 12 April 2013 11:00:09 UTC+1, Carl wrote:


actually.. while getting an unknown ticket if I request the url a
second time I get this:

   File F:\wp\TestEnvoy\web2py\**applications\init\models\db.**py,
line 13, in module
 from gluon.contrib.gql import *
   File F:\wp\TestEnvoy\web2py\gluon\**custom_import.py, line 100,
in custom_importer
 return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named gql

That's fairly obvious because I've just delete gql.py! :)


On Friday, 12 April 2013 07:48:27 UTC+1, Carl wrote:


If I remove the file (and its .pyc) then I get a web2py Ticket
issued: unknown

I'll try upgrading again.



On Friday, 12 April 2013 02:58:27 UTC+1, Massimo Di Pierro wrote:


What if you delete that file?

On Thursday, 11 April 2013 12:31:15 UTC-5, Carl wrote:


With an update to appengine, all is still fine when running web2py
locally.
but if I run dev_appserver then on start-up I get the following
kicked out at the console...

  File F:\wp\TestEnvoy\web2py\gluon\**contrib\gql.py, line 5, in
module
 from gluon.dal import DAL, Field, Table, Query, Set,
Expression, Row, Rows, *drivers*, BaseAdapter, SQLField,
SQLTable, SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB,
SQLALL, SQLCustomType, gae
ImportError: cannot import name *drivers*
*
*
\contrib\gql.py exists for backward compatibility.

This looks like I've tripped up somewhere really simple. Can
anyone point me in the right direction?


  --


---
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/0XH6l1394mA/unsubscribe?hl=en.
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/groups/opt_out.










--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Restful authentication and CORS

2013-05-28 Thread Christian Foster Howes
i have configured my system to be an oauth provider and added a decorator 
to all RESTful calls to validate the oauth signature.  yes, i do this on 
each request that i require authentication for.

On Tuesday, May 28, 2013 6:01:11 AM UTC-7, Ruben D. Orduz wrote:

 Yes, most REST patterns I've seen are handled either by http basic auth or 
 else request signing. Either option requires handling that on each call.


 On Tue, May 28, 2013 at 4:54 AM, Michele Comitini 
 michele@gmail.comjavascript:
  wrote:

 REST is stateless so you should not rely on session, hence you can use 

 auth.settings.allow_basic_login = True

 see here
 http://web2py.com/books/default/chapter/29/10#Access-Control

 for proper (as per RFC) authentication challenge with realm use:

 @auth.basich(basic_auth_real=True|any string)

 An alternative is to pass an argument or a parameter with authencation 
 info and use
 auth.login_bare

 Anyway you must pass authentication info with each call since being the 
 service stateless the server has no way to recognize the client.

 mic


 2013/5/27 Ray (a.k.a. Iceberg) ice...@qq.com javascript:

 Hi Alec,

 On Tuesday, July 17, 2012 1:03:04 AM UTC+8, Alec Taylor wrote:

 On Tue, Jul 17, 2012 at 2:20 AM, David Marko dma...@tiscali.cz wrote:
  +1 from me having this. Btw. On client side i'm using AngularJS and 
 Trigger.io (instead of PhoneGap)

 I've been looking around, and will have one of the following setups:

- *AngularJS http://angularjs.org/* with 
 *BarristerRPChttp://barrister.bitmechanic.com/
* 
- *BackboneJS http://backbonejs.org/* with 
 *Backbone.Rpchttps://github.com/asciidisco/Backbone.Rpc
*
- *JQuery mobile* http://jquerymobile.com/ with 
 *jquery-jsonrpc*https://github.com/datagraph/jquery-jsonrpc(or plain 
 JSON.stringify)

 All within a *PhoneGap http://phonegap.com/* (*Apache 
 Cordovahttp://incubator.apache.org/cordova/
 *) app using the* Facebook connect 
 pluginhttps://github.com/davejohnson/phonegap-plugin-facebook-connect
 * for authentication (for graceful downgrade from Facebook mobile 
 apphttps://www.facebook.com/mobile/to Facebook 
 website auth https://touch.facebook.com).

 I should have a PoC http://en.wikipedia.org/wiki/Proof_of_Concept on 
 August 2 with a full backend written in web2py and two frontends (one in 
 web2py views; the other in one of the above frameworks).

 Subsequently I'll release it under a full open-source license onto 
 Bitbucket. I'll post to the web2py list with link + slides when the repo 
 is 
 live 


 Sorry for late response. I am a web2py veteran who dives into restful 
 world only recently. Do you have any finding to share about the restful 
 authentication in web2py? Thanks in advance!

 Regards,
 Ray
  
 -- 
  
 --- 
 You received this message because you are 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/groups/opt_out.
  
  


  -- 
  
 --- 
 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/FyxbO0WGMhU/unsubscribe?hl=en.
 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/groups/opt_out.
  
  




-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: PAAS supporting web2py

2013-05-28 Thread Christian Foster Howes
i use GAE with BigTable for some live sites.  from a teaching perspective 
there are some pros and cons.

pros:
 - there is a free daily allotment, though it is quite small
 - all managed via web interfaces that are pretty easy to navigate

cons:
 - web2py admin and code editor don't work.
 - i wouldn't recommend using BigTable in a teaching tool that uses 
web2py.  web2py makes perfect sense in a relational DB, but it's a stretch 
in a non-relational DB sometimes and would end up just confusing your 
students.

good luck!

cfh

On Monday, May 27, 2013 8:19:39 PM UTC-7, Arvind Gupta wrote:

 Thanks, Antrhony and Reisl

 All of these seems to be a excellent, I will evaluate all I am more 
 incliend towards pythonanywhere but evaluate all of these Can any one point 
 me to a strengths or weakness of these sites, I have to build a site for 
 teaching python site to k-12 students in india.

 Does web2py suport any other frontends in addition to jquery?


 On Tue, May 28, 2013 at 8:41 AM, Arvind Gupta 
 arvind@gmail.comjavascript:
  wrote:

 Thanks, Antrhony and Reisl

 All of these seems to be a excellent, I will evaluate all I am more 
 incliend towards pythonanywhere but evaluate all of these Can any one point 
 me to a strengths or weakness of these sites, I have to build a site for 
 teaching python site to k-12 students in india.

 Does web2py suport any other frontends in addition to jquery?


 On Mon, May 27, 2013 at 9:55 PM, Anthony abas...@gmail.com javascript:
  wrote:

 Also, GAE, Heroku, DotCloud, etc.


 On Monday, May 27, 2013 12:22:04 PM UTC-4, Relsi Hur Maron wrote:


 Pythonanywhere 
 https://www.pythonanywhere.**com/ https://www.pythonanywhere.com/

 Em segunda-feira, 27 de maio de 2013 13h14min39s UTC-3, Arvind Gupta 
 escreveu:

 Hi
  Is there any PAAS (like openshift/cloudfoundry) which support 
 web2py?

 regards
 Arvind





-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: WEB2PY iOS install APP

2013-05-17 Thread Christian Foster Howes
i don't understand the question.  what are you trying to do?

web2py can run the server code of a client-server application.  web2py has 
nothing specific for iOS and has no control over the installation of iOS 
apps.

On Tuesday, May 14, 2013 3:51:06 PM UTC-7, Allan K wrote:

 Hi, 

 I need to work with an app for web2py, but I do not know if I can use 
 web2py with iOS and install apps as I can with windows and macOS.

 Thanks.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: How to limit user votes

2013-05-17 Thread Christian Foster Howes
your code never writes the updated votes string.  and i'm not sure that 
using the in operator on a string like that will give you the results 
that you want.

you probably want another table say votelog

db.define_table('voetlog',
  Field('content_id', 'reference content'),
  Field('user_id', 'reference auth_user)

then check if logged in user has a record in votelog for that content 
before incrementing the content vote and adding a row to the votelog table.


On Thursday, May 16, 2013 4:00:57 AM UTC-7, sasogeek wrote:

 can you give me an example code?
 here's what i have but doesn't work.
 #model
 db.define_table('content',
 Field('username'),
 Field('text', 'text'),
 Field('file', 'upload'),
 Field('userpic'),
 Field('time', 'datetime', update=request.now),
 Field('userid', readable=False),
 Field('votesup', 'integer', default=0),
 Field('votesdown', 'integer', default=0),
 Field('votes', 'text', default='0,'),
 )

 #controller
 def voteup():
 item = db.content[request.args(0)]
 if auth.user.id not in item.votes:
 item.votes.join(str(auth.user.id)+',')
 new_votes = item.votesup + 1
 item.update_record(votesup=new_votes)
 return str(new_votes)
 elif auth.user.id in item.votes:
 return str(0)

 #view
 button style='margin-left:30px; margin-top:-17px;'
 span onclick=jQuery('#content_votesup').val('{{=content.id}}'); 
 ajax('{{=URL('voteup', args=content.id)}}', ['votesup'], 'content0{{=
 content.id}}'); 
 img  src='../static/images/thumbsup.png' style='height:20px; 
 width:20px;'/
 /span
 span id='content0{{=content.id}}' 
 {{=content.votesup}}
 /span
 /button



 On Wednesday, 15 May 2013 15:22:28 UTC+1, Anthony wrote:

 Actually, as long as you are requiring users to register and log in, you 
 might as well just associate each vote with a user ID -- then when a user 
 votes, you can just check whether that same user has already voted.

 Anthony

 On Wednesday, May 15, 2013 10:10:44 AM UTC-4, sasogeek wrote:

 the book states this although it is easy to change this behavior if 
 visitors are authenticated, by keeping track of the individual votes in the 
 database and associating them with therequest.env.remote_addr of the 
 voter. at this link 
 http://web2py.com/books/default/chapter/29/11#Voting-and-rating

 How do I do that? I don't understand... but I need that feature. The app 
 I'm building with it is already live though. feel free to check it out if 
 you want :)
 http://sasogeek.pythonanywhere.com/uRate/default/index.html . However, 
 I really need the help! thanks



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: parse_as_rest date and time range?

2013-05-06 Thread Christian Foster Howes
can you url escape the : and have it work?

if not, maybe use a different separator and change the string to timestamp 
parsing to expect your format.

cfh

On Monday, May 6, 2013 1:42:40 PM UTC-7, Bernard wrote:


 Hi Web2py users,
   I am using the parse_as_rest feature for filtering by date range:
 The pattern is as follows:
  /unit/{unit.unit_id}/timeseries[timeseries.unit]/{
 timeseries.utc_time.ge}/{timeseries.utc_time.le},
 I couldn't find documentation that 'ge' and 'le' are valid for datetime 
 fields, it seems to work well:

 http://localhost/manager/default/api/unit/123/timeseries/2013-05-01/2013-05-02

 However, I need to filter based on date and time.

 Ideally, I would like to send a request with the time as part of the date 
 specification:

 http://localhost/manager/default/api/unit/123/timeseries/2013-05-0102:00/2013-05-02
  00:00
 However, this is an invalid request due to the ':' in the URI.
 I looked into using seconds since epoch for the datetime spec, but that's 
 too slow on sqlite.

 I'm wondering if anybody knows an easy way to work around this?

 The not so pretty solution I'm considering right now is to add a time as 
 part of the URI after the date:

 http://localhost/manager/default/api/unit/123/timeseries/2013-05-01/02/00/2013-05-02/00/00
 Then, in the controller, I would modify the args before passing to the 
 parse_as_rest() function by concating args 4 and 5 with the date in arg 3, 
 to form the correct format ('-MM-YY hh:ss') that parse_as_rest() can 
 use.

 Any help much appreciated.

 Regards,
 Bernard



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Making a query and projection not working.

2013-05-06 Thread Christian Foster Howes
to get a GAE projection query you have to specify projection=True in your 
query:

db(db.auth_user.id==user_role.user_id).select(db.auth_user.first_name, 
projection=True)

why?  well, for backwards compatibility reasons.  prior to projection 
queries being supported on GAE the default behavior was to return all 
columns.  when we added projection support i didn't want to break my 
existing apps that sometimes list fields, but don't have the projection 
indexes.

let us know if that doesn't fix it for you!

cfh

On Monday, May 6, 2013 12:17:44 AM UTC-7, José Manuel López wrote:

 Hi, 
 I've to make an adHoc user management formulary and I'm making a table 
 with a role filter. I'm in GAE and the joins must to be done by hand. 
 This is my code:
 auth_user_with_role = db(db.auth_membership.group_id==request.vars.role).
 select(db.auth_membership.ALL)
 auth_user_ids_role_selected=db(db.auth_user.id1).select(db.auth_user.
 first_name) #This is a Hack, prob I can make it better
 for user_role in auth_user_with_role:
 user = db(db.auth_user.id==user_role.user_id).select(db.auth_user.
 first_name)
 auth_user_ids_role_selected = auth_user_ids_role_selected  user
  
 With this code I have a join between the group table and the user table. 
 The problem is that in user I have the user with all the columns and not 
 with only the first_name column. Is the  projection not working or am I 
 doing something wrong?
 Thank you guy for your help


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: parse_as_rest date and time range?

2013-05-06 Thread Christian Foster Howes
there are a couple of characters that web2py is not nice about in the 
URL parsing.


for the format string, on the datetime fields use the 
IS_DATETIME(format='...') validator with a custom format string.  see 
http://web2py.com/books/default/chapter/29/07#Validators


On 5/6/13 15:35 , Bernard wrote:

Thanks Christian,

I tried to escape it to %3A but that gave me an error invalid request. I
couldn't figure out where it's being blocked on the server (routes.py?).

Where can I get more info to change separator and parsing? Is that all in
dal.py?

On Monday, May 6, 2013 3:28:03 PM UTC-7, Christian Foster Howes wrote:


can you url escape the : and have it work?

if not, maybe use a different separator and change the string to timestamp
parsing to expect your format.

cfh

On Monday, May 6, 2013 1:42:40 PM UTC-7, Bernard wrote:



Hi Web2py users,
   I am using the parse_as_rest feature for filtering by date range:
The pattern is as follows:
  /unit/{unit.unit_id}/timeseries[timeseries.unit]/{
timeseries.utc_time.ge}/{timeseries.utc_time.le},
I couldn't find documentation that 'ge' and 'le' are valid for datetime
fields, it seems to work well:

http://localhost/manager/default/api/unit/123/timeseries/2013-05-01/2013-05-02

However, I need to filter based on date and time.

Ideally, I would like to send a request with the time as part of the date
specification:

http://localhost/manager/default/api/unit/123/timeseries/2013-05-0102:00/2013-05-02
 00:00
However, this is an invalid request due to the ':' in the URI.
I looked into using seconds since epoch for the datetime spec, but that's
too slow on sqlite.

I'm wondering if anybody knows an easy way to work around this?

The not so pretty solution I'm considering right now is to add a time as
part of the URI after the date:

http://localhost/manager/default/api/unit/123/timeseries/2013-05-01/02/00/2013-05-02/00/00
Then, in the controller, I would modify the args before passing to the
parse_as_rest() function by concating args 4 and 5 with the date in arg 3,
to form the correct format ('-MM-YY hh:ss') that parse_as_rest() can
use.

Any help much appreciated.

Regards,
Bernard






--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: parse_as_rest date and time range?

2013-05-06 Thread Christian Foster Howes
oh, we are over my parse_as_rest knowledge... i've only accessed the 
args directly and did my own logic with it. :(


On 5/6/13 16:51 , Bernard wrote:

I don't think the form validators are used when using parse_as_rest().

When the URI is parsed, the date is simply extracted (as a string?) into a
DAL query.

Ex from my previous query:

http://localhost/manager/default/api/unit/123/timeseries/2013-05-01/2013-05-02

query=(unit.unit_id = '123')
query=(timeseries.utc_time = '2013-05-01')
query=(timeseries.utc_time = '2013-05-02')

Printed from dal.py-parse_as_rest()
The three above queries are and-ed together in the line
: dbset=dbset(query)


On Monday, May 6, 2013 3:39:13 PM UTC-7, Christian Foster Howes wrote:


there are a couple of characters that web2py is not nice about in the
URL parsing.

for the format string, on the datetime fields use the
IS_DATETIME(format='...') validator with a custom format string.  see
http://web2py.com/books/default/chapter/29/07#Validators

On 5/6/13 15:35 , Bernard wrote:

Thanks Christian,

I tried to escape it to %3A but that gave me an error invalid request. I
couldn't figure out where it's being blocked on the server (routes.py?).

Where can I get more info to change separator and parsing? Is that all

in

dal.py?

On Monday, May 6, 2013 3:28:03 PM UTC-7, Christian Foster Howes wrote:


can you url escape the : and have it work?

if not, maybe use a different separator and change the string to

timestamp

parsing to expect your format.

cfh

On Monday, May 6, 2013 1:42:40 PM UTC-7, Bernard wrote:



Hi Web2py users,
I am using the parse_as_rest feature for filtering by date range:
The pattern is as follows:
   /unit/{unit.unit_id}/timeseries[timeseries.unit]/{
timeseries.utc_time.ge}/{timeseries.utc_time.le},
I couldn't find documentation that 'ge' and 'le' are valid for

datetime

fields, it seems to work well:



http://localhost/manager/default/api/unit/123/timeseries/2013-05-01/2013-05-02


However, I need to filter based on date and time.

Ideally, I would like to send a request with the time as part of the

date

specification:


http://localhost/manager/default/api/unit/123/timeseries/2013-05-0102:00/2013-05-0200:00

However, this is an invalid request due to the ':' in the URI.
I looked into using seconds since epoch for the datetime spec, but

that's

too slow on sqlite.

I'm wondering if anybody knows an easy way to work around this?

The not so pretty solution I'm considering right now is to add a time

as

part of the URI after the date:



http://localhost/manager/default/api/unit/123/timeseries/2013-05-01/02/00/2013-05-02/00/00

Then, in the controller, I would modify the args before passing to the
parse_as_rest() function by concating args 4 and 5 with the date in

arg 3,

to form the correct format ('-MM-YY hh:ss') that parse_as_rest()

can

use.

Any help much appreciated.

Regards,
Bernard










--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: saving UPS shipping labels

2013-04-25 Thread Christian Foster Howes
how are you setting self.accept_result.dict_response?  if it is request 
args or vars web2py does some checking to prevent various code injection 
attacks.  maybe that is mucking with your binary data?

On Friday, April 19, 2013 1:51:29 PM UTC-7, Jim Gregory wrote:

 I'm working on a script to generate UPS shipping labels and save them on 
 our server.  The shipping labels are passed as binary data in an XML file 
 from UPS. I am using the ClassicUPS library to parse the XML file and save 
 the data. 

 I wrote a simple script to test the library, and it works OK when I run it 
 on the command line.  However, when I include the function to save the file 
 in a controller, the saved files are corrupted.   If I use Imagemagick to 
 read the file, it returns the error 'improper image header'.  The function 
 in the library that saves the data is:

 def save_label(self, fd):
 raw_epl = 
 self.accept_result.dict_response['ShipmentAcceptResponse']['ShipmentResults']['PackageResults']['LabelImage']['GraphicImage']
 binary = a2b_base64(raw_epl)
 fd.write(binary)

 I call the function using:
 shipment.save_label(open('label.gif','wb'))

 where shipment is a shipping label object produced by the library.

 Does web2py do something that would corrupt the header?


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: “Exceeded soft private memory limit” when upload (1.56M) on GAE

2013-04-18 Thread Christian Foster Howes
Lio,

there are potentially 2 problems here:
 - the request thread is using too much memory/has a memory lead
 - the size of the file is too large.

i know you are having the second problem, not sure about the first.  it's 
possible that the second problem is being reported to you with a 
mis-leading message.

as for the file size, i am assuming that you are trying to store the file 
directly on a row in the table.  Remember that on GAE, when using the 
datastore, each row is limited to 1MB total, and any given field is limited 
to 1MB (which you can only achieve if the row contains 1 field).

To grow past this limitation, look into the GAE blobstore for storing large 
files.  you also can write tools that upload the file to some other 
location (google cloud storage, amazon S3) and store the link to the file 
in your table.

hope that helps!

cfh

On Tuesday, April 16, 2013 7:25:16 PM UTC-7, Lio wrote:

 Hello,

 Today the first time I got 500 Server Error when trying to upload a file 
 of 1.56MB as a field of a record in a table. When checking GAE logs it 
 shows *Exceeded soft private memory limit with 20x.xxx MB after 
 servicing XXX requests total* every time I tried to upload the same 
 file. 

 I've done the same operation several time without any problem, I guess 
 it's very likely caused by the file size, so I reduced the file size to 
 less than 600K then the uploading succeeded. 

 My question is what is the limit of upload file size and also in case I 
 really need to upload a big file what could be the solution?

 Thanks for advice.



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: AppStats doesn't work in my App. [GAE]

2013-04-17 Thread Christian Foster Howes
the appstats overhead is imposed all by things under the covers in GAE. 
 even google recommends that you use it for testing and debugging and 
turn it off for production use.


sorry i don't have a better answer.

cfh

On 4/17/13 0:05 , José Manuel López wrote:

Thank you Christian!. Now it works.
Any clues to low the overhead?

On Tuesday, April 16, 2013 6:28:30 PM UTC+2, Christian Foster Howes wrote:


ahhh yes...i remember.  given that appstats, while helpful for testing,
has a significant performance overhead (200ish ms per request i think),
and that some (like me) have custom appengine_config.py files we moved
web2py's appengine_config.py to appengine_config.example.py.

rename the file, redeploy and you should be all set.  if you have a
moment, consider submitting a patch to the documentation to clarify that!
;)

christian

On 4/16/13 8:41 , Jos� Manuel L�pez wrote:

Hi Christian,
First thank you for your response :) !.
In app.yaml I have: appstats:on
Regarding appengine_config.py, I don't have it!... the only one is
appengine_config.example.py that contains:
def webapp_add_wsgi_middleware(app):
  from google.appengine.ext.appstats import recording
  app = recording.appstats_wsgi_middleware(app)
  return app
I think this can be the problem?.



On Tuesday, April 16, 2013 8:19:51 AM UTC+2, Christian Foster Howes

wrote:


Jose,

i'm behind in my web2py upgrades but can you check:

   - do you have app stats enabled in app.yaml?
   - what does your appengine_config.py look like?

cfh

On Monday, April 15, 2013 12:28:59 AM UTC-7, Jos� Manuel L�pez

wrote:





https://lh4.googleusercontent.com/-xPEFarglbpA/UWvXiWWPdnI/AB0/vB3xDkBUeVY/s1600/Captura+de+pantalla+2013-04-15+a+la%28s%29+09.25.48.png


Hi,
AppStats doesn't work in my App although I have this in gaehandler.py:

LOG_STATS = TrueAPPSTATS = True
DEBUG = False

I have do anything wrong because it doesn't work in Local or in
googlespot.
As you can see in the screenshot I've the AppStats link in the CUSTOM
section, but when I select it, nothing is showed.
What is needed to enable the AppStats, I need to profile my

Application.

Thank you for your help.

EDIT: I have the version 2.4.6 stable.











--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: AppStats doesn't work in my App. [GAE]

2013-04-16 Thread Christian Foster Howes
Jose,

i'm behind in my web2py upgrades but can you check:

 - do you have app stats enabled in app.yaml?
 - what does your appengine_config.py look like?

cfh

On Monday, April 15, 2013 12:28:59 AM UTC-7, José Manuel López wrote:


 https://lh4.googleusercontent.com/-xPEFarglbpA/UWvXiWWPdnI/AB0/vB3xDkBUeVY/s1600/Captura+de+pantalla+2013-04-15+a+la%28s%29+09.25.48.png
 Hi, 
 AppStats doesn't work in my App although I have this in gaehandler.py: 

 LOG_STATS = TrueAPPSTATS = True
 DEBUG = False

 I have do anything wrong because it doesn't work in Local or in 
 googlespot. 
 As you can see in the screenshot I've the AppStats link in the CUSTOM 
 section, but when I select it, nothing is showed. 
 What is needed to enable the AppStats, I need to profile my Application. 
 Thank you for your help. 

 EDIT: I have the version 2.4.6 stable. 


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: AppStats doesn't work in my App. [GAE]

2013-04-16 Thread Christian Foster Howes
ahhh yes...i remember.  given that appstats, while helpful for testing, 
has a significant performance overhead (200ish ms per request i think), 
and that some (like me) have custom appengine_config.py files we moved 
web2py's appengine_config.py to appengine_config.example.py.


rename the file, redeploy and you should be all set.  if you have a 
moment, consider submitting a patch to the documentation to clarify that! ;)


christian

On 4/16/13 8:41 , José Manuel López wrote:

Hi Christian,
First thank you for your response :) !.
In app.yaml I have: appstats:on
Regarding appengine_config.py, I don't have it!... the only one is
appengine_config.example.py that contains:
def webapp_add_wsgi_middleware(app):
 from google.appengine.ext.appstats import recording
 app = recording.appstats_wsgi_middleware(app)
 return app
I think this can be the problem?.



On Tuesday, April 16, 2013 8:19:51 AM UTC+2, Christian Foster Howes wrote:


Jose,

i'm behind in my web2py upgrades but can you check:

  - do you have app stats enabled in app.yaml?
  - what does your appengine_config.py look like?

cfh

On Monday, April 15, 2013 12:28:59 AM UTC-7, José Manuel López wrote:



https://lh4.googleusercontent.com/-xPEFarglbpA/UWvXiWWPdnI/AB0/vB3xDkBUeVY/s1600/Captura+de+pantalla+2013-04-15+a+la%28s%29+09.25.48.png
Hi,
AppStats doesn't work in my App although I have this in gaehandler.py:

LOG_STATS = TrueAPPSTATS = True
DEBUG = False

I have do anything wrong because it doesn't work in Local or in
googlespot.
As you can see in the screenshot I've the AppStats link in the CUSTOM
section, but when I select it, nothing is showed.
What is needed to enable the AppStats, I need to profile my Application.
Thank you for your help.

EDIT: I have the version 2.4.6 stable.







--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: upgrading appengine has broken web2py

2013-04-13 Thread Christian Foster Howes

The 2 versions that i have used this week with the latest GAE are:

Version 2.0.8 (2012-09-07 03:47:51) stable
Version 2.0.9 (2012-09-13 23:51:30) stable

cfh

On 4/12/13 21:13 , Carl Roach wrote:

What version are you using Christian?
On 12 Apr 2013 23:34, Christian Foster Howes cfho...@gmail.com wrote:


i'm not having any problems with GAE + web2py.though i'm not fully
upgraded on my web2py versions...perhaps i should do a test upgrade and see
if i hit the same issues.

On Friday, April 12, 2013 9:10:10 AM UTC-7, Carl wrote:


Perhaps 2.5 isn't far away given 2.4.6 is out.

I'll be happy to a version of web2py with it removed.


On 12 April 2013 16:17, Massimo Di Pierro massimo@gmail.com wrote:


I proposed in web2py 2.5 we remove the gql module.


On Friday, 12 April 2013 05:21:10 UTC-5, Carl wrote:


Removing the line from gluon.contrib.gql import * removed the error
and allows my app to launch.

I next run into this error:
   File F:\wp\TestEnvoy\web2py\gluon\main.py, line 555, in
wsgibase
 session._try_store_in_db(**reque**st, response)
   File F:\wp\TestEnvoy\web2py\gluon\globals.py, line 747, in
_try_store_in_db
 record_id = table.insert(**dd)
   File F:\wp\TestEnvoy\web2py\gluon\contrib\memdb.py, line 256,
in insert
 id = self._create_id()
   File F:\wp\TestEnvoy\web2py\gluon\contrib\memdb.py, line 291,
in _create_id
 id = self._tableobj.incr(shard_id)
AttributeError: 'MemcacheClient' object has no attribute 'incr'

One for me to investigate.



On Friday, 12 April 2013 11:06:38 UTC+1, Carl wrote:


has my db.py content fallen out of date?

it includes:
from gluon.sql import SQLCustomType

if request.env.web2py_runtime_**gae**: # if running on Google App
Engine
 from gluon.contrib.gql import *
 db = DAL('gae')


On Friday, 12 April 2013 11:00:09 UTC+1, Carl wrote:


actually.. while getting an unknown ticket if I request the url a
second time I get this:

   File F:\wp\TestEnvoy\web2py\**applic**ations\init\models\db.**py,
line 13, in module
 from gluon.contrib.gql import *
   File F:\wp\TestEnvoy\web2py\gluon\custom_import.py, line
100, in custom_importer
 return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
ImportError: No module named gql

That's fairly obvious because I've just delete gql.py! :)


On Friday, 12 April 2013 07:48:27 UTC+1, Carl wrote:


If I remove the file (and its .pyc) then I get a web2py Ticket
issued: unknown

I'll try upgrading again.



On Friday, 12 April 2013 02:58:27 UTC+1, Massimo Di Pierro wrote:


What if you delete that file?

On Thursday, 11 April 2013 12:31:15 UTC-5, Carl wrote:


With an update to appengine, all is still fine when running web2py
locally.
but if I run dev_appserver then on start-up I get the following
kicked out at the console...

  File F:\wp\TestEnvoy\web2py\gluon\contrib\gql.py, line 5,
in module
 from gluon.dal import DAL, Field, Table, Query, Set,
Expression, Row, Rows, *drivers*, BaseAdapter, SQLField,
SQLTable, SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB,
SQLALL, SQLCustomType, gae
ImportError: cannot import name *drivers*
*
*
\contrib\gql.py exists for backward compatibility.

This looks like I've tripped up somewhere really simple. Can
anyone point me in the right direction?


  --


---
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/0XH6l1394mA/**unsubscribe?hl=enhttps://groups.google.com/d/topic/web2py/0XH6l1394mA/unsubscribe?hl=en
.
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/**groups/opt_outhttps://groups.google.com/groups/opt_out
.





  --


---
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/0XH6l1394mA/unsubscribe?hl=en.
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/groups/opt_out.







--

--- 
You received this message because you are subscribed to the Google Groups web2py-users group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: upgrading appengine has broken web2py

2013-04-12 Thread Christian Foster Howes
i'm not having any problems with GAE + web2py.though i'm not fully 
upgraded on my web2py versions...perhaps i should do a test upgrade and see 
if i hit the same issues.

On Friday, April 12, 2013 9:10:10 AM UTC-7, Carl wrote:

 Perhaps 2.5 isn't far away given 2.4.6 is out.

 I'll be happy to a version of web2py with it removed.


 On 12 April 2013 16:17, Massimo Di Pierro massimo@gmail.comjavascript:
  wrote:

 I proposed in web2py 2.5 we remove the gql module.


 On Friday, 12 April 2013 05:21:10 UTC-5, Carl wrote:

 Removing the line from gluon.contrib.gql import * removed the error 
 and allows my app to launch.

 I next run into this error:
   File F:\wp\TestEnvoy\web2py\gluon\**main.py, line 555, in wsgibase
 session._try_store_in_db(**request, response)
   File F:\wp\TestEnvoy\web2py\gluon\**globals.py, line 747, in 
 _try_store_in_db
 record_id = table.insert(**dd)
   File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 256, in 
 insert
 id = self._create_id()
   File F:\wp\TestEnvoy\web2py\gluon\**contrib\memdb.py, line 291, in 
 _create_id
 id = self._tableobj.incr(shard_id)
 AttributeError: 'MemcacheClient' object has no attribute 'incr'

 One for me to investigate.



 On Friday, 12 April 2013 11:06:38 UTC+1, Carl wrote:

 has my db.py content fallen out of date?

 it includes:
 from gluon.sql import SQLCustomType

 if request.env.web2py_runtime_**gae: # if running on Google App Engine
 from gluon.contrib.gql import *
 db = DAL('gae')


 On Friday, 12 April 2013 11:00:09 UTC+1, Carl wrote:

 actually.. while getting an unknown ticket if I request the url a 
 second time I get this:

   File F:\wp\TestEnvoy\web2py\**applications\init\models\db.**py, 
 line 13, in module
 from gluon.contrib.gql import *
   File F:\wp\TestEnvoy\web2py\gluon\**custom_import.py, line 100, 
 in custom_importer
 return NATIVE_IMPORTER(name, globals, locals, fromlist, level)
 ImportError: No module named gql

 That's fairly obvious because I've just delete gql.py! :)


 On Friday, 12 April 2013 07:48:27 UTC+1, Carl wrote:

 If I remove the file (and its .pyc) then I get a web2py Ticket 
 issued: unknown

 I'll try upgrading again.



 On Friday, 12 April 2013 02:58:27 UTC+1, Massimo Di Pierro wrote:

 What if you delete that file?

 On Thursday, 11 April 2013 12:31:15 UTC-5, Carl wrote:

 With an update to appengine, all is still fine when running web2py 
 locally.
 but if I run dev_appserver then on start-up I get the following 
 kicked out at the console...

  File F:\wp\TestEnvoy\web2py\gluon\**contrib\gql.py, line 5, in 
 module
 from gluon.dal import DAL, Field, Table, Query, Set, 
 Expression, Row, Rows, *drivers*, BaseAdapter, SQLField, SQLTable, 
 SQLXorable, SQLQuery, SQLSet, SQLRows, SQLStorage, SQLDB, GQLDB, 
 SQLALL, 
 SQLCustomType, gae
 ImportError: cannot import name *drivers*
 *
 *
 \contrib\gql.py exists for backward compatibility.

 This looks like I've tripped up somewhere really simple. Can anyone 
 point me in the right direction?

  -- 
  
 --- 
 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/0XH6l1394mA/unsubscribe?hl=en.
 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/groups/opt_out.
  
  




-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: iOS + web2py

2013-04-11 Thread Christian Foster Howes
The backend for starmakerstudios.com and the various applications 
distributed by StarMaker Interactive are primarily run by web2py on GAE.  
In addition to the things Jonathan lists in his message, i love the support 
of this community - finding bugs, submitting patches, and generally keeping 
me up and running much better than things we are paying for!

So we have iOS (and in the coming months Android) apps talking to our 
web2py/GAE backend:
 - getting data to run the client
 - post user-generated data back to the server
 - no stats, we are using other tools for that cause GAE + stats == fail!
 - drive the website

christian


On Wednesday, April 10, 2013 9:40:58 AM UTC-7, Jonathan Lundell wrote:

 I've been working on a news-video iPad app (awards and everything! 
 featured by Apple! brag!) that uses web2py for a back-end server, 
 maintaining a database of videos c and serving them up to the app via 
 JSONRPC. web2py also implements our internal curation UI to the database. 

 web2py has been a great solution for us because it solves a bunch of 
 different problems. 

 1. it automatically updates our video feeds from their native sources 
 2. it acts as our analytics collection point and does some first-stage 
 analysis 
 3. it serves the app with auth services, video meta-data, etc 
 4. it hosts a dynamic page to share videos publicly on the web 
 5. it implements our internal curation UI 

 ...all with a single framework, and surprisingly little code. web2py 
 rules. 

 I'd like to hear from other projects with a foot in both the iOS and 
 web2py camps, with a general interest in comparing notes, exchanging tips  
 gossip, whatever. 

 (We're also building our development team. I'd appreciate referrals of 
 experienced developers with those skills, preferably but not absolutely 
 necessarily both, who might like to work on a project like that. Drop me a 
 note and I'll tell you more off-list. We're in Silicon Valley, but are open 
 to remote developers.)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Query for an entity in GAE using id

2013-04-09 Thread Christian Foster Howes
Jose,

in theory that should work.  what does your decrementNumRooms method look 
like?  How do you know that it is not the right entity key?

For what it is worth, i don't use the gae Key object in my code, i just 
pass the web2py id to run_in_transaction and query based on that.  I know 
that it is working because i see transaction collusion warnings in my logs 
from time to time.

christian

On Tuesday, April 9, 2013 1:44:39 AM UTC-7, José Manuel López wrote:

 Hi, 
 I'm trying to get a Offer entity in my DB (GAE) and I'm doing something 
 like this:

 offerKey = gae.Key.from_path('Offer', offer.id)  # offer is my the offer 
 using DAL.

 Now I have to make a decrementation inside a transaction GAE:
 if (not gae.run_in_transaction(decrementNumRooms, offerKey)):

  return dict(meta=dict(message=T(This offer is SoldOut) , status=206
 ))

 But gae.Key is not returning the correct Entity Key... 

 How can I do that?.



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Building Query object based on Rows avoiding 'belongs'

2013-04-07 Thread Christian Foster Howes
speaking without reading the docs.so i might be misguided.

assuming that you can setup a grid with a rows object, you can use that 
patch.  just  the rows together and magic will happen.

the key no matter what is to setup multiple queries on GAE and  the 
results together, or re-imagine the dataset so there is less than 30 items 
in the belongs (which is sometimes impossible).

good luck!

cfh

On Sunday, April 7, 2013 2:13:35 PM UTC-7, Marcin Jaworski wrote:

 Hi web2py users!

 My environment: GAE SDK 1.7.5, web2py version 2.0.9.

 I need a query object as an argument for grid.
 I've got a database rows (ids) as the potential base for query 
 (list_of_ids) - unfortunately there are more than 30 of them so the 
 construct with 'belongs' does not work on GAE:

 query = db.field.id.belongs(list_of_ids)   # does not work on GAE

 There is a great solution to overcome the limit of 'belongs' on GAE:
 https://code.google.com/p/web2py/issues/detail?id=160
 but it let me identify just rows, when the query object for grid is needed 
 in my case.

 Can you advise?
 Marcin Jaworski





-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: auth.user.id in restful api

2013-04-07 Thread Christian Foster Howes
Philipp,

i understand you nowunfortunately i have not used db.parse_as_rest so i 
don't know the answer... best i have is 
http://web2py.com/books/default/chapter/29/10?search=restful#parse_as_rest-%28experimental%29
  
perhaps someone can chime in with more details.

good luck!

cfh

On Sunday, April 7, 2013 6:28:10 AM UTC-7, Philipp Müller wrote:

 Hello,

 yes, all the methods are decorated with @requires_login(). The login 
 itself is not the problem, that works fine.
 The issue is, that I want to return user-specific results in my api. 
 Exposing one table by writing something along the lines of:

 @request.restful()
 @auth.requires_login()
 def v1():
 response.view = 'api.json'# +request.extension
 def GET(*args, **vars):
 
 patterns = [
 /stores[store] ]

 parser = db.parse_as_rest(patterns, args, vars)
 if parser.status == 200:
 return dict(content=parser.response)
 else:
 raise HTTP(parser.status, parser.error)

 works fine.

 When I write normal database queries, that I want to return (logged in) 
 user-specific data, I can do it like this, i.e. to return the pets of a 
 user:

 def petsForOwnerQuery():
 pets = (db.pets.owner == db.owner.auth)
 return selectedStores

 then i can go on and retrieve the currently logged in owner like this:

 def ownerFromAuthUserQuery():
 loggedInOwner = (db.owner.auth == auth.user.id)
 return loggedInCustomer

 Combining these queries, I can retrieve the pets for the currently logged 
 in user.

 My question now is, how I can accomplish this, using the 
 @require_restful() decorator in my API.

 Thank you  regards,
 Philipp


 Am Samstag, 6. April 2013 19:40:39 UTC+2 schrieb Christian Foster Howes:

 have you tried decorating your GET/PUT/POST/DELETE methods with the 
 @requires_login()?

 @request.restful()
 def user():
 @requires_login()
 def GET(*args, **kwargs):
  

 i'm doing something similar to that...but with a custom decorator rather 
 than requires_login.

 cfh


 On Friday, April 5, 2013 2:58:17 PM UTC-7, Philipp Müller wrote:

 Hello,

 I have written a restful API in web2py using @request_restful() and then 
 specified the patterns and tables that I wanted to expose in the API.
 The whole API uses basic auth, which is fine. I'm used to retrieving the 
 user, that currently uses a service by calling auth.user.id. If I 
 wanted to check what items in the database are associated with the 
 currently logged in user, I could do that with a db query. 

 Using @request_restful, I would like to do the exact thing, i.e. return 
 only values, that are associated with the user, that is currently using my 
 API. I have been able to figure out how to do this, any help regarding this 
 problem would be highly appreciated.

 Kind regards,
 Philipp



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: need teaching advice (JS+jQuery)

2013-04-06 Thread Christian Foster Howes
i was shown a demo recently of a project that pulled a bunch of data from a 
server into local storage (using HTML 5 local storage stuffs in modern 
browsers) and then doing some pretty nifty visualization in the browser.  
is use of local storage too server like for this class?

On Wednesday, April 3, 2013 10:47:15 AM UTC-7, Massimo Di Pierro wrote:

 Tomorrow I am starting teach a new class. I did not create the class, it 
 was assigned to me. The class is for undergraduate students who have little 
 or no programming experience but know HTML+CSS. No server-side programming 
 experience. The class should cover JS+jQuery but no server-side programming.

 What are some cool uses of JS/jQuery that do not involve server-side 
 programming? 
 I am thinking of hooking to some JSONP services. Is there any you would 
 suggest?

 Massimo


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: auth.user.id in restful api

2013-04-06 Thread Christian Foster Howes
have you tried decorating your GET/PUT/POST/DELETE methods with the 
@requires_login()?

@request.restful()
def user():
@requires_login()
def GET(*args, **kwargs):
 

i'm doing something similar to that...but with a custom decorator rather 
than requires_login.

cfh


On Friday, April 5, 2013 2:58:17 PM UTC-7, Philipp Müller wrote:

 Hello,

 I have written a restful API in web2py using @request_restful() and then 
 specified the patterns and tables that I wanted to expose in the API.
 The whole API uses basic auth, which is fine. I'm used to retrieving the 
 user, that currently uses a service by calling auth.user.id. If I wanted 
 to check what items in the database are associated with the currently 
 logged in user, I could do that with a db query. 

 Using @request_restful, I would like to do the exact thing, i.e. return 
 only values, that are associated with the user, that is currently using my 
 API. I have been able to figure out how to do this, any help regarding this 
 problem would be highly appreciated.

 Kind regards,
 Philipp


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: does Field attribiute unique=True work on GAE?

2013-03-27 Thread Christian Foster Howes
i do make use of the IS_NOT_IN_DB() validator.  Note that you can still 
have duplicates if 2 requests are received by GAE at nearly the same time.

assuming your requests are more than say 1 second apart, if IS_NOT_IN_DB() 
is failing i would consider it a bug.

NOTE that GAE dev_appserver.py released late last week in the SDK update 
changes the consistency model making it much more likely that you will have 
slow replication on the dev server.

On Monday, March 25, 2013 6:18:37 PM UTC-7, Jaime Sempere wrote:

 Sorry to bump this up, but I have not been able of using unique as it is 
 described here (no validators).

 Also I have tried to use IS_NOT_IN_DB instead of unique as in this other 
 thread is suggested: 
 https://groups.google.com/forum/?fromgroups=#!searchin/web2py/gae$20unique/web2py/ZepLjcBowZs/FuKiSYZGzUAJ
  ; 
 but same results

 Introducir código aquí...db.define_table('likes',
   Field('user_id', 'reference users', 
 notnull='True'),
   Field('post_id', 'reference posts', 
 notnull='True'),
   Field('unique_key', unique=True, compute= lambda 
 row: %(user_id)s-%(post_id)s %row)
 )


 This worked for me in web2py but not in GAE (by the way I don't know if I 
 should add ,'string', after 'unique_key'. Anyway I have tried to add it 
 with same luck).

 I could check manually if 'unique_key' is already in DB before inserting 
 as Massimo suggested in the other thread, but I prefer not adding more code 
 (I have several unique fields that I would like to fix with a simple 
 solution). What am I doing wrong? 

 Thanks in advance


 El viernes, 24 de septiembre de 2010 06:50:01 UTC+2, mdipierro escribió:

 yes and no. It will not be enforced at the database level but if you 
 do not specify validators, it will use it to pick default validator 
 that enforce the uniqueness at the web2py level 

 On Sep 23, 11:17 am, Carl carl.ro...@gmail.com wrote: 
  My db.py includes... 
  
  db.define_table('voucher', 
  Field('code', 'string', length=128, unique=True, notnull=True, 
  required=True), 
   
  
  Locally on sqlite when I insert a second record with the same 'code' 
  as an existing record insert() throws an except. I catch the exception 
  and report back to the user. 
  
  Locally on dev_appserver the duplicate insert() successfully inserts 
  a duplicate record; no exception is thrown. 
  
  I've looked at the 2nd edition book and this group but can't find 
  anything that say that GAE doesn't support unqiue=True. 
  
  Can anyone clarify this use of unique=True on GAE? 
  And if it's not supported is there a recommended alternative approach?



-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: update existing project model without breaking backward compatibility...

2013-03-26 Thread Christian Foster Howes
perhaps i'm a bit old-fashioned, but i don't allow automatic SQL migrations 
on production.  what i tend to do:
 - use automatic migrations in develop
 - record the SQL executed.
 - create a script that combines the migration SQL web2py generates with my 
data migration.
 - put production into maintenance mode
 - run SQL migration script
 - update source code
 - turn production back on

so in your case my SQL migration script would:
 - create the new table
 - copy phone numbers into the new table from the existing table
 - drop the phone number column from the existing table.

that's my perspective on the problem, good luck!

christian

On Sunday, March 24, 2013 4:29:19 AM UTC-7, Loïc wrote:

 Hello all,

 let's imagine I have an app with the following model : 

 db.define_table('contact',
 Field('name'),
 Field('phone_number')
 )

 I have already deployed my app, and I have several contacts with a name 
 and a phone number.

 Then I realise that a contact can have multiple phone numbers. So I add a 
 table :

 db.define_table('phone number',
 Field('type'), #mobile phone number, home phone number, business 
 phone number ,...
 Field('phone_number'),
 Field('contact', 'reference contact'),
 )

 The first time I launch my app with the new model, I want to move existing 
 phone numbers from *contact *table to *phone_number *table.
 Then I want to remove 'phone_number' field from contact table to avoid 
 using it in the future

 What is the best way to do this automatically, and without breaking 
 backward compatibility?

 Thank you


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: how to use web application to send serial commands?

2013-03-15 Thread Christian Foster Howes
i'm not familiar with netcat and minicom.are those python libraries? or 
are there python libraries that know how to speak those things?

assuming you can write python that sends commands to the device (which i 
bet you can do), then it shouldn't be hard to have a URL call a controller 
that creates the right hardware message and sends it along.

On Sunday, March 10, 2013 11:15:18 PM UTC-7, theoffi...@gmail.com wrote:

 Hello everyone! i am clueless on how to create a web app that allows me to 
 control a device through serial command? 
 Currently my Raspberry Pi acts as a web2py server and it can communicate 
 with the device using netcat and minicom. 
 Can someone give me an idea or example? :) thank you very much! :)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: web2py on GAE: Connect to google:sql and google:datastore

2013-03-15 Thread Christian Foster Howes
note that unless the book calls out google:sql vs google:datastore it's 
referring to google:datastore.  SQL was added much later by google, but 
it's a mysql compatible database, and so should have most (perhaps all?) 
the mysql features.

On Tuesday, March 12, 2013 2:14:39 AM UTC-7, decu...@uemd.net wrote:

 Hi all

 According to the web2py book[1] accessible_query(...) is not working on 
 GAE.
 As there is now a google:sql and google:datastore storage available I 
 thought of using both: sql for the auth and datastore for the rest.
 The output of the accessible_query would be ideal to query the datastore.

 What do you think? Could this work? Will web2py auth support this?

 In models/db.py I would try something like this:

 sql = DAL('google:sql')
 datastore = DAL('google:datastore')
 from gluon.tools import Auth
 auth = Auth(sql)

 Cheers
 -Luca.

 [1] http://web2py.com/books/default/chapter/29/09


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Re: Ticket Error: class 'serial.serialutil.SerialException' could not open port /dev/ttyAMA0:

2013-03-15 Thread Christian Foster Howes
the user for web2py depends on how you launch it...

if you call:

python web2py.py

then it runs as you

if you:

sudo su bob
python web2py.py

it runs a bob.

if you use apache or some other server i believe by default it runs as the 
user that is running apache.

On Thursday, March 14, 2013 8:41:25 PM UTC-7, The Organisation of Secret 
Shoppers wrote:

 hmm how do i check? i think running the python script has to be root 
 user? but i'm not sure what is the user type for the web2py... 


 On Thu, Mar 14, 2013 at 4:24 PM, Niphlod nip...@gmail.com 
 javascript:wrote:

 did you check that the user running your working script is the same as 
 the one running the I'm going wrong web2py ?


 On Thursday, March 14, 2013 8:30:38 AM UTC+1, theoffi...@gmail.com wrote:

 Hello guys, 


 i hope someone can help me with this! i have been stuck here for days. I 
 just created a web app using web2py and i want to use it to send some 
 serial commands to a device through Raspberry Pi. 

 I have successfully sent the commands from R-Pi to the device by running 
 a Python script in the terminal. 

 But i thought web2py is using python as well so i did something similar 
 but i get the error below:
 *class 'serial.serialutil.SerialException' could not open port 
 /dev/ttyAMA0: [Errno 13] Permission denied: '/dev/ttyAMA0'*


 my codes are:

 in Controller:


 def test():

 import serial

 serialport= serial.Serial(/dev/ttyAMA0, 9600, timeout=0.5)

 return dict() -- not sure what to return
 in view/default/index.html:

 a href = {{=URL 
 https://10.0.0.132/examples/global/vars/URL(c='default', 
 f='test')}}img src =/Comfort2/static/images/off.**jpg width =75 
 height=75/a


 i created a default/test.html as well. 


 i have no idea what's wrong! :( give me some hints please. thank you!

  -- 
  
 --- 
 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/tiWZkXMoo6E/unsubscribe?hl=en.
 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/groups/opt_out.
  
  




-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Re: Uploading and Downloading Bulk data GAE

2013-03-15 Thread Christian Foster Howes
i use the bulk uploader/downloader from google (with some custom transforms 
to keep the same IDs across copies).  i've found it to be the most 
efficient and reliable way to get large amounts of data transferred.

On Thursday, March 14, 2013 5:00:20 AM UTC-7, José Manuel López wrote:

 Hi, 
 I'm searching for a method to upload / download data from / to GAE. 
 Basically I have Hotels, Hotels Images, Cities, Cities Images ... in wich 
 some images belongs to some Cities / Hotels. 
 I've found a way using the bulk uploader from Google, but I don't know if 
 it's the best way to do it because. 

 Any ideas?

 Thanks, 
 Jose M.


-- 

--- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




  1   2   >