[web2py] debugging : it's still not clear "How To"

2011-10-16 Thread Vineet
I searched through earlier posts reg. how to debug. But it's still not clear what's the best proc for debugging web2py apps (IDE can vary). I wish to debug throughpyscripter or komodo. This link by massimo is not active. http://groups.google.com/group/web2py/browse_thread/thread/42f9e2560fb93c1d/

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Miroslav Gojic
I tray to put mentioned examples into controller after my form definition form['_action'] = URL(index') form.update(_action=URL('index')) form.attributes.update(_action=URL('index')) but it is not happened anything, and if I change my value I just get error form.update(_action=my_value) - this m

[web2py] Debugging : 'FA'Q or 'How To' or 'standard procedure/instructions'

2011-10-16 Thread Vineet
I searched through earlier posts reg. how to debug. But it's still not clear what's the best proc for debugging web2py apps (IDE can vary). I wish to debug through pyscripter or komodo or winpdb. A link given by massimo in following discussion (very old) is not active. http://groups.google.com/gr

Re: [web2py] Debugging with uWSGI

2011-10-16 Thread Roberto De Ioris
> I want to get dubugging setup, and the main options I see are using > winpdb, pydev, or wingide. But all the examples I see are to debug the > web2py.py app when it is run and the debugger grabs the process. But I > am using the cherokee webserver with uWSGI, so how would U use it in > this way?

[web2py] Croatian translation (was Re: bg-bg.py (Bulgarian translation))

2011-10-16 Thread Gour
On Sat, 6 Aug 2011 10:11:17 -0700 (PDT) Massimo Di Pierro wrote: > create the translation file using admin and email it to me. I see it works for e.g. 'welcome' app. What about admin itself? I've tried with: touch hr-hr.py and then selecting hr-hr from the admin, but I notice that hr-hr.py is

[web2py] porting apps from win-noinstall to source code version

2011-10-16 Thread Vineet
I am running my apps using Windows noinstall version of web2py. For debugging using pyscripter, I need to port those apps to source code version. 1) Apart from the applications folder, what other files/folders do I need to copy & paste to the source code folder? 2) I have some 3rd party modules k

[web2py] Re: DAL level access to GAE entities by named key

2011-10-16 Thread Murray3
Christian, Itried this in the gae sdk development console and replaced args with a string as request not available and its just a quick test. I copied the dal.py from trunk and replaced into my copy of last stable release I get there traceback listed below #the code in dev console-- from g

[web2py] Re: serving a zip file

2011-10-16 Thread peter
I have now tried the downloady example remotely, on a linux server with niginx and uswgi. This streams the zip file correctly with both chrome and IE8. So the problem is there only when I use the rocket server on windows. I just tried the rocket server remotely, and streaming is correct. So I on

Re: [web2py] Croatian translation (was Re: bg-bg.py (Bulgarian translation))

2011-10-16 Thread Kenneth Lundström
> touch hr-hr.py and then selecting hr-hr from the admin, but I notice that hr-hr.py is significantly smaller (4473b vs. 14460b for it-it.py) than the rest of the files and hr-hr is missing some strings (e.g. 'web2py upgraded; please restart it'). Why is it so? Is there some FAW how to contribu

Re: [web2py] Re: criticism of web2py

2011-10-16 Thread Joseph Jude
As much as I like backward compatibility, I believe the (web2py) code will become unmanageable and bloated too. So at some point in time, it is better to overhaul and not provide backward compatibility.

[web2py] Re: Croatian translation

2011-10-16 Thread Gour
On Sun, 16 Oct 2011 15:00:34 +0300 Kenneth Lundström wrote: > The problem is that a string is added to the file first time the > application tries to find it in the file. So in your case you havn't > upgraded web2py when you have used hr-hr file. Hmmm... > So I guess instead of touching the h

Re: [web2py] Re: Croatian translation

2011-10-16 Thread Kenneth Lundström
> The point is that I cannot locate en-en.py file? Sincerely, Gour Hmmm, me neither. I thought there was always a en-en.py or en.py file but it seams I thought wrong. Kenneth

[web2py] Re: Custom Form Action empty

2011-10-16 Thread Massimo Di Pierro
form['_action'] = URL('index')  not form['_action'] = URL(index') On Oct 16, 2:23 am, Miroslav Gojic wrote: > I tray to put mentioned examples into controller after my form definition > > form['_action'] = URL(index') > form.update(_action=URL('index')) > form.attributes.update(_action=URL('ind

[web2py] Re: criticism of web2py

2011-10-16 Thread Massimo Di Pierro
So far this has not been issue. For example we added lots of features in the last year (scheduler, gird, smartgrid, new admin, new welcome layout, etc.) but the web2py size has not increased much and stayed very small, as you can see in this graph: http://www.ohloh.net/p/web2py Massimo On Oct 1

[web2py] Opera for editing files in web2py

2011-10-16 Thread Vineet
In IE & Mozilla FF, editing files works OK. In Opera, I can't save with "CTRL+S". It opens a "save file dialog box". Need to click on the save icon. OS: Win7 web2py version : all versions (latest & earlier), noinstall as well as source code versions Can it be fixed? ---Vineet

Re: [web2py] Re: criticism of web2py

2011-10-16 Thread Anthony
Note, backward compatibility applies to the documented API only -- we still have the freedom to change the underlying implementation. Lots of code has been refactored over the past year plus. On Sunday, October 16, 2011 8:13:27 AM UTC-4, Joseph Jude wrote: > > As much as I like backward compatib

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Anthony
On Sunday, October 16, 2011 3:23:01 AM UTC-4, miroslavgojic wrote: > > I tray to put mentioned examples into controller after my form definition > > form['_action'] = URL(index') > form.update(_action=URL('index')) > form.attributes.update(_action=URL('index')) > > but it is not happened anything,

[web2py] Re: porting apps from win-noinstall to source code version

2011-10-16 Thread Anthony
On Sunday, October 16, 2011 5:35:18 AM UTC-4, Vineet wrote: > > I am running my apps using Windows noinstall version of web2py. > For debugging using pyscripter, I need to port those apps to source > code version. > > 1) Apart from the applications folder, what other files/folders do I > need t

[web2py] Re: DAL level access to GAE entities by named key

2011-10-16 Thread howesc
is this the line that is failing: #this fails, unknown key exception entity_keyid = db.funtest[key] i meant to comment it out in my example since it fails.

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Anthony
Is your goal simply to make sure the user gets redirected to 'index' after submitting the form? If that's the case, then you don't have to set a custom form action at all. If you leave the form action empty, the form will be submitted back to the action that generated it (which is how web2py for

[web2py] Re: porting apps from win-noinstall to source code version

2011-10-16 Thread Vineet
I looked for these 3 files in the noinstall version folder. But there is not any file with these names. Matching filenames are: 1) routes.example.py 2) options_std.py Are you sure about the filenames? Because my noinstall version is working perfect, but there are no files indicated by you. V

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Miroslav Gojic
My errors in previews post: form['_action'] = URL(index') - my error - correct is> -> form['_action'] = URL('index') my_value - is mean -> URL('controller') #this can be controller or index or some value. >From last Anthony replay I figure out why it can't work from view but how to resolve this i

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Miroslav Gojic
My custom form work fine, After one day I work to make my HTML5 valid on end it only action in form make error. And after that I reed all what I can find but not helped me. And on my previews post I put my actual and next form definition in controller (people or index is not to much important wher

Re: [web2py] Re: db modeling question regarding DAL, SQLFORM and nested items

2011-10-16 Thread Erwin Pass
Hi, Thx for your answer! This way I could get rid of the KeyError I mentioned (caused by the db.self_referenced_table_name syntax) previously and everything seemed fine but I'm not satisfied by the rendering of such a model. My example: db.define_table('div', Field('name', type='string'),

[web2py] Re: porting apps from win-noinstall to source code version

2011-10-16 Thread Vineet
I looked for these 3 files in the /web2py folder. But there is no file with these names. Matching filenames are: 1) routes.example.py 2) options_std.py Are you sure about the filenames? Because my noinstall version is working perfect, but there are no files indicated by you. Vineet On Oct 1

[web2py] Re: porting apps from win-noinstall to source code version

2011-10-16 Thread Anthony
Right, you only need to copy those files if you're using them. If you don't have those files, then you're not using them, so don't worry about it. On Sunday, October 16, 2011 1:03:19 PM UTC-4, Vineet wrote: > > I looked for these 3 files in the /web2py folder. > But there is no file with these n

Re: [web2py] Re: db modeling question regarding DAL, SQLFORM and nested items

2011-10-16 Thread Erwin Pass
Hi, Thx! Wow, thats a pretty awesome feature! :) But if I understand you correctly then this "doesn't work" for self references. I mean "doesn't work" as "in the same way as for foreign list references". Whereas in the latter case a big multiselect box gets displayed, only a usual input field (fo

[web2py] request.vars is not working anymore?

2011-10-16 Thread Tito Garrido
Hi Folks, Am I getting crazy or request.vars doesn't work anymore? I'm trying to get all vars from a form but it says AttributeError: 'function' object has no attribute 'vars' Anything changed? Regards, Tito -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Anthony
I see the problem -- setting the '_action' attribute after the form is created doesn't affect form.custom.begin, which is what you are using. Instead, try this in the view: {{=form.custom.begin.replace('action=""', 'action="%s"' % URL()}} URL() should generate the URL of the current action (tho

[web2py] Re: request.vars is not working anymore?

2011-10-16 Thread Anthony
Did you accidentally assign a function to the 'request' variable (or define a function called 'request')? Maybe show some code. On Sunday, October 16, 2011 1:31:37 PM UTC-4, Tito Garrido wrote: > > Hi Folks, > > Am I getting crazy or request.vars doesn't work anymore? I'm trying to get > all var

Re: [web2py] Re: request.vars is not working anymore?

2011-10-16 Thread Tito Garrido
Yes! That means that I am getting crazy :-) So there is no way to have a funtion called request and use request.vars, right? I'm working on a legacy system that has this function... Thanks! On Sun, Oct 16, 2011 at 3:50 PM, Anthony wrote: > Did you accidentally assign a function to the 'request

Re: [web2py] Re: request.vars is not working anymore?

2011-10-16 Thread Anthony
On Sunday, October 16, 2011 2:00:54 PM UTC-4, Tito Garrido wrote: > > Yes! That means that I am getting crazy :-) > > So there is no way to have a funtion called request and use request.vars, > right? I'm working on a legacy system that has this function... It's not just request.vars that you'd

Re: [web2py] Re: request.vars is not working anymore?

2011-10-16 Thread Bruno Rocha
you can also do: from mymodule import request as legacy_request

[web2py] Threads operating on database causing a crash

2011-10-16 Thread Harshad
class Worker(threading.Thread): def run(self): print self.name, "running..." while True: if db(db.temperature).isempty(): print "empty" else: print "not empty" time.sleep(1) Running the above code causes the ap

Re: [web2py] Re: criticism of web2py

2011-10-16 Thread pbreit
Massimo has said that at some point he wants to work on something for Python 3 that may borrow some concepts from Web2py but will be different to take advantage of Python 3 and the many years of learning from Web2py. But it's unlikely that he is going to spend energy on "porting Web2py to Python

[web2py] Re: Threads operating on database causing a crash

2011-10-16 Thread Massimo Di Pierro
You should not start threads within actions because they are already running into threads created by the web sever. The web server monitors the threads and kills them on timeout. Moreover you are used the db object in the thread. That is not thread safe. Every thread should have its own db connec

[web2py] Re: Threads operating on database causing a crash

2011-10-16 Thread Massimo Di Pierro
P.S. What are you trying to accomplish? Web2py has a scheduler which takes care of running background tasks in parallel. Massimo On Oct 16, 3:38 pm, Massimo Di Pierro wrote: > You should not start threads within actions because they are already > running into threads created by the web sever. Th

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Miroslav Gojic
With empty action field I mean: and this is not empty action field I used this line in my view: {{=form.custom.begin.replace('action=""', 'action="%s"' % URL('index'))}} and output in source is:
and in browser I g

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Miroslav Gojic
And about validation on suggested link it is writhed under point 9 (section 4.10.22.3) *If action is the empty string, let action be the document's address of the form document.* - - Miroslav Gojic - - On Sun, Oct 16, 2011 at 19:41, Anthony wrote: > I see the problem -- setting the '_action'

[web2py] Re: Threads operating on database causing a crash

2011-10-16 Thread Harshad
The design is discussed here: https://groups.google.com/forum/#!topic/web2py/R8N2CRP-ifY I was hoping to get some feedback on that but never got any :(

[web2py] Re: DAL level access to GAE entities by named key

2011-10-16 Thread Murray3
yeh..sorry, i worked that out after I sent post. thanks for this again. On Oct 16, 4:58 pm, howesc wrote: > is this the line that is failing: > >     #this fails, unknown key exception >     entity_keyid = db.funtest[key] > > i meant to comment it out in my example since it fails.

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Miroslav Gojic
After some time and several trays I get solution in view for custom form I used {{=XML(form.custom.begin.replace('action=""', 'action="people"'))}} and it produce code in source: and my form now work and I have not empty action field Thanks everybody for help - - Miroslav Gojic - - On Sun,

[web2py] Re: Custom Form Action empty

2011-10-16 Thread Massimo Di Pierro
you can simply use: instead of {{=XML(form.custom.begin.replace())}} On Oct 16, 5:05 pm, Miroslav Gojic wrote: > After some time and several trays I get solution > > in view for custom form I used > {{=XML(form.custom.begin.replace('action=""', 'action="people"'))}} > > and it produce c

[web2py] Menus and Selected Tab

2011-10-16 Thread horridohobbyist
I was just wondering... When you select a menu tab from the menu, it doesn't get highlighted. Highlighting the current menu tab is expected behavior for every menu system I've ever seen on the web. What am I missing here? Is there an option I need to enable? Thanks, Richard

[web2py] Re: metraschedule metra.pickle file

2011-10-16 Thread Christopher Steel
You can generate a up to date metra.pickle file (and test functionality ) by running: ./metraschedule/modules/test_metra.py To run the app on recent versions of Web2py you need to comment out the db.executesql statements in db.py. C.

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Anthony
Now that I think about it, this is overkill. It's just a simple form tag (no custom web2py classes or attributes), so probably just as easy to hand code the HTML (which will also be more clear). On Sunday, October 16, 2011 6:05:41 PM UTC-4, miroslavgojic wrote: > > After some time and several tr

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Anthony
On Sunday, October 16, 2011 4:54:34 PM UTC-4, miroslavgojic wrote: > > And about validation > > on suggested link > > it is writhed under point 9 (section 4.10.22.3) > > *If action is the empty string, let action be the document's address of > the form document.* Yes, it's saying you can leave t

[web2py] Does auth.requires() always requires login?

2011-10-16 Thread Ray (a.k.a. Iceberg)
Hi there, Following code works in web2py 1.98.2. That is, to allow registered users, as well as the system administrator (who always access the system from localhost), to access data. @auth.requires(request.client=='127.0.0.1' or auth.is_logged_in()) def secret(): return {"": "some cool stuff

Re: [web2py] Does auth.requires() always requires login?

2011-10-16 Thread Bruno Rocha
Change teh behaviour with this: auth.settings.on_failed_authorization = lambda or function auth.settings.on_failed_authentication = lambda or function On Mon, Oct 17, 2011 at 2:23 AM, Ray (a.k.a. Iceberg) wrote: > Hi there, > > Following code works in web2py 1.98.2. That is, to allow registered

[web2py] Re: Does auth.requires() always requires login?

2011-10-16 Thread Ray (a.k.a. Iceberg)
Thanks for prompt response Bruno. But unfortunately your suggestion doesn't help in my case, system admin still can not access from localhost without login. Regards, Ray On Oct 17, 12:41 pm, Bruno Rocha wrote: > Change teh behaviour with this: > > auth.settings.on_failed_authorization = lambda o

[web2py] image uploading and storing in web2py

2011-10-16 Thread Saurabh S
Hi , i am developing an online booking system using web2py ...i have come across a requiremnt where i need to store the clients photo into the database(< 2MB)...how should i proceed with this...i mean what should be the field in databasehow i can populate a select image box so that user/admin

Re: [web2py] Does auth.requires() always requires login?

2011-10-16 Thread Bruno Rocha
I think it should be, because @auth means authentication, so needs authenticated user. In your case I should do differently. def secret(): if not request.client == '127.0.0.1' or not auth.user: redirect(URL('default', 'user', args='login')) return {"": "some cool stuff"}

Re: [web2py] Does auth.requires() always requires login?

2011-10-16 Thread Bruno Rocha
better def secret(): conditions = [request.client == '127.0.0.1', auth.user] if not any(conditions): redirect(URL('default', 'user', args='login')) return {"": "some cool stuff"}

[web2py] Unable to write to AppEngine DataStore using web2py's DAL

2011-10-16 Thread Sathvik Ponangi
http://stackoverflow.com/questions/7767808/unable-to-write-to-appengine-datastore-using-web2pys-dal/7768108#7768108 I've just started using web2py with Google AppEngine for an app of mine. For some reason, I'm unable to save/retrieve data using the DAL. Here's the code I'm using: At the end of

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Miroslav Gojic
On Mon, Oct 17, 2011 at 03:16, Anthony wrote: > On Sunday, October 16, 2011 4:54:34 PM UTC-4, miroslavgojic wrote: >> >> And about validation >> >> on suggested link >> >> it is writhed under point 9 (section 4.10.22.3) >> >> *If action is the empty string, let action be the document's address of

[web2py] Re: Does auth.requires() always requires login?

2011-10-16 Thread Ray (a.k.a. Iceberg)
Thanks for the workaround, I might take that. But I will still argue that: 1. Does authentication have to mean logged-in, or can it be something else, such as "accessing from localhost", "accessing via ajax", etc.? 2. if @auth already means authentication, why there is still an auth.requires_logi

Re: [web2py] Re: Custom Form Action empty

2011-10-16 Thread Miroslav Gojic
On Mon, Oct 17, 2011 at 03:11, Anthony wrote: > Now that I think about it, this is overkill. It's just a simple form tag > (no custom web2py classes or attributes), so probably just as easy to hand > code the HTML (which will also be more clear). @From Massimo: you can simply use: instead of

Re: [web2py] Unable to write to AppEngine DataStore using web2py's DAL

2011-10-16 Thread Bruno Rocha
On Mon, Oct 17, 2011 at 3:50 AM, Sathvik Ponangi wrote: > db.files[0] = dict(hash=name, name=name, path=name) may be you want to replace the above with: db.files.insert(hash=name, name=name, path=name) why are you assign it to db.files[0] ? when you do db.table[index] you fetching rows by id

Re: [web2py] Re: Does auth.requires() always requires login?

2011-10-16 Thread Bruno Rocha
> > 2. if @auth already means authentication, why there is still an > auth.requires_login() which implemented as > auth.requires(auth.is_logged_in())? Shouldn't this implementation > imply that auth.requires() does not check is_logged_in()? All in all, > what is auth.requires()'s semantics? Wait

[web2py] Re: migrate file system uploads to database?

2011-10-16 Thread Paul Gerrard
Hi, You beat me to it. I came up with almost exactly the same code myself over the weekend. Worked a treat. :O) Paul. On Oct 15, 2:35 am, Massimo Di Pierro wrote: > Say you have > > db.define_table('mytable',Field('file','upload')) > > step 1: add a blob > > db.define_table('mytable',Field('fil

Re: [web2py] image uploading and storing in web2py

2011-10-16 Thread Johann Spies
Search the book for 'image' and you will find a lot of references. Here is an quote from early in the book ( http://web2py.com/book/default/chapter/01?search=image): "Here are some examples of web2py statements that illustrate its power and simplicity. The following code: 1. db.define_table('p