[web2py] looping through fields & updating

2011-07-10 Thread mart
Hi, shouldn't something lik this work? or maybe i'm missing something for passing in a variable for a field name? id=db.local_user.insert(dateTime=datetime.now()) for key in localUserDict.keys(): for field in db.local_user.fields: if field==key: db(db

[web2py] Re: How to temporarily redirect all requests

2011-07-10 Thread Anthony
Are you saying you want to do this someplace other than in a model file? The model file will be the first place where you'll be able to introduce any application logic (prior to that it's just framework code getting executed). On Sunday, July 10, 2011 3:48:47 PM UTC-4, Luis Goncalves wrote: > m

[web2py] Re: How to temporarily redirect all requests

2011-07-10 Thread pbreit
Also note that you can put anthony's code in a controller outside a function and it will run every time tha controller is called.

[web2py] Re: Helpers (general question and call for sticky)

2011-07-10 Thread pbreit
Pretty much the only helper I use in views is URL(). But I use helpers more extensively in controllers.

[web2py] Re: Helpers (general question and call for sticky)

2011-07-10 Thread Anthony
I think it's mostly a matter of personal preference, but some people prefer to use native HTML when it's in a view and the web2py helpers when it's in a controller (or model). The helpers are also useful any time you need to do any server side DOM parsing and manipulation (see http://www.web2py

[web2py] Re: OffTopic Google+

2011-07-10 Thread pang
Do you think it will eventually become federated with a server we can install like they did with google wave, or will it only run on their servers?

[web2py] Re: How to temporarily redirect all requests

2011-07-10 Thread Luis Goncalves
Awesome!!! Thanks!!! I will try it out!!! Luis.

[web2py] Helpers (general question and call for sticky)

2011-07-10 Thread (m)
Newbie to Web programmer here. Please be gentle. I am trying to get my head around HTML helpers and see that they have been discussed so much and so often in this group that (1) I can't find what I'm looking for and (2) I am thinking there ought to be a sticky someplace that talks about their prop

Re: [web2py] Re: How to temporarily redirect all requests

2011-07-10 Thread Jonathan Lundell
On Jul 10, 2011, at 12:48 PM, Luis Goncalves wrote: > more thoughts: > > could I do something like: > define a shared global variable session.version > = -1 initially, signifying no choice made > ? use a callback that gets executed before the controller that responds to > the request > if sessi

[web2py] Re: How to temporarily redirect all requests

2011-07-10 Thread Luis Goncalves
more thoughts: could I do something like: - define a shared global variable session.version - = -1 initially, signifying no choice made - ? use a callback that gets executed *before *the controller that responds to the request - if session.version >-1: let the resp

[web2py] Re: How to temporarily redirect all requests

2011-07-10 Thread Anthony
You could do the check in a model file -- all (non-conditional) model files are executed on every request (before the requested controller action). E.g.: if not (session.version_selected or request.function=='version_selection_page'): redirect(URL('default','version_selection_page') An

[web2py] Re: login problem

2011-07-10 Thread Anthony
Hmm, I tried the code you provided below (with ajax=True as well as with ajax=False/ajax_trap=True), and it worked fine for me (though I did have to set auth.settings.login_next=URL('default','login2') -- otherwise, the component redirects to the index page, which displays the entire index page

[web2py] How to temporarily redirect all requests

2011-07-10 Thread Luis Goncalves
Hello Everyone! Is there a simple/efficient/secure way to temporarily redirect all requests to a specific page? (all requests except for those that define a few actions that are permitted at that point in time) The context: - When user logs in, he needs to choose the version of the website

[web2py] Re: auth with OpenID - auth.environment.URL(...) error

2011-07-10 Thread Anthony
No problem. Glad it worked. Thanks for submitting the patch. Anthony On Sunday, July 10, 2011 1:26:06 PM UTC-4, Brian M wrote: > Bingo - I'll start an issue over in google code & submit the patch. Thanks > Anthony!

Re: [web2py] Re: Linking directly to an uploaded image

2011-07-10 Thread pbreit
Does the download() function handle the file paths properly? def download(): """ allows downloading of uploaded files http:///[app]/default/download/[filename] """ return response.download(request,db)

[web2py] Re: Google app engine and DAL

2011-07-10 Thread Shark
Thanks howesc for your help On Jul 10, 6:36 pm, howesc wrote: > Shark, > > the upload field will work (though you might have to pass the flag to tell > it to store the file in the DB).  it's been a while since i have used that > on GAE. > > if your uploaded file will be larger than 1MB (the curre

[web2py] Re: Web Shell problem on Mozilla Firefox 5 and Internet Explorer 9 (PC with Vista)

2011-07-10 Thread Anthony
I think the web shell can be a little quirky, especially in IE on Windows. I usually just use the Windows shell. To make it easy to quickly run a particular app (and optionally run a specific controller), I have put a 'web2py shell.bat' file on my desktop with the following content: @echo off

Re: [web2py] Re: admin complains at encoder

2011-07-10 Thread Carl Roach
cheers. I'll look into it. On 10 Jul 2011, at 17:30, howesc wrote: > looks to me like admin is posting data as a string, not something with a > timetuple() method. don't all form posts come to you as strings and would > need to be cast to other types before storing in the DB?

[web2py] Re: auth with OpenID - auth.environment.URL(...) error

2011-07-10 Thread Brian M
Bingo - I'll start an issue over in google code & submit the patch. Thanks Anthony!

[web2py] Web Shell problem on Mozilla Firefox 5 and Internet Explorer 9 (PC with Vista)

2011-07-10 Thread Valter Foresto
I noted alternate functioning of Web Shell on Mozilla Firefox 5 and Internet Explorer 9 on a PC with Vista installed OS. I currently use the last Version 1.97.1 (2011-06-26 19:25:44) of web2py. Anyone noted the same problem ? - Valter

[web2py] Re: Google app engine and DAL

2011-07-10 Thread howesc
Shark, the upload field will work (though you might have to pass the flag to tell it to store the file in the DB). it's been a while since i have used that on GAE. if your uploaded file will be larger than 1MB (the current limit for blob fields assuming the online docs here are correct http:

[web2py] Re: admin complains at encoder

2011-07-10 Thread howesc
looks to me like admin is posting data as a string, not something with a timetuple() method. don't all form posts come to you as strings and would need to be cast to other types before storing in the DB?

[web2py] Re: Google app engine and DAL

2011-07-10 Thread Shark
Thanks massimo for reply but my question will upload field work in GAE and will save the data in datastore or I have to define field as anther type ? example b.define_table('person', Field('image', 'upload')) As it by default save data in upload folder thanks in advance On Jul 10, 5:18 pm, Mas

[web2py] Re: Google app engine and DAL

2011-07-10 Thread Massimo Di Pierro
In web2py a Field(...,'upload') makes both a StringProperty and a BlobProperty. The filename goes in one and the data in the other. I think BlobProperty has a 10MB limitation but I am not sure. These numbers change as GAE evolves. Massimo On Jul 10, 8:22 am, Shark wrote: > We want to save a blob

[web2py] Re: Google app engine and DAL

2011-07-10 Thread Shark
We want to save a blob to datastore in GAE not only save the name is this the same as upload field On Jul 9, 9:51 pm, Shark wrote: > Ok thank very much Anthony > > On Jul 9, 4:32 pm, Anthony wrote:> On Saturday, July 9, > 2011 8:07:48 AM UTC-4, Shark wrote: > > > > I need help in updating list

Re: [web2py] Re: Call functions periodically from WEB2PY at short time basis (like 0.05 ... 5 seconds)

2011-07-10 Thread Roberto De Ioris
Il giorno 08/lug/2011, alle ore 18.14, Francisco Costa ha scritto: >> Hardo to say. 0.9.7 branch is now obsolete, and a lot of fix has been >> added to signal framework in 0.9.8. If you want to manage timer reliably >> you should use the latest tip (it is really the 0.9.8.2 release, i am only >>

Re: [web2py] Re: Linking directly to an uploaded image

2011-07-10 Thread Ivica Kralj
Actually, I just found solution for my app, again if somebody can provide more portable solution that would be great? Cheers Ivica On 10 July 2011 00:31, IK wrote: > Hi Massimo, > > When "uploadseparate" is set to True, previously mentioned solution > will not work, at least n

[web2py] mapreduce.appspot.com

2011-07-10 Thread hcvst
Hi, I'm thinking of using this mapreduce lib for GAE, however it expects one to reference GAE entity_kinds. Is there a way to reference the underlying GAE entity through DAL? I've run into this problem in the past when trying to apply some GAE specific functions such as cursors for paging. Wou

[web2py] Re: login problem

2011-07-10 Thread LightOfMooN
Also nothing happens On 10 июл, 02:42, Anthony wrote: > What happens if you remove vars=request.vars from LOAD()? > > On Jul 9, 11:52 am, LightOfMooN wrote: > > > > > > > > > ajax=True doesn't work too > > > I make it clear: > > layout.html > > {{=LOAD('default','login2',vars=request.vars, ajax=