[web2py] Re: Anvanced applications in gae

2010-07-05 Thread dlypka
Here is some sample code using these features. I have tested it, although the following is slightly edited from what I tested: try: from gluon.contrib.gql import * # if running on Google App Engine except: db=SQLDB('sqlite://storage.db') datastoretype = 'SQL' else: db=GQLDB

Re: [web2py] Re: Anvanced applications in gae

2010-07-01 Thread Carles Gonzalez
Ah... Ok, that makes much more sense. On Thu, Jul 1, 2010 at 2:03 PM, mdipierro wrote: > Sorry... > > Field('fieldname',type=gae.ReferenceProperty(db.auth_user._tableobj,) > > On 1 Lug, 03:23, Carles Gonzalez wrote: >> Tested and now the error is: >> >> Traceback (most recent call last): >>

[web2py] Re: Anvanced applications in gae

2010-07-01 Thread mdipierro
Sorry... Field('fieldname',type=gae.ReferenceProperty(db.auth_user._tableobj,) On 1 Lug, 03:23, Carles Gonzalez wrote: > Tested and now the error is: > > Traceback (most recent call last): >   File "/Users/lauer/web2py/gluon/restricted.py", line 178, in restricted >     exec ccode in environ

Re: [web2py] Re: Anvanced applications in gae

2010-07-01 Thread Carles Gonzalez
Tested and now the error is: Traceback (most recent call last): File "/Users/lauer/web2py/gluon/restricted.py", line 178, in restricted exec ccode in environment File "/Users/lauer/web2py/applications/web2pytodo/models/db.py", line 76, in Field(gae.ReferenceProperty(db.auth_user._tabl

[web2py] Re: Anvanced applications in gae

2010-06-30 Thread mdipierro
I think, Field(gae.ReferenceProperty(auth_user,...) should be Field(gae.ReferenceProperty(db.auth_user._tableobj,) On 30 Giu, 16:15, Carles Gonzalez wrote: > Sorry, but I've encontured another error. > > The relevant part of my code is following: > > if request

Re: [web2py] Re: Anvanced applications in gae

2010-06-30 Thread Carles Gonzalez
Sorry, but I've encontured another error. The relevant part of my code is following: if request.env.web2py_runtime_gae:# if running on Google App Engine from gluon.contrib.login_methods.gae_google_account import GaeGoogleAccount auth.settings.login_form = GaeGoogleAccount()

Re: [web2py] Re: Anvanced applications in gae

2010-06-30 Thread Carles Gonzalez
Now is working. Thanks, let's continue testing... On Wed, Jun 30, 2010 at 10:39 PM, mdipierro wrote: > You are right... fixing it in trunk..1..2..3..done. Please check it. > > Massimo > > On 30 Giu, 15:25, Carles Gonzalez wrote: >> Hi, i was trying this technique but i'm getting this traceback w

[web2py] Re: Anvanced applications in gae

2010-06-30 Thread mdipierro
You are right... fixing it in trunk..1..2..3..done. Please check it. Massimo On 30 Giu, 15:25, Carles Gonzalez wrote: > Hi, i was trying this technique but i'm getting this traceback when > using gae_google_account: > > Traceback (most recent call last): >   File "/Users/lauer/web2py/gluon/restr

Re: [web2py] Re: Anvanced applications in gae

2010-06-30 Thread Carles Gonzalez
Hi, i was trying this technique but i'm getting this traceback when using gae_google_account: Traceback (most recent call last): File "/Users/lauer/web2py/gluon/restricted.py", line 178, in restricted exec ccode in environment File "/Users/lauer/web2py/applications/web2pytodo/controllers/

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread dlypka
OK I downloaded the trunk and tested this mod. myParent = db.ParentTable.insert(name='Bill') myParentNativeRef = myParent._table._last_reference works Thanks again. On Jun 27, 3:28 pm, mdipierro wrote: > > Maybe just add a new property dynamically to the row > > We could call it 'nati

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread dlypka
Correction upon actually testing code in trunk: myParentNativeRef = myParent._last_reference # This uses Massimo's mod in the trunk... should be: myParentNativeRef = myParent._table._last_reference # This uses Massimo's mod in the trunk... On Jun 27, 6:03 pm, dlypka wrote: > # NOTE: I have *

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread dlypka
Thanks for the detailed instructions - will do. On Jun 27, 6:19 pm, Yarko Tymciurak wrote: > On Jun 27, 4:36 pm, dlypka wrote: > > > Great. Thanks so much! > > > However, I've never accessed the 'trunk' before. > > > I don't think I have access. > > You do - it's distributed SCM - you have read-

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread Yarko Tymciurak
On Jun 27, 4:36 pm, dlypka wrote: > Great. Thanks so much! > > However, I've never accessed the 'trunk' before. > > I don't think I have access. You do - it's distributed SCM - you have read-only access > > Do I need to do a get from Mercurial source control? > > I have WING IDE, which I believe

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread dlypka
# NOTE: I have *NOT* tested the following code # because this is greatly simplified from my actual code, # so some debugging may be necessary to get it to work # # The following assumes that gql.py has been modified to add a statement to method # insert(): # add a new statemtent b

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread dlypka
Great. Thanks so much! However, I've never accessed the 'trunk' before. I don't think I have access. Do I need to do a get from Mercurial source control? I have WING IDE, which I believe supports Mercurial. On Jun 27, 3:28 pm, mdipierro wrote: > > Maybe just add a new property dynamically to

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread mdipierro
> Maybe just add a new property dynamically to the row > We could call it 'nativeRef' > > Would it be something like: >     self.nativeRef = tmp     # Python can add new properties 'on-the-fly', > right? > > as the new 2nd last statement of insert()? If that is useful we can do it. I just did it

Re: [web2py] Re: Anvanced applications in gae

2010-06-27 Thread Carles Gonzalez
I thought that IS_IN_DB() could do all the heavy lifting, searching by gae keys instead of integers and updating references. That way we wouldn't lose SQLFORM and the api would be the same on both on SQL and GQL. But i'm drifting, your explanations are great and when you tell us the last part of t

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread dlypka
I am not sure what functionality is being requested to add GAE specific support to IS_IN_DB. My discussion has been about high performance links from parent to children. What native GAE object(s) would you need to check in IS_IN_DB ? Anyway, one nice to have patch would be to have insert() return

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread mdipierro
I will wait for a patch from Dave. He knows more than I know about this. Massimo On Jun 27, 10:44 am, Carles Gonzalez wrote: > One word: WOW! > > I look forward to the next message, this way gae is really appeling. > And your way of teaching is fun, really!. > > Moreover, Massimo, can't this met

Re: [web2py] Re: Anvanced applications in gae

2010-06-27 Thread Carles Gonzalez
One word: WOW! I look forward to the next message, this way gae is really appeling. And your way of teaching is fun, really!. Moreover, Massimo, can't this method be the default behaviour to IS_IN_DB when running on gae? I't seems a good fit. Just my 2 cents. On Sun, Jun 27, 2010 at 4:36 PM, dl

[web2py] Re: Anvanced applications in gae

2010-06-27 Thread dlypka
Assuming you have try: from gluon.contrib.gql import * # if running on Google App Engine except: db=SQLDB('sqlite://storage.db') # if not, use SQLite or other DB - Used by T2 datastoretype = 'SQL' else: db=GQLDB() # connect to Googl d

Re: [web2py] Re: Anvanced applications in gae

2010-06-26 Thread Carles Gonzalez
Very interesting, i didn't know about collection_name and the associated query. You are shedding some light on doing relationships the GAE way. Thanks again. On Sat, Jun 26, 2010 at 8:52 AM, dlypka wrote: > > For starters: > > Refer to > http://arbingersys.blogspot.com/2008/04/google-app-engine

[web2py] Re: Anvanced applications in gae

2010-06-25 Thread dlypka
For starters: Refer to http://arbingersys.blogspot.com/2008/04/google-app-engine-one-to-many-join_26.html?showComment=1244344382942#c5661660955046324965 And Here is the posting about using native GAE properties http://groups.google.com/group/web2py/browse_thread/thread/7112ef7dee1ccf32/d2b0d24c

Re: [web2py] Re: Anvanced applications in gae

2010-06-25 Thread Carles
Thanks a lot Dave. There isn't a deadline, tale your time :) Carles El 25/06/2010, a las 20:42, dlypka escribió: > OK will do - please give me a few days... > > On Jun 24, 8:43 pm, Carles Gonzalez wrote: >> Not to be annoying, but can you post an example? >> >> Just to organize the things i

[web2py] Re: Anvanced applications in gae

2010-06-25 Thread dlypka
OK will do - please give me a few days... On Jun 24, 8:43 pm, Carles Gonzalez wrote: > Not to be annoying, but can you post an example? > > Just to organize the things in my head... > > Thanks again. > > > > On Fri, Jun 25, 2010 at 2:41 AM, Carles Gonzalez wrote: > > Very interesting! > > > I'll

Re: [web2py] Re: Anvanced applications in gae

2010-06-24 Thread Carles Gonzalez
Not to be annoying, but can you post an example? Just to organize the things in my head... Thanks again. On Fri, Jun 25, 2010 at 2:41 AM, Carles Gonzalez wrote: > Very interesting! > > I'll try tomorrow. > > Thanks a lot, Dave. > > On Fri, Jun 25, 2010 at 1:21 AM, dlypka wrote: >> I've done a

Re: [web2py] Re: Anvanced applications in gae

2010-06-24 Thread Carles Gonzalez
Very interesting! I'll try tomorrow. Thanks a lot, Dave. On Fri, Jun 25, 2010 at 1:21 AM, dlypka wrote: > I've done a parent - to - many child GAE / web2py implementation using > SelfReference  fields (or you can use Reference as well) using the > technique for adding native GAE fields into a w

[web2py] Re: Anvanced applications in gae

2010-06-24 Thread dlypka
I've done a parent - to - many child GAE / web2py implementation using SelfReference fields (or you can use Reference as well) using the technique for adding native GAE fields into a web2py table definition. It gives fantastic retrieval performance because GAE automatically adds the link from the

Re: [web2py] Re: Anvanced applications in gae

2010-06-24 Thread Carles Gonzalez
Thanks! On Thu, Jun 24, 2010 at 2:27 PM, mdipierro wrote: > thinking about how to handle this... > > On Jun 22, 12:56 pm, Carles Gonzalez wrote: >> My english is horrible, an maybe it wasn't clear, but that was exactly >> my problem :). >> >> Currently i'm looking at the code massimo told me abo

[web2py] Re: Anvanced applications in gae

2010-06-24 Thread mdipierro
thinking about how to handle this... On Jun 22, 12:56 pm, Carles Gonzalez wrote: > My english is horrible, an maybe it wasn't clear, but that was exactly > my problem :). > > Currently i'm looking at the code massimo told me about but i think > that the problem isn't here. > > I explain: the pare

[web2py] Re: Anvanced applications in gae

2010-06-23 Thread Yarko Tymciurak
On Jun 23, 9:11 am, Carles wrote: > Sorry but, any thoughts? Have you looked at http://www.web2py.com/book/default/section/6/6?search=puppy or http://www.web2py.com/book/default/section/6/9?search=puppy (you could have a relationship field if you _needed_, or you could simply have a parent / c

Re: [web2py] Re: Anvanced applications in gae

2010-06-23 Thread Carles
Sorry but, any thoughts? Carles El 22/06/2010, a las 19:56, Carles Gonzalez escribió: > My english is horrible, an maybe it wasn't clear, but that was exactly > my problem :). > > Currently i'm looking at the code massimo told me about but i think > that the problem isn't here. > > I explain:

Re: [web2py] Re: Anvanced applications in gae

2010-06-22 Thread Carles Gonzalez
My english is horrible, an maybe it wasn't clear, but that was exactly my problem :). Currently i'm looking at the code massimo told me about but i think that the problem isn't here. I explain: the parent is assigned when the child entity is created (at the constructor level), to ensure all entit

[web2py] Re: Anvanced applications in gae

2010-06-21 Thread Matt
Any chance this could be considered as well? Currently the DAL doesn't allow you to set the parent which is required for GAE entity groups. http://groups.google.com/group/web2py/browse_thread/thread/3c11deb2bfadf207/96a4324e5fd0cf71?lnk=gst&q=GAE+parent#96a4324e5fd0cf71 On Jun 22, 7:35 am, Carle

Re: [web2py] Re: Anvanced applications in gae

2010-06-21 Thread Carles
Ok, I'll try. Carles El 21/06/2010, a las 19:03, mdipierro escribió: > The only file you need to look into is gluon/contrib/gql.py > > specifically the select() function which calls filter returns the Rows > object > > On Jun 21, 11:55 am, Carles Gonzalez wrote: >> Ok, thanks! I would like t

[web2py] Re: Anvanced applications in gae

2010-06-21 Thread mdipierro
The only file you need to look into is gluon/contrib/gql.py specifically the select() function which calls filter returns the Rows object On Jun 21, 11:55 am, Carles Gonzalez wrote: > Ok, thanks! I would like to make the patch myself, but the innards of > web2py are somewhat complex... > > Thank

Re: [web2py] Re: Anvanced applications in gae

2010-06-21 Thread Carles Gonzalez
Ok, thanks! I would like to make the patch myself, but the innards of web2py are somewhat complex... Thanks again, Carles. On Mon, Jun 21, 2010 at 6:43 PM, mdipierro wrote: > Probably it would not be hard to implement. I will look into this next > week but if somebody sends me a patch before tha

[web2py] Re: Anvanced applications in gae

2010-06-21 Thread mdipierro
Probably it would not be hard to implement. I will look into this next week but if somebody sends me a patch before that I will take it. Massimo On Jun 21, 9:25 am, Carles Gonzalez wrote: > Hi, > > I have developed some applications in web2py, and 2 are running > currently in gae, but now i have