[web2py:10442] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread justinjas
Hey Massimo, I still get the same 2000mcycles+ with 800ms+ times. 10-18 08:48PM 27.724 / 200 912ms 2130mcycles 0kb Of interest though is if I refresh the page quickly I can get fast responses back from app engine. 10-18 08:48PM 30.007 / 200 16ms 22mcycles 0kb As if app engine is doing their o

[web2py:10441] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread mdipierro
Hi Justin, could you do a test for us: 1) edit gluon/compileapp.py and comment if data[:4]!=imp.get_magic(): raise SystemError, "compiled code is incompatible" 2) run web2py locally, without appengine and "compile" your app 3) deply on the appengine and see if it works and tell us

[web2py:10440] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread mdipierro
I agree and I will be waiting for a patch. ;-) Anyway from http://code.google.com/appengine/docs/whatisgoogleappengine.html "The Python runtime environment uses Python version 2.5.2." This means that just commenting the two lines I suggested above should do the trick, until nobody upgrades to 2.

[web2py:10439] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread Robin B
These are the benefits of storing the compiled code in RAM (in a dict): 1. guaranteed compatible bytecode (its compiled on the server). 2. user does not need to remember to (re)compile the app before uploading. 3. user does not need to hassle with any .pyc what so ever. 4. fastest possible code a

[web2py:10438] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread Robin B
I compiled the app locally using the web2py admin, edited the app.yaml to upload *.pyc, then I uploaded the app to see if the compiled/*.pyc worked and got the error. I assumed that Google removed get_magic for some reason, but I did not pursue it. It would be interesting to skip get_magic and s

[web2py:10437] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread mdipierro
This is interesting... http://code.google.com/p/appengine-monkey/issues/detail?id=8 On Oct 18, 6:57 pm, mdipierro <[EMAIL PROTECTED]> wrote: > I see they are not exposing imp.get_magic() because they use a custom > interpreter. > > Could you also try comment the following lines in compileapp.py a

[web2py:10436] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread mdipierro
I see they are not exposing imp.get_magic() because they use a custom interpreter. Could you also try comment the following lines in compileapp.py and see what happens? if data[:4]!=imp.get_magic(): raise SystemError, "compiled code is incompatible" It is unsafe but it is worth a tr

[web2py:10435] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread mdipierro
Robin, If you could send me the exact error I will ask Guido. This must have a very easy fix. Massimo On Oct 18, 6:47 pm, Robin B <[EMAIL PROTECTED]> wrote: > When I uploaded compiled *.pyc and tried to run it, an error was > raised, something about imp.get_magic not existing. It might be > p

[web2py:10434] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread Robin B
When I uploaded compiled *.pyc and tried to run it, an error was raised, something about imp.get_magic not existing. It might be possible to avoid imp.get_magic and get it loading, but I have not tried that. I did try putting the code into a dict, and that sped things up. Robin On Oct 18, 5:55

[web2py:10433] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread mdipierro
As far as I know Django imports. When you say "The uploaded *.pyc will not load on app engine for security reasons." do you refer to the gluon modules or also to the app/compiled/*.pyc? The latter should work, exactly because we bypass the normal import. Massimo On Oct 18, 6:35 pm, Robin B <[

[web2py:10432] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread Robin B
The uploaded *.pyc will not load on app engine for security reasons. I am not sure how Django handles it, does Django use import or exec? Modules that are imported get compiled and reused, but web2py uses exec to mixin symbols which bypasses the regular import mechanism. Putting the compiled so

[web2py:10431] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread mdipierro
Robin, is it sufficient to byte-code compile the app and make sure the pyc files (including gluon/*.pyc) are uploaded too or do we need to modify web2py? Massimo On Oct 18, 5:28 pm, yarko <[EMAIL PROTECTED]> wrote: > Sorry - I don't know about *.pyc files; I assume they're not platform > depen

[web2py:10430] Re: t2 and stamp columns

2008-10-18 Thread mdipierro
We should have a version number, both in web2py and in T2. Anyway, I am pretty sure I posted http://mdp.cti.depaul.edu/examples/static/web2py.app.plugin_t2.tar and it contains a new _filter_fields methods that is called by create and update. Could you double check? Massimo On Oct 18, 4:14 p

[web2py:10428] Re: sqldesigner again

2008-10-18 Thread mdipierro
Thank you Boris! this is great. I am not on my computer. I will download this later today. Massimo On Oct 18, 5:24 pm, yarko <[EMAIL PROTECTED]> wrote: > Thanks Boris - > > I can't wait to look at this some more! > > Just a note: > > In your controllers/default.py,  you should use URL, so that t

[web2py:10429] Re: Database table from SQL query

2008-10-18 Thread yarko
AH! Yes, now it makes sense. to modify like this, all magic (for me at least) goes away: db.define_table('tableE',SQLField('name')) db.define_table('tableA',SQLField('tableE_id',db.tableE),SQLField('name')) condition=db.tableE.name.like('%o') ## records where name ends in 'o' db.tableA.tab

[web2py:10427] Re: Database table from SQL query

2008-10-18 Thread mdipierro
I think the names are just confusing. tableA is the table field. tableE in this case is a field of tableA. This is the normal way to set a validator. The only point of the example is that in IS_IN_DB(db, ...) db can be replaced by a SQLSet db(). On Oct 18, 4:09 pm, yarko <[EMAIL PROTECTED]> w

[web2py:10426] Re: Database table from SQL query

2008-10-18 Thread yarko
that should have read "...the name field out of tableE" On Oct 18, 4:09 pm, yarko <[EMAIL PROTECTED]> wrote: > I'm sorry this reads a little bit like magic to me - can someone > walk me through this line, and how it works: > >     db.tableA.tableE.requires=. > > I don't know how

[web2py:10425] Re: Testing in web2py

2008-10-18 Thread mdipierro
You can write two types of tests: doctests and tests/*.py tests. You can runs the latters from the shell (try -h). I will look into selenium. On Oct 17, 9:25 am, Timothy Farrell <[EMAIL PROTECTED]> wrote: > Massimo, > > I implied in my previous post, that I don't use web2py's built-in > testing.

[web2py:10424] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread yarko
Sorry - I don't know about *.pyc files; I assume they're not platform dependent, so I'm assuming that uploading *.pyc files with your app doesn't work (?). How is the Django support on GAE handling this issue? On Oct 18, 1:51 pm, Robin B <[EMAIL PROTECTED]> wrote: > In compileapp.py, after read

[web2py:10423] Re: sqldesigner again

2008-10-18 Thread yarko
Thanks Boris - I can't wait to look at this some more! Just a note: In your controllers/default.py, you should use URL, so that this will work from app names other than "init" - this worked for me: def index(): # redirect('designer.html') redirect(URL(r=request,c='static',f='des

[web2py:10422] Re: t2 and stamp columns

2008-10-18 Thread yarko
...it would be a good idea to have a version number (or at least date/ time stamp) on download files... You probably want to just get t2 from launchpad, using bazaar. if you don't have bazaar, don't fret - it's a Python program, and runs pretty easily. All the gory details of getting this wi

[web2py:10421] Re: Database table from SQL query

2008-10-18 Thread yarko
I'm sorry this reads a little bit like magic to me - can someone walk me through this line, and how it works: db.tableA.tableE.requires=. I don't know how to read / make sense of this. Help please! I think I get the right side of this ( condition is the database selector; tableE.i

[web2py:10420] Re: Testing in web2py

2008-10-18 Thread yarko
there are some other projects that use "nose", and from what little I looked at selenium, it looks like you can generate a test script (at least a sample) by recording actions. Selenium is open, written in Java, and looks to have a Python interface (to drive tests). Anyone look at this more?

[web2py:10419] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread Robin B
In compileapp.py, after reading, parsing, and compiling a model, view, or controller, if a .pyc cannot be written to disk, instead store the compiled code, by file name/function, in a global dict so that next request you can simply load the precompiled code directly from RAM. Since web2py does no

[web2py:10417] Re: t2 and stamp columns

2008-10-18 Thread billf
Massimo I have downloaded the tar from http://mdp.cti.depaul.edu/examples/static/web2py.app.plugin_t2.tar but that does not seem to be different from the version I already had. I couldn't see another version in Google code. From where should I download the latest t2? Would it be a good idea t

[web2py:10416] Re: Database table from SQL query

2008-10-18 Thread morningovermidnight
Thanks! On Oct 17, 10:33 am, mdipierro <[EMAIL PROTECTED]> wrote: > db.define_table('tableE',SQLField('name')) > > db.define_table('tableA',SQLField('tableE',db.tableE),SQLField('name')) > > condition=db.tableE.name.like('%o') ## records where name ends in 'o' > db.tableA.tableE.requires=IS_IN_DB

[web2py:10415] Re: Testing in web2py

2008-10-18 Thread morningovermidnight
Thanks for pointing me to selenium (http://selenium.openqa.org/). It looks great. I've also seen some other automated web testing soultions such as twill (http://twill.idyll.org/) and TestGen4Web (http:// developer.spikesource.com/wiki/index.php?title=Projects:TestGen4Web). If you don't mind, coul

[web2py:10414] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread mdipierro
On Oct 18, 9:51 am, Robin B <[EMAIL PROTECTED]> wrote: > Web2py 'works' on appengine, but it is reading, parsing and compiling > the models, controllers, and views on *every* request causing all the > wasted CPU cycles. Normally, web2py caches code as .pyc files, but > you cannot write the file

[web2py:10413] Re: t2 and stamp columns

2008-10-18 Thread mdipierro
Give it a try. I made the fix you suggested: created_* and modified_* are no longer shown in t2 forms. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to

[web2py:10412] Re: Google App Engine with web2py and high cpu cycles / slow response time

2008-10-18 Thread Robin B
Web2py 'works' on appengine, but it is reading, parsing and compiling the models, controllers, and views on *every* request causing all the wasted CPU cycles. Normally, web2py caches code as .pyc files, but you cannot write the filesystem on appengine so nothing gets cached by default. It is tri

[web2py:10411] Re: web2py cookbook anyone?

2008-10-18 Thread yarko
I'd like to see some coding suggestions to deal with this: - Somebody suggest revised data table design for AlterEgo, and then build it: - these items come to mind: Post date; refers to web2py version; info about context (hosting O/S or GAE: t2; etc.) - Somebody write up an applica

[web2py:10410] Re: web2py cookbook anyone?

2008-10-18 Thread Keith Edmunds
I agree that the documentation needs to be pulled together. I don't program in web2py very often - I'm trying to run a business and we use web2py for our internal applications, but they don't get worked on every day or even every month. However, I do think web2py is an excellent framework. Cohesiv

[web2py:10409] Re: web2py cookbook anyone?

2008-10-18 Thread voltron
I understand both points of view. It is very beneficial to all of us if we can share and discuss information in form of Snippets, HowTos, Tutorials. I have great respect for those that actually take the time to write these, I have promised myself to write several, but have to date, only been able