[web2py:31367] Re: Multiple buttons in one form

2009-09-19 Thread weheh
Curious. I originally tested my method on IE7 and it works OK. Nevertheless, Iceberg is right in that the button tag isn't consistent across browsers. w3cschools.com says """ Always specify the type attribute for the button. The default type for Internet Explorer is "button", while in other browse

[web2py:31366] Re: Recommended Web Hosting...

2009-09-19 Thread Yarko Tymciurak
...and some of us use webfaction, and are happy with it... On Sat, Sep 19, 2009 at 9:30 PM, weheh wrote: > > Have you checked out GAE? I can't vouch for the secure part, pero me > parece que gratis es bastante barato. :^) > > On Sep 19, 10:18 am, pepe_eloy wrote: > > Hi! > > > > Mi name is Jose

[web2py:31365] Re: Client tools for web2py

2009-09-19 Thread mdipierro
very good work! Let us know when you consider it stable. On Sep 19, 1:14 pm, "mr.freeze" wrote: > Hi folks, > >     I just wanted to share a module that I'm working on for a > project.  It contains tools for managing client events and resources > from the server.  Here are the main features: > >

[web2py:31364] Re: autodelete=True

2009-09-19 Thread mdipierro
oops! Will fix this. On Sep 19, 6:14 pm, weheh wrote: > The autodelete=True feature doesn't seem to work with the new > capabilities of db.table.field.uploadfolder=/somepath/somwhere. > Anybody else have trouble with this? --~--~-~--~~~---~--~~ You received this m

[web2py:31363] Re: GAE Uploading data.

2009-09-19 Thread Robin B
I have not tried the appadmin on GAE, but I wonder if it uses count and or offset which will not work beyond 1000 records. You have to roll your own pagination on GAE by giving each field a unique composite sorted value or the ID, and then pass a next=key url query string parameter that points to

[web2py:31362] Re: Multiple buttons in one form

2009-09-19 Thread Iceberg
On Sep20, 11:57am, weheh wrote: > OK, here's a way to do it: > > {{=form.custom.begin}} > name="process">Process > > {{=form.custom.submit}} > {{=form.custom.end}} > > Then, when you press the process button, the request.vars.process will > not be None. Interesting. But is this trick universa

[web2py:/] Re: Multiple buttons in one form

2009-09-19 Thread weheh
OK, here's a way to do it: {{=form.custom.begin}} Process {{=form.custom.submit}} {{=form.custom.end}} Then, when you press the process button, the request.vars.process will not be None. --~--~-~--~~~---~--~~ You received this message because you are subscribed t

[web2py:31360] Re: Client tools for web2py

2009-09-19 Thread mr.freeze
The PageManager class renders all of the javascript necessary for the callbacks and resource inclusions. It doesn't render any html. On Sep 19, 9:37 pm, Thadeus Burgess wrote: > So is the page class acting like a template renderer? > > -Thadeus > > On Sat, Sep 19, 2009 at 9:28 PM, mr.freeze wr

[web2py:31359] Re: Multiple buttons in one form

2009-09-19 Thread weheh
This thread might also be useful to you: http://groups.google.com/group/web2py/browse_thread/thread/c20e1b4d824ce800/ace5d00c95d8cf93?lnk=gst&q=form%5B0%5D%5B-1%5D%5B1%5D.append#ace5d00c95d8cf93 --~--~-~--~~~---~--~~ You received this message because you are subscri

[web2py:31358] Re: Multiple buttons in one form

2009-09-19 Thread weheh
Hmmm... tricky. My first inclination was to say, check the request.vars to see if you can tease out which button was pressed. But I looked in winpdb, myself, and I couldn't see any indication in any of the variables as to which button was pressed (which isn't to say that it's not there ... just th

[web2py:31357] Re: need to create my own upload field

2009-09-19 Thread weheh
The plot thickens. On further inspection and experimentation, it looks like the file name must have the table name and the field name encoded in it. So: xyz.txt as a filename will fail to download. But, table1.filename.xyz.txt will work. --~--~-~--~~~---~--

[web2py:31356] Re: GAE Uploading data.

2009-09-19 Thread Chris S
I was trying to move a MySQL based app to the GAE. The MySQL was built by inserting values into the SQL table with a python script, so it made since (to me) to do the same on the GAE. I'm guessing the easiest way to avoid this would have been to download a CSV of my data and use the appadmin to

[web2py:31355] Multiple buttons in one form

2009-09-19 Thread Maurice Ling
Hi everyone May I know how to process multiple buttons on a form? For example, I have 2 buttons (process and save). How should I write the form.accept(request.vars, session) part to differentiate the actions of the 2 buttons? form = FORM(TABLE(TR('Sequence (raw format): ',

[web2py:31354] Re: Client tools for web2py

2009-09-19 Thread Thadeus Burgess
So is the page class acting like a template renderer? -Thadeus On Sat, Sep 19, 2009 at 9:28 PM, mr.freeze wrote: > > The EventManager class requires an instance of the PageManager class. > Idea being, as I add classes to the module, everything will get > rendered through the page manager. >

[web2py:31353] Re: Recommended Web Hosting...

2009-09-19 Thread weheh
Have you checked out GAE? I can't vouch for the secure part, pero me parece que gratis es bastante barato. :^) On Sep 19, 10:18 am, pepe_eloy wrote: > Hi! > > Mi name is Jose Eloy Torres, from Mexico. I've downloaded the web2py > framework (and I bought the book @lulu.com) and it seems a great >

[web2py:31351] Re: need to create my own upload field

2009-09-19 Thread weheh
Relevancy to this thread? On Sep 19, 7:59 pm, Yarko Tymciurak wrote: > btw - I am currently having trouble w/ the "sneaky" wsgi... > > > > On Sat, Sep 19, 2009 at 6:58 PM, Yarko Tymciurak wrote: > > why don't you just set a breakpoint and figure it out? > > > On Sat, Sep 19, 2009 at 6:48 PM, we

[web2py:31352] Re: Client tools for web2py

2009-09-19 Thread mr.freeze
The EventManager class requires an instance of the PageManager class. Idea being, as I add classes to the module, everything will get rendered through the page manager. On Sep 19, 8:45 pm, Thadeus Burgess wrote: > Do you have to use the page object, or could you just make it use the event > obje

[web2py:31350] Re: need to create my own upload field

2009-09-19 Thread weheh
I'm working on it ... On Sep 19, 7:58 pm, Yarko Tymciurak wrote: > why don't you just set a breakpoint and figure it out? > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this g

[web2py:31349] Re: Client tools for web2py

2009-09-19 Thread Thadeus Burgess
Do you have to use the page object, or could you just make it use the event object. Meaning I just want a simple event.listen("click", div, call_func) without any of the other jazz. -Thadeus On Sat, Sep 19, 2009 at 1:14 PM, mr.freeze wrote: > > Hi folks, > >I just wanted to share a modu

[web2py:31348] Re: Recommended Web Hosting...

2009-09-19 Thread Thadeus Burgess
Also, if you want an example of web2py running on dreamhost, head over to http://surrenderthebooty.thadeusb.com/ It is a aggregator for gaiaonline.com's mini game named booty grab. It uses web2py auth, external cron, mailer, custom forms, and apache is serving static files. sqlite3 backend for s

[web2py:31347] Re: Recommended Web Hosting...

2009-09-19 Thread Thadeus Burgess
I have been using Dreamhost for the past two years, and I have never had a problem with them. They just upgraded apache with passenger_wsgi, so python aps using wsgi (web2py) run fast! You get unlimited web space and unlimited bandwidth, plus shell access... it really is the most you will get out

[web2py:31346] Re: Is there something wrong with routes.py?

2009-09-19 Thread Jon Romero
ok, last post! You can just kill the processes (it's 4 in the morning here in Athens, so please excuse me), so routes.py will be read again. On Sep 20, 4:04 am, Jon Romero wrote: > I have renamed the example of routes to routes.py (and I even created > a new file from scratch, just in case) but

[web2py:31345] Re: Is there something wrong with routes.py?

2009-09-19 Thread Jon Romero
Ok, nevermind. I've just remember that you must restart the server in order for routes to be read again. But what happens on a shared hosting account, where you have no access to apache? On Sep 20, 4:04 am, Jon Romero wrote: > I have renamed the example of routes to routes.py (and I even created

[web2py:31344] Is there something wrong with routes.py?

2009-09-19 Thread Jon Romero
I have renamed the example of routes to routes.py (and I even created a new file from scratch, just in case) but I don't think it is executed. My routes_in is: routes_in = ( ('/', '/applicationname/stats/old'), ) I wanted to map this: www.myapplication -> www.myapplication/applicationname/st

[web2py:31343] Re: GAE Uploading data.

2009-09-19 Thread Robin B
On Sep 19, 6:13 pm, Chris S wrote: > From what I've read enabling billing doesn't increase the CPU time > just some of the other quotas.  It's CPU time that gets eaten up so > badly when you remove/add items to the datastore and I'm not keen on > paying for extra CPU time until I at least have

[web2py:31342] Re: need to create my own upload field

2009-09-19 Thread Yarko Tymciurak
btw - I am currently having trouble w/ the "sneaky" wsgi... On Sat, Sep 19, 2009 at 6:58 PM, Yarko Tymciurak wrote: > why don't you just set a breakpoint and figure it out? > > > On Sat, Sep 19, 2009 at 6:48 PM, weheh wrote: > >> >> Hi Yarko, thanks for the response. >> >> I may already have th

[web2py:31341] Re: need to create my own upload field

2009-09-19 Thread Yarko Tymciurak
why don't you just set a breakpoint and figure it out? On Sat, Sep 19, 2009 at 6:48 PM, weheh wrote: > > Hi Yarko, thanks for the response. > > I may already have this section memorized, by now from having read it > around 10 times ;^) But this is not the answer I'm looking for. > Let me exp

[web2py:31340] Re: need to create my own upload field

2009-09-19 Thread weheh
Hi Yarko, thanks for the response. I may already have this section memorized, by now from having read it around 10 times ;^) But this is not the answer I'm looking for. Let me explain... # db: db.define_table('table1',Field('filename','upload')) # view form=SQLFORM.factory(Field('text_in','

[web2py:/] Re: need to create my own upload field

2009-09-19 Thread Yarko Tymciurak
check form.vars['filename_newfilename']; see the section "SQLFORM and uploads" in the manual (~ p.195) On Sat, Sep 19, 2009 at 6:13 PM, weheh wrote: > > I want to enable upload of a long string via a text field, that I will > then save as a file and store in the same place as uploaded files. I

[web2py:31338] Re: Form Key

2009-09-19 Thread weheh
Winston: form.custom is one way to do this. That's the method I use and it works. However, I believe you can still do it your way. If you want your controller to be able to process the form, which I think is a good assumption, then you must have an equivalent myform=FORM(...) statement in your c

[web2py:31337] autodelete=True

2009-09-19 Thread weheh
The autodelete=True feature doesn't seem to work with the new capabilities of db.table.field.uploadfolder=/somepath/somwhere. Anybody else have trouble with this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2p

[web2py:31336] Re: GAE Uploading data.

2009-09-19 Thread Chris S
>From what I've read enabling billing doesn't increase the CPU time just some of the other quotas. It's CPU time that gets eaten up so badly when you remove/add items to the datastore and I'm not keen on paying for extra CPU time until I at least have some sort of working app to expand on. As fa

[web2py:31335] need to create my own upload field

2009-09-19 Thread weheh
I want to enable upload of a long string via a text field, that I will then save as a file and store in the same place as uploaded files. I generate the filename automatically, ensuring it's unique. I save the filename into the db.table.filename, where filename is Field ('filename','upload'). This

[web2py:31334] Re: GAE Uploading data.

2009-09-19 Thread Robin B
> Looking over two tables here are the things I've identified as > possible problems: > 1 - This table has a 'double' in it. Not just int/string like the > working one. For GAE uploading I defined the double field as a GAE > "float" property. Is it possible web2py defines a 'double' as > someth

[web2py:31333] GAE Uploading data.

2009-09-19 Thread Chris S
Background: Working with an app on GAE currently I've run across a slight issue with uploading data into my app. I initially tried to download my tables to CSV from my development machine then use simply re-upload them into GAE. It's been a while since I tried that but it was timing out. Proble

[web2py:31332] Re: [web2py:/] crud.create(db...,next="...[id]") error

2009-09-19 Thread Yarko Tymciurak
On Sat, Sep 19, 2009 at 1:46 PM, szimszon wrote: > > Hi All! > > I wonder if somebody could help me. > > I have: > > form=crud.create(db.oklevel_sablon,next=URL > (r=request,f='sablonsor_jog',args="[id]")) > > But the next url looks: > .../sablonsor_jog/%5Bid%5D > > The "[id]" isn't replaced with

[web2py:/] crud.create(db...,next="...[id]") error

2009-09-19 Thread szimszon
Hi All! I wonder if somebody could help me. I have: form=crud.create(db.oklevel_sablon,next=URL (r=request,f='sablonsor_jog',args="[id]")) But the next url looks: .../sablonsor_jog/%5Bid%5D The "[id]" isn't replaced with the created record's number :( I read in the book page 217: "• next

[web2py:31330] Re: saving uploads in a place other than applications/myapp/uploads

2009-09-19 Thread weheh
Massimo, I tested it on the latest release and it works. - Richard --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from

[web2py:31329] Re: Field(...,uploadfolder="...")

2009-09-19 Thread weheh
Fran is correct. The place to specify the uploadfolder is in the controller (when uploading) and the download function (for downloading). I just tested out the functionality and it works as advertised, enabling every user to have his/her own upload folder. On Sep 19, 4:33 am, Fran wrote: > On Se

[web2py:31328] Re: gae: gluon undefined

2009-09-19 Thread Robin B
Look in gaehandler.py: if os.environ.get('SERVER_SOFTWARE', '').startswith('Devel'): (settings.web2py_runtime, settings.web2py_runtime_gae, debug) = \ ('gae:development', True, True) else: (settings.web2py_runtime, settings.web2py_runtime_gae, debug) = \ ('gae:production',

[web2py:31327] Client tools for web2py

2009-09-19 Thread mr.freeze
Hi folks, I just wanted to share a module that I'm working on for a project. It contains tools for managing client events and resources from the server. Here are the main features: 1) Dynamic inclusion and downloading of resources (scripts/css). 2) Server side event handling for client sid

[web2py:31326] Re: How mature is DAL's GAE support

2009-09-19 Thread Robin B
The GAE DAL does not try to handle the 1000 fetch limit. GAE apps must be designed differently, meaning if you need more than 1000 results from a query, then probably what you were attempting to do is not scalable. Queries are O(#results), so you should keep your queries small to make your reque

[web2py:31325] Re: Form Key

2009-09-19 Thread DenesL
Hi eddwinston, it all depends on what you are working with, more detail is required. If your form is based on a table the easiest way to go is to use SQLFORM, which does NOT mean that you have to display it as generated (you can use what Yarko or Iceberg suggest). And the validation is a snap.

[web2py:31324] Recommended Web Hosting...

2009-09-19 Thread pepe_eloy
Hi! Mi name is Jose Eloy Torres, from Mexico. I've downloaded the web2py framework (and I bought the book @lulu.com) and it seems a great product! I'm interesting in create applications using Web2py and offer they to customers, but I'd like have the freedom to configure the web server and instal

[web2py:31323] Re: for row in rows

2009-09-19 Thread DenesL
Hi Annet, I will give you an example using db.person since I don't know which fields you want displayed. rr=db().select(db.person.ALL) # or whatever selection rr.hooks=False # only the data maxk=min(24,len(rr)) # 6 rows with id and name fields r1=[TR(rr[k].id,rr[k].name) for k in range(0,min(6,m

[web2py:31322] Re: for row in rows

2009-09-19 Thread jeff
Hello, I'm new to this group and to web2py and even to web development but not completely to Python and thus this suggestion (that could be completely wrong): (and BTW, I would like to use this first post to thank a lot Massimo Di Pierro for his fantastic work !!! ) On 19 sep, 09:27, annet wro

[web2py:31321] Re: remote_addr

2009-09-19 Thread suiato
Thanks for commenting, Massimo. On 9月19日, 午後5:40, mdipierro wrote: > You are taking risks. People can steal your session cookie, access > appadmin and from there run any python code using the query string. oops, pretty scary. > > You should not comment those lines but go over https. Actually,

[web2py:31320] Re: I'd like to see people add their web2py developed sites to an area of "www.web2py.com"?

2009-09-19 Thread hcvst
An "Add to directroy" link next to EDIT etc. in the admin might be nice. Generally I think it would be great if w2p instances were more aware of other w2p instances (obviously only if the admin wants that), such that one could look for a thumbnail, webshot, payment, ... services offered by other i

[web2py:31319] Re: gae: gluon undefined

2009-09-19 Thread notcourage
Is there a variable which distinguishes dev & production for gae? It would simplify deployment. On Sep 18, 3:46 pm, Robin B wrote: > To send mail locally, you need to specify the mail server to be used: > > http://code.google.com/appengine/docs/python/tools/devserver.html#Usi... > > Robin > > On

[web2py:/] How mature is DAL's GAE support

2009-09-19 Thread hcvst
Hi, I am planning to deploy to GAE and should hopefully see quite a few users eventually. Does DAL's GAE support scale well? Will I run into the 1000 fetch() limit or is that handled under the hood for example? Should one rather handcraft the Datastore interface with let's say 1000 concurrent use

[web2py:31315] Re: Form Key

2009-09-19 Thread Iceberg
Yes, customizing the SQLFORM or FORM is the correct way. See also this. http://www.web2py.com/AlterEgo/default/show/205 On Sep19, 5:15pm, Yarko Tymciurak wrote: > form.custom  (see p. 219 in the manual, for example) > > > > On Sat, Sep 19, 2009 at 4:10 AM, eddwinston wrote: > > > Hi Iceberg,

[web2py:31317] Re: for row in rows

2009-09-19 Thread Jason Brower
It should work. What did it output instead? Regards, Jason On Sat, 2009-09-19 at 01:35 -0700, annet wrote: > Unfortunately it did not work. Every 'not so detailed item' gets its > own table instead of a table row. > > The latest function reads like: > > def latest(): > response.functionnam

[web2py:31316] Re: for row in rows

2009-09-19 Thread Jason Brower
Your right, I just can't help it! :P On Sat, 2009-09-19 at 01:32 -0700, Iceberg wrote: > The first 3 lines of your code snippet can be changed into: > > {{for count, item in enumerate(news):}} > > That is more pythonic. Using counter variable is the bad taste from C > era. > > On Sep19, 3:

[web2py:31314] Re: Form Key

2009-09-19 Thread Yarko Tymciurak
form.custom (see p. 219 in the manual, for example) On Sat, Sep 19, 2009 at 4:10 AM, eddwinston wrote: > > Hi Iceberg, > > I want to do it from the view becuase I actually want to control the > markup by myself. SQLFORM will ouput the form in a table. What about > if I want to do it in a way ot

[web2py:31313] Re: Form Key

2009-09-19 Thread eddwinston
Hi Iceberg, I want to do it from the view becuase I actually want to control the markup by myself. SQLFORM will ouput the form in a table. What about if I want to do it in a way other than table. I just want to have control over the form Winston On Sep 19, 10:02 am, Iceberg wrote: > But why bo

[web2py:31312] Re: Where is sneaky webserver?

2009-09-19 Thread Iceberg
Hi Massimo, to upset you again, the latest svn trunk (with the "better" version already?) results in: File "C:\DOWNLOAD\web2py-trunk\gluon\sneaky.py", line 269, in build_environ envione[key]=value NameError: global name 'envione' is not defined On Sep19, 4:23pm, mdipierro wrote: > Here is

[web2py:31311] Re: remote_addr

2009-09-19 Thread mdipierro
You are taking risks. People can steal your session cookie, access appadmin and from there run any python code using the query string. You should not comment those lines but go over https. Massimo On Sep 18, 11:46 pm, suiato wrote: > thanks to the instructions on the book and the example > web

[web2py:31310] Re: for row in rows

2009-09-19 Thread annet
Unfortunately it did not work. Every 'not so detailed item' gets its own table instead of a table row. The latest function reads like: def latest(): response.functionname='Laatste nieuws' response.image=URL(r=request,c='static',f='init/media/ utilities_1.jpg') latest=db((db.nieuws.be

[web2py:31309] Re: Field(...,uploadfolder="...")

2009-09-19 Thread Fran
On Sep 19, 8:14 am, annet wrote: > Does Field(...,uploadfolder="...") make it possible to let every user > have his own upload folder by assigning a variable to uploadfolder > like: in the table definition in my model: Field > (...,uploadfolder=variable) and in the controller: variable="myfolder"

[web2py:31308] Re: for row in rows

2009-09-19 Thread Iceberg
The first 3 lines of your code snippet can be changed into: {{for count, item in enumerate(news):}} That is more pythonic. Using counter variable is the bad taste from C era. On Sep19, 3:32pm, Jason Brower wrote: > Hmm... > Is this what you where thinking? > > On Sat, 2009-09-19 at 00:27 -0

[web2py:31307] Re: Where is sneaky webserver?

2009-09-19 Thread mdipierro
Here is a better version: http://web2py.com/examples/static/sneaky.py and woila' a Python 3.0 version: http://web2py.com/examples/static/sneaky3.py Massimo On Sep 19, 2:06 am, Iceberg wrote: > Mmm, perhaps Massimo forgot to introduce it in SVN. It is just not > there. But fine, I ca

[web2py:31306] Re: Interesting issue: need to call a method from a value in a table.

2009-09-19 Thread Iceberg
In python, it is easy. >>> def foobar(): print 'hello world' ... >>> exec('foobar'+'()') hello world >>> However, the exec() might be considered dangerous if you are not sure what function name string would be inside DB. So if I were you, I would still use a translation system, but a more elegan

[web2py:31305] Re: for row in rows

2009-09-19 Thread annet
Jason, I'll give it a try, if it works, it's exactly what I was looking for. Kind regards, Annet. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@g

[web2py:31304] Filtering users by role

2009-09-19 Thread Dutch opera
Hi, I have a standard role and user setup. Lets have a have 1000 user id's. And I have three roles 1) client 2) admin1 and 3) admin 2. Admin 1 can have access to 1-500 if the id's and role two can have access for id's of 501-1000. What is the best way to this? Do I need to create a lookup tab

[web2py:31303] Re: for row in rows

2009-09-19 Thread Jason Brower
Hmm... Is this what you where thinking? On Sat, 2009-09-19 at 00:27 -0700, annet wrote: > I have a table which contains news items. In the view I would like to > display the first 6 items in full and limit the display of the next 18 > items to their title. So something like: > {{count = 0}} > {

[web2py:31302] for row in rows

2009-09-19 Thread annet
I have a table which contains news items. In the view I would like to display the first 6 items in full and limit the display of the next 18 items to their title. So something like: {{for item in news:}} {{=db.nieuws.publicatie_datum.formatter(item.publicatie_datum)}} {{=item.titel}} {{if

[web2py:31301] Interesting issue: need to call a method from a value in a table.

2009-09-19 Thread Jason Brower
I think I have reached the limit of my python knowledge and need help. I have a table that holds "solutions" and the "issues" they solve. To find out what solutions is viable in difference cases I need to do a complicated set of checks. I have placed these checks in a set of methods. Is there a w

[web2py:31300] Field(...,uploadfolder="...")

2009-09-19 Thread annet
Does Field(...,uploadfolder="...") make it possible to let every user have his own upload folder by assigning a variable to uploadfolder like: in the table definition in my model: Field (...,uploadfolder=variable) and in the controller: variable="myfolder" Kind regards, Annet. --~--~-~--

[web2py:31299] Re: Where is sneaky webserver?

2009-09-19 Thread Iceberg
Mmm, perhaps Massimo forgot to introduce it in SVN. It is just not there. But fine, I can wait. :-) http://code.google.com/p/web2py/source/detail?r=1232 http://code.google.com/p/web2py/source/browse/#svn/trunk/gluon On Sep19, 2:51pm, Yarko Tymciurak wrote: > It seems to be in the tree: > >

[web2py:31298] Re: Form Key

2009-09-19 Thread Iceberg
But why bother? web2py's SQLFORM in controller contains built-in server-side validation and other goodies. Besides it sets up correct form key for you, of course. And you can always customize the view to whatever you want to. So why insist to do things in opposite direction, which drown you in unn