[web2py] Cron (Google App Engine)

2010-02-24 Thread Jon Romero
How we can specify the url to Google's cron in order to execute a url webpy? I tried something like that but it fails cron: - description: daily stats url: /init/default/stats schedule: every day 21:20 timezone: Europe/Athens Anyone using gae cron with web2py? -- You received this

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-24 Thread Jon Romero
So, any idea/hint how to do it? Do we need a patch? On Feb 23, 10:40 pm, spiffytech spiffyt...@gmail.com wrote: I'm running the latest version, 1.75.4. On Feb 23, 11:35 am, Thadeus Burgess thade...@thadeusb.com wrote: What version of web2py are you running? What is the output of ``python

[web2py] Re: Cron (Google App Engine)

2010-02-24 Thread Jon Romero
Nevermind. It's correct. On Feb 24, 9:59 am, Jon Romero darks...@gmail.com wrote: How we can specify the url to Google's cron in order to execute a url webpy? I tried something like that but it fails cron: - description: daily stats   url: /init/default/stats   schedule: every day 21:20  

[web2py] Re: web2py with Cherokee via uWSGI: a simple, easy guide

2010-02-24 Thread mr.freeze
This is really helpful. Unfortunately, it will be lost on this mailing list in a month or so. Care to make a slice? http://www.web2pyslices.com/main/default/index On Feb 23, 2:56 pm, GrayMatterComputing battledi...@gmail.com wrote: web2py with Cherokee via uWSGI: a simple, easy guide (written

[web2py] Re: google app engine, file size limits

2010-02-24 Thread what_ho
no problem! With some informal testing I found the blobstore absolutely flies along, serves up files as fast as whatever internet connection I tried could handle. I did not load test with multiple users, but I don't doubt this service is built to scale. The blobstore is meant for file upload and

[web2py] web2py help resources

2010-02-24 Thread DenesL
Primary source of help: web2py groups - Groups in English: http://groups.google.com/group/web2py/topics http://groups.google.com/group/web2py-developers/topics Grupo de usuários brasileiros do web2py: http://groups.google.com/group/web2py-users-brazil/topics

[web2py] Re: Plugin system status

2010-02-24 Thread mr.freeze
Then no auth would mean no plugins. What if an attribute was added to DAL to let the user specify: db = DAL('...') db.plugin_db = True Then create a global plugin_db object for the plugins to use. All plugins could then assume: db = plugin_db or just use plugin_db directly There may be a better

[web2py] Some interrogations concerning Web2py compatibilities

2010-02-24 Thread Magnitus
Hi, I'm a beginner in python and a complete neophyte in python web frameworks so don't bash my head in if the questions are stupid... I'm developing an application in C++ for windows x64 and I am now looking for a way to make it a web app. I'm looking for compatibility with python 2.6 (already

[web2py] Re: Plugin system status

2010-02-24 Thread mr.freeze
Alternately you could simply create another container class for plugins to use and pass the preferred DAL instance to it just like you can with auth and crud: db = DAL('...') db2 = DAL('...') auth = Auth(globals(),db) crud = Crud(globals(),db) plugins = Plugins(globals(),db2) This seems more

[web2py] Re: Combining LEFT OUTER JOIN with COUNTING

2010-02-24 Thread aure
It worked fine, thank you! Aurelien (I got it wrong because I had tried instead: count = db.person.id.count()) On Feb 18, 3:19 pm, mdipierro mdipie...@cs.depaul.edu wrote: Now sure  try count = db.dog.id.count() rows=db().select(db.person.id,db.person.name, count,

Re: [web2py] Some interrogations concerning Web2py compatibilities

2010-02-24 Thread Tiago Almeida
No questions are stupid. I'm no expert but I'll coment on what I know. Web2py runs officially in python 2.5. Don't know how hard it would be to put web2py running on 2.6. You don't need the binary package to run web2py, you can run it directly from python (execute file web2py.py) python

[web2py] Re: Some interrogations concerning Web2py compatibilities

2010-02-24 Thread Magnitus
Ah, I'm browsing through the web manual and found this statement which left me with more questions: web2py runs with CPython (the C implementation) and/or Jython (the Java implementation), versions 2.4, 2.5 and 2.6 although officially only support 2.5 else we cannot guarantee backward

[web2py] Two records inserted instead of one

2010-02-24 Thread mdmcginn
This form inserts two records, the first containing only the submitted data ('choice') and the second containing the poll and voter ids as well. I only need the second one. What should I do differently? Sorry, I'm sure the solution is obvious to everyone but me! Controller: def respond(): p =

[web2py] Re: {{=form.custom.begin}} - How set an ID to form

2010-02-24 Thread arnaud
Massimo, no misundestood. I expect a css ID in my form. I have run the same test on welcome app. That's work fine. But in my app, no ID for my form. It's perhaps a bug in view with the tag {{=form.custom.begin}}. On 24 fév, 01:10, mdipierro mdipie...@cs.depaul.edu wrote: It does work: $

[web2py] typos in new documentation?

2010-02-24 Thread aure
Here is what reads on page 6.5. Query, Set, Rows, in part orderby, groupby, limitby, distinct: --- You can fetch the records sorted by name in reverse order (notice the !): for row in db().select(db.person.ALL, orderby= db.person.name): print row.name Carl Bob Alex --- There is no !

[web2py] Re: Two records inserted instead of one

2010-02-24 Thread DenesL
On acceptance (accepts==True) the SQLFORM form would do the insert for you. This explains your duplicate record. With FORM you would have to do your own insert inside the acceptance test. form=FORM(...) if form.accepts(...): #insert record here On Feb 24, 8:49 am, mdmcginn

Re: [web2py] Re: Some interrogations concerning Web2py compatibilities

2010-02-24 Thread Timothy Farrell
web2py runs flawlessly in Python 2.6. I've been running it for several months. All python code (web2py included) that runs on 2.5 runs on 2.6 as well. The inverse is not true however. The main purpose of Python 2.6 (and the upcoming 2.7) is to facilitate code migration to Python 3.x. It

[web2py] Re: Problem with custom auth fields on BigTable

2010-02-24 Thread G. Clifford Williams
Yep. it works. Of course, now I've decided to move that chunk to a separate 'profiles' table. ;-) In part because I didn't want people to have to supply all of that upon registration. Thanks On Feb 19, 8:01 am, mdipierro mdipie...@cs.depaul.edu wrote: On a second though. It does not have to

[web2py] Re: {{=form.custom.begin}} - How set an ID to form

2010-02-24 Thread DenesL
The problem is that form.custom.begin is evaluated when the form is created. Changing '_id' after it has been created does not recalculate form.custom.begin, but you can do so manually: form['_id']='my_form_id' form.custom.begin=XML(%s %s) %(form.tag,form._xml()[0])) Denes. On Feb 24, 9:50 am,

Re: [web2py] Re: Plugin system status

2010-02-24 Thread Thadeus Burgess
I also am in favor of a class based plugin system that works like crud/auth. Plugins would not pollute your global namespace. And they would be configurable. Though the loss is of having plugins with their own controllers since the module would be the controller instead. -Thadeus On Wed,

[web2py] Download and Update Progress +a general question

2010-02-24 Thread AsmanCom
Hi, for quick development-shots, i need to execute my untouched(may i could change print to return) Python scripts(..with loops) in the Controller. The output should be renderd direct via http, without long-winded setting up the view for each function. Is that possible? To my next concern

Re: [web2py] Download and Update Progress +a general question

2010-02-24 Thread Tiago Almeida
for quick development-shots, i need to execute my untouched(may i could change print to return) Python scripts(..with loops) in the Controller. The output should be renderd direct via http, without long-winded setting up the view for each function. Is that possible? If I understand you

[web2py] Re: LOAD and response.view

2010-02-24 Thread vihang
Using response.view = 'blank.html' in the controller Works perfectly ! thanks Massimo On Feb 24, 9:04 am, mdipierro mdipie...@cs.depaul.edu wrote: this is fixed in trunk. On Feb 23, 5:54 pm, mdipierro mdipie...@cs.depaul.edu wrote: You found a bug. In gluon/compileapp.py these two

Re: [web2py] Re: Unit testing in web2py : Some thoughts

2010-02-24 Thread Thadeus Burgess
If I create a unittest init/tests/testControllerDefault.py and run the following command line python web2py.py -S yourapp -M -R applications/init/tests/testControllerDefault.py My test is ran. I don't see what is so confusing. -Thadeus On Wed, Feb 24, 2010 at 12:01 PM, Thadeus Burgess

Re: [web2py] Re: Some interrogations concerning Web2py compatibilities

2010-02-24 Thread Thadeus Burgess
I run all of my web2py apps on 2.6 and have never had any problems. web2py will never support python 3.x. For this there will be a fork of web2py created named web3py which will support the python 3.x branch. Python 3.x goes against everything that web2py stands for (backwards compatibility).

Re: [web2py] typos in new documentation?

2010-02-24 Thread Thadeus Burgess
Massimo this looks like an issue with the latex converter ? I cannot get it to see the tilde for the life of me. -Thadeus On Wed, Feb 24, 2010 at 8:57 AM, aure aureliengir...@googlemail.com wrote: Here is what reads on page 6.5. Query, Set, Rows, in part orderby, groupby, limitby,

Re: [web2py] typos in new documentation?

2010-02-24 Thread Jonathan Lundell
On Feb 24, 2010, at 10:22 AM, Thadeus Burgess wrote: Massimo this looks like an issue with the latex converter ? I cannot get it to see the tilde for the life of me. Here's the html source for that line: pYou can fetch the records sorted by name in reverse order (notice the \verb! ~): /p

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-24 Thread spiffytech
The confusion is not with doctests, but with external unit tests created with the 'unittest' module. Could you please post your testControllerDefault.py so I can see what you're doing different from me? Please allow me to elaborate on my problems running unit tests with web2py. Here is my (very

[web2py] Automagically create a user

2010-02-24 Thread Christopher Steel
I am trying to have my app create a default user that will be used to track administrative tasks. Right now I have the following in the model section but auto inserting to the auth_user table does not seem to work. Does this have to be done manually or can I automatically create a user, group and

Re: [web2py] Automagically create a user

2010-02-24 Thread Tiago Almeida
Where do you have that code? in a model file? Your problem is that the variable with name db is not defined in the scope that code runs. make sure you set it before, usually with db = DAL http://web2py.com/book/default/docstring/DAL(...) * *this variable should be visible in a controller or a

Re: [web2py] Re: Unit testing in web2py : Some thoughts

2010-02-24 Thread Thadeus Burgess
Replacing the way you run test suites helps. Instead of using .main() add them manually. I would suggest reading the following article, as it includes methods to aggregate your test suites together. http://agiletesting.blogspot.com/2005/01/python-unit-testing-part-1-unittest.html import sys

[web2py] Re: Download and Update Progress +a general question

2010-02-24 Thread AsmanCom
Hi Tiango, no i need an equivalent for print, like: def print_1(): print 1 print 2 = 1 2 def print_2(): while True: print 1 = 1 1 1 1 ... I need to execute scripts like in terminal, but output rendered in html. (should be very simple?) Best regards, Dieter Asman -

[web2py] Re: batch upload of legacy files

2010-02-24 Thread Rowdy
mdipierro wrote: You can do it both ways. If you choose to retain the original names you will have to create your own download action. def mydownload(): return response.stream(open(os.path.join(request.folder,'upload','/'.join(request.args)),'rb')) You lose the ability to enforce granular

Re: [web2py] Re: Download and Update Progress +a general question

2010-02-24 Thread Tiago Almeida
This is nasty as hell but you can redirect stdout to a string. Execute your untouched scripts, all they print goes to the string and then, in the web2py controller return that string instead of a dict. Example: -- file print1_script.py: -- def print1(): print 1 #call print1 print1() -- file

Re: [web2py] Re: Download and Update Progress +a general question

2010-02-24 Thread Thadeus Burgess
... response.write(hello bworld/b, escape=False) The issue is that you will not see until the request actually finishes. There is no way to stream text to the server in the way that you are asking unless using a system such as comet -Thadeus On Wed, Feb 24, 2010 at 4:09 PM, Tiago Almeida

[web2py] Re: Automagically create a user - solved

2010-02-24 Thread Christopher Steel
Sure enough, the name I gave it put it before auth tables where defined. Working fine now. Thanks On Feb 24, 2:16 pm, Tiago Almeida tiago.b.alme...@gmail.com wrote: Where do you have that code? in a model file? Your problem is that the variable with name db is not defined in the scope that

[web2py] Re: Automagically create a user - solved

2010-02-24 Thread Christopher Steel
For those interested I needed to rename the model file so that it got loaded after the definition of the auth tables.. I chose z_initializer.py which loaded it after db.py and my other tables. In addition I dropped the extra stuff and ended up with the following: # Description: # Automatically

Re: [web2py] Re: Automagically create a user - solved

2010-02-24 Thread Thadeus Burgess
Yes one of the tricks I usually employ is A_settings.py - global settings, etc B_web2py.py - dal definition, auth, crud, services, etc (web2py related things) C_model2.py - model definitions D_model3.py - query definitions plugin_etc.py plugin_etc2.py Z_compress_output.py -Thadeus On Wed,

[web2py] Re: Download and Update Progress +a general question

2010-02-24 Thread AsmanCom
Yo Tiango, many thanks for your effort. But if you say: this is horrible! I´ll forget about that. The least you should do is transform your scripts so that instead of printing, they return the strings that's what i meant with: (may i could change print to return) But i don´t know how to do

[web2py] Re: Download and Update Progress +a general question

2010-02-24 Thread Dragonfyre13
So, let me make sure I understand this right, you want to stream the response, from the server, to the browser. (have something in the controller display realtime like the print command, instead of display all of the information at once) Or, are you talking about actually using print, and having

[web2py] Re: Download and Update Progress +a general question

2010-02-24 Thread AsmanCom
@Dragonfyre have something in the controller display realtime like the print command, instead of display all of the information at once) You got it! I need a solution to run standard Python scripts and render the output in my browser. with less effort. +a solution to update the Progressbar from

[web2py] Re: Download and Update Progress +a general question

2010-02-24 Thread AsmanCom
@Thadeus Burgess If rendering the standard output from scripts is not natively supported, there must be a better solution than changing the prog. language. a real-time logger or something like that. Best regards, Dieter Asman - AsmanCom - Germany On 24 Feb., 23:14, Thadeus Burgess

Re: [web2py] Re: [web2py:38005] Re: auth.settings.controller

2010-02-24 Thread Alexandre Andrade
Patch: Massimo, It don't work because every time auth initialize, it defines controller as 'default' in line 544 at tools.py self.settings.controller = 'default' I have hacked it to if session and session.auth_controller: self.settings.controller =

[web2py] Re: google app engine, file size limits

2010-02-24 Thread mdipierro
It should be easy to add blobstore support to web2py. On Feb 24, 5:22 am, what_ho a...@viovi.com wrote: no problem! With some informal testing I found the blobstore absolutely flies along, serves up files as fast as whatever internet connection I tried could handle. I did not load test with

[web2py] Re: Plugin system status

2010-02-24 Thread mdipierro
This may be a good idea. What should go into plugins? On Feb 24, 10:41 am, Thadeus Burgess thade...@thadeusb.com wrote: I also am in favor of a class based plugin system that works like crud/auth. Plugins would not pollute your global namespace. And they would be configurable. Though the

[web2py] Re: typos in new documentation?

2010-02-24 Thread mdipierro
These things have to fixed manually. On Feb 24, 12:29 pm, Jonathan Lundell jlund...@pobox.com wrote: On Feb 24, 2010, at 10:22 AM, Thadeus Burgess wrote: Massimo this looks like an issue with the latex converter ? I cannot get it to see the tilde for the life of me. Here's the html

[web2py] Re: batch upload of legacy files

2010-02-24 Thread mdipierro
This is now fixed in trunk. thanks. On Feb 24, 3:07 pm, Rowdy da...@fielden.com.au wrote: mdipierro wrote: You can do it both ways. If you choose to retain the original names you will have to create your own download action. def mydownload(): return

[web2py] Re: Automagically create a user - solved

2010-02-24 Thread mdipierro
My convention is 0_py for configuration stuff db.py for auth and crud the try to make all other files independent on the ordering. On Feb 24, 4:33 pm, Thadeus Burgess thade...@thadeusb.com wrote: Yes one of the tricks I usually employ is A_settings.py  - global settings, etc B_web2py.py

[web2py] Re: [web2py:38005] Re: auth.settings.controller

2010-02-24 Thread mdipierro
I am chaging this so that controller is passed to Auth(...,controller='default') On Feb 24, 6:59 pm, Alexandre Andrade alexandrema...@gmail.com wrote: Patch: Massimo, It don't work because every time auth initialize, it defines controller as 'default' in line 544 at tools.py          

Re: [web2py] Re: Automagically create a user - solved

2010-02-24 Thread Thadeus Burgess
0_.py is not a valid module name, since it starts with a number instead of a letter. -Thadeus On Wed, Feb 24, 2010 at 8:05 PM, mdipierro mdipie...@cs.depaul.edu wrote: My convention is 0_py for configuration stuff db.py for auth and crud the try to make all other files

[web2py] Multiple ajax requests

2010-02-24 Thread mr.freeze
I have two ajax requests: One that starts a long running process and one that fires every second to check the first request's progress. PROBLEM: The ajax requests are running synchronously instead of in parallel. Is this the result of threading in the cherrypy dev server or is some global

[web2py] Re: Multiple ajax requests

2010-02-24 Thread mdipierro
This is because of session locking. if your ajax queries do not need to write the session do session.forget() This should fix it. On Feb 24, 8:31 pm, mr.freeze nat...@freezable.com wrote: I have two ajax requests: One that starts a long running process and one that fires every second to

[web2py] Re: Unit testing in web2py : Some thoughts

2010-02-24 Thread spiffytech
Thanks! Interesting article! My test cases now execute. However, I have a couple new questions, including a problem accessing the db in my controller. I modified my test file as AlterEgo 213 indicates so my unit tests can access the controller's functions. Here is my updated test file:

[web2py] Re: Multiple ajax requests

2010-02-24 Thread mdipierro
P.S. if you use sqlite, the database will serialize all requests. That is how sqlite works. On Feb 24, 9:24 pm, mdipierro mdipie...@cs.depaul.edu wrote: This is because of session locking. if your ajax queries do not need to write the session do     session.forget() This should fix it. On

[web2py] Re: Multiple ajax requests

2010-02-24 Thread mdipierro
P.S. if you use sqlite, the database will serialize all requests. That is how sqlite works. On Feb 24, 9:41 pm, mdipierro mdipie...@cs.depaul.edu wrote: P.S. if you use sqlite, the database will serialize all requests. That is how sqlite works. On Feb 24, 9:24 pm, mdipierro

[web2py] Re: {{=form.custom.begin}} - How set an ID to form

2010-02-24 Thread DenesL
The id is only one case. You would have to recreate the whole thing to be sure everything is updated but that makes it slower. Ideally you would do these things at form creation or by setting defaults beforehand ala field defaults. Doing it at form creation means allowing **attributes in any

Re: [web2py] Re: Unit testing in web2py : Some thoughts

2010-02-24 Thread Thadeus Burgess
The unit test already has access to web2py environment (and db or anything else in your models). ``exec_environment`` just recreates a blank environment, when executing your controller it executes it outside of the current global scope. Instead of running exec_environment on your controller, run

Re: [web2py] Re: {{=form.custom.begin}} - How set an ID to form

2010-02-24 Thread Thadeus Burgess
And hence the inherent flaw in SQLFORM :) Though I can't complain since I have not devoted time to redesigning the system as I so very much would like to do. -Thadeus On Wed, Feb 24, 2010 at 9:48 PM, DenesL denes1...@yahoo.ca wrote: The id is only one case. You would have to recreate the

Re: [web2py] Re: {{=form.custom.begin}} - How set an ID to form

2010-02-24 Thread Thadeus Burgess
and for the record SQLFORM freaking rocks. It just needs to be redesigned with customization in mind. -Thadeus On Wed, Feb 24, 2010 at 9:55 PM, Thadeus Burgess thade...@thadeusb.com wrote: And hence the inherent flaw in SQLFORM :) Though I can't complain since I have not devoted time to

[web2py] Re: Multiple ajax requests

2010-02-24 Thread mr.freeze
I have completely removed DAL, Auth and Crud and set session.forget in the model and each controller function but it still doesn't work. Is the dev server CherryPy 3? On Feb 24, 9:44 pm, mdipierro mdipie...@cs.depaul.edu wrote: P.S. if you use sqlite, the database will serialize all requests.

[web2py] Re: Multiple ajax requests

2010-02-24 Thread mr.freeze
I switched to another dev machine and it's working now. Disregard and thanks. On Feb 24, 9:59 pm, mr.freeze nat...@freezable.com wrote: I have completely removed DAL, Auth and Crud and set session.forget in the model and each controller function but it still doesn't work.  Is the dev server

[web2py] Re: {{=form.custom.begin}} - How set an ID to form

2010-02-24 Thread DenesL
What do you mean? SQLFORM is a FORM so you can pass **attributes. form=SQLFORM(db.person,_id='myid') On Feb 24, 10:56 pm, Thadeus Burgess thade...@thadeusb.com wrote: and for the record SQLFORM freaking rocks. It just needs to be redesigned with customization in mind. -Thadeus On Wed, Feb

[web2py] Re: web2py with Cherokee via uWSGI: a simple, easy guide

2010-02-24 Thread GrayMatterComputing
@Thadeus For me, it was a breeze to switch from Apache to Cherokee. I was happy with Apache too, but I used the fact that a client wanted Cherokee as an opportunity to give it a try, and I am glad I did :) Besides, it is not like you would have to remove Apache to use Cherokee, so what are you