[web2py:30091] Proposal about easier validators i18n

2009-09-05 Thread Iceberg
Hi Massimo, Currently the error_message of all validators are a phrase in English, such as 'value already in database!' etc. When I gonna do some i18n for it, I have to do: db.Field('foo', requires=IS_NOT_IN_DB( db,"table.field", error_message=T('value already in database!')))

[web2py:30092] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mr.freeze
I think SQLFORM should be changed to allow for IS_IN_SET with other validators then you could just do: requires=[IS_IN_SET(['','English','Chinese','Italian']),IS_NOT_EMPTY ()] Or you could get fancy: requires=[IS_IN_SET(['Please choose...','English','Chinese','Italian']),IS_EXPR("str(value) != 'P

[web2py:30093] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mr.freeze
I think this would do it: Index: gluon/sqlhtml.py === --- gluon/sqlhtml.py(revision 1196) +++ gluon/sqlhtml.py(working copy) @@ -167,11 +167,14 @@ :param field: the field needing checking :returns: True if t

[web2py:30094] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
Thanks for the feedback, but I would say: requires=[IS_IN_SET(['','English','Chinese','Italian']),IS_NOT_EMPTY ()] is semantically inconsistent and therefore not intuitive. I still prefer to let the: requires=IS_IN_SET(['English','Chinese','Italian']) can generate a drop-down list with ini

[web2py:30095] Re: Proposal about easier validators i18n

2009-09-05 Thread Fran
On Sep 5, 8:29 am, Iceberg wrote: > Currently the error_message of all validators are a phrase in English +1 for getting this fixed in a DRY manner :) > (1) let the default error_message be i18n-ready: > or if somehow you don't like validators.py depends on T(), then you > can: tools.py does t

[web2py:30096] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Fran
On Sep 5, 5:58 am, Iceberg wrote: > So my proposal is to adjust OptionsWidget to always show up with an > initial blank (when creating record), but not necessarily accepting > it. Just change line 198 of sqlhtml.py from: >   opts = [] > to: >   if value: >     opts = [] >   else: # To enforce an

[web2py:30097] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Fran
On Sep 5, 9:34 am, "mr.freeze" wrote: > I think this would do it: Lovely - I like this solution a lot :) Patch works for me...it's backward-compatible, suggest it goes into Trunk :) F --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

[web2py:30098] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
On Sep5, 5:25pm, Fran wrote: > On Sep 5, 5:58 am, Iceberg wrote: > > > So my proposal is to adjust OptionsWidget to always show up with an > > initial blank (when creating record), but not necessarily accepting > > it. Just change line 198 of sqlhtml.py from: > >   opts = [] > > to: > >   if val

[web2py:30099] Help with web2py authenticatoin

2009-09-05 Thread eddwinston
I have in my default controller the "user" action that exposes the auth object. But I wanted authenticated also in a different controller, say, second_controller. I decorated one of my action in the "second_controller" with @auth.requires_login() and it was looking for a "user" action in "second_c

[web2py:30102] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread Graham Dumpleton
On Sep 5, 2:16 pm, Yarko Tymciurak wrote: > Graham - > > On Fri, Sep 4, 2009 at 11:08 PM, Graham Dumpleton < > > > > > > graham.dumple...@gmail.com> wrote: > > > On Sep 5, 1:19 pm, Wes James wrote: > > > On Fri, Sep 4, 2009 at 8:21 PM, mdipierro > > wrote: > > > > command-line option > > > A c

[web2py:30101] Re: Help with web2py authenticatoin

2009-09-05 Thread Fran
On Sep 5, 12:10 pm, eddwinston wrote: > I have in my default controller the "user" action that exposes the > auth object. But I wanted authenticated also in a different > controller, say, second_controller. I decorated one of my action in > the "second_controller" with @auth.requires_login() and

[web2py:30100] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Fran
On Sep 5, 11:44 am, Iceberg wrote: > my proposal does not prevent you from explicitly > using default value at all. If you insist, you can still define > default value as always: >   Field('language', >     requires=IS_IN_SET(['English','Chinese','Italian']), >     default='Italian') # the defaul

[web2py:30103] Re: Help with web2py authenticatoin

2009-09-05 Thread eddwinston
Thanks Fran On Sep 5, 2:20 pm, Fran wrote: > On Sep 5, 12:10 pm, eddwinston wrote: > > > I have in my default controller the "user" action that exposes the > > auth object. But I wanted authenticated also in a different > > controller, say, second_controller. I decorated one of my action in > >

[web2py:30104] Re: Help with web2py authenticatoin

2009-09-05 Thread eddwinston
Hi Fran, If I try to access the action with the @auth.requires_login() decorator in the second controller, it still looks for user action in the second controller. It does go to the on_failed_authorization url given. On Sep 5, 2:20 pm, Fran wrote: > On Sep 5, 12:10 pm, eddwinston wrote: > >

[web2py:30106] Re: Help with web2py authenticatoin

2009-09-05 Thread eddwinston
Hi Fran, I managed to fix the problem I think. When user is not authenticated the @auth.requires_login() decorator looks for settings.login_url from the Auth object. But i previously did not have that. After adding it, it worked fine Thanks Regards, Winston On Sep 5, 3:04 pm, eddwinston wrote:

[web2py:30105] Comments on gluon/streamer.py.

2009-09-05 Thread Graham Dumpleton
In gluon/streamer.py there are a number of places were open() call is made on files. These are within a try block and exceptions are caught and the specific reason for the error is determined and different HTTP error returned. For example on such case from that file is: try: open(stat

[web2py:30107] Re: Dynamic Side bar

2009-09-05 Thread mdipierro
Useful but attention that this will break if you compile the app and distribute it without source code. On Sep 5, 1:24 am, "mr.freeze" wrote: > I use this to dynamically generate a menu from my controllers and > functions during development.  Just replace the existing response.menu > assignment

[web2py:30108] Re: TypeError

2009-09-05 Thread mdipierro
I cannot tell which one is line 95. Are you getting this error on the same or a different machine than the one used for development? On Sep 5, 1:51 am, Derek wrote: > Hi All, > > I really don't understand what's going on. I've been developing/ > learning in web2py for the past week, and suddenly

[web2py:30109] Re: Proposal about easier validators i18n

2009-09-05 Thread mdipierro
I agree with Fran. On Sep 5, 4:21 am, Fran wrote: > On Sep 5, 8:29 am, Iceberg wrote: > > > Currently the error_message of all validators are a phrase in English > > +1 for getting this fixed in a DRY manner :) > > > (1) let the default error_message be i18n-ready: > > or if somehow you don't l

[web2py:30111] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mdipierro
You can already set a default Field(...,requires=IS_IN_SET (...),default='value') On Sep 5, 5:44 am, Iceberg wrote: > On Sep5, 5:25pm, Fran wrote: > > > > > On Sep 5, 5:58 am, Iceberg wrote: > > > > So my proposal is to adjust OptionsWidget to always show up with an > > > initial blank (when c

[web2py:30112] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mdipierro
Can you explain it? On Sep 5, 3:34 am, "mr.freeze" wrote: > I think this would do it: > > Index: gluon/sqlhtml.py > === > --- gluon/sqlhtml.py    (revision 1196) > +++ gluon/sqlhtml.py    (working copy) > @@ -167,11 +167,14 @@ >    

[web2py:30113] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread mdipierro
At a first look I would use SetEnv for this. On Sep 4, 11:08 pm, Graham Dumpleton wrote: > On Sep 5, 1:19 pm, Wes James wrote: > > > On Fri, Sep 4, 2009 at 8:21 PM, mdipierro wrote: > > > > Sorry Graham. You are right I got confused. Had a long day. > > > I will add you patch to trunk but, as y

[web2py:30110] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mdipierro
Can you explain it? On Sep 5, 3:34 am, "mr.freeze" wrote: > I think this would do it: > > Index: gluon/sqlhtml.py > === > --- gluon/sqlhtml.py    (revision 1196) > +++ gluon/sqlhtml.py    (working copy) > @@ -167,11 +167,14 @@ >    

[web2py:30114] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread mdipierro
So far we use parameters_[] only to store the hashed admin password. options.py is used as an alternative way to set command line options for wsgiserver and only wsgiserver since there are n parameters for web2py itself. That is why I think in this case SetEnv is the way to do. On Sep 4,

[web2py:30115] Re: Cherokee - fastcgi - 404 not found

2009-09-05 Thread Jose
On 4 sep, 23:21, Arvind wrote: > Hello, > > I have configured my cherokee server as mentioned > herehttp://www.web2py.com/AlterEgo/default/show/184 > > i have defined a virtual host called music and each time, i run this > urlhttp://music/ > it automatically redirects tohttp://music/welcome/de

[web2py:30116] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
Sorry for too much back and forth conversation which distract you from the original proposal. My point is not about default value, it is about suggesting to add a blank for OptionsWidget. You can simply try the patch in my first post (quoted below) and see the effect. Fran also has some good poin

[web2py:30118] Re: Comments on gluon/streamer.py.

2009-09-05 Thread mdipierro
Thank you Graham. I am making the proposed changes in trunk. I believe this is the only plane where this is done. About the stat problem you refer to. Let's say we pass the length to streamer. How would this affect your patch that uses request.env.wsgi_file_wrapper instead? We can change the de

[web2py:30119] Re: TypeError

2009-09-05 Thread Derek
line 95 is the first line: elif request.args[0]=='location': I'm actually getting this error everywhere. On my development machine which is running the binary Windows web2py distribution, as well as both the Google App Launcher and the Google App Engine. On Sep 5, 8:26 am, mdipierro wrote: > I

[web2py:30120] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread mdipierro
Sounds good. Can you please check I implemented all your patches correctly in trunk? It is good about a wsgi expect like you here. The issue with chunk_size that you discovered may actually have been the cause of a timeout issue that some users have been having. Time will tell. I am still uneasy

[web2py:30117] Re: Proposal about easier validators i18n

2009-09-05 Thread Iceberg
Does this mean there is no objection, and the i18n-able validators will soon be available in trunk? :-) On Sep5, 8:27pm, mdipierro wrote: > I agree with Fran. > > On Sep 5, 4:21 am, Fran wrote: > > > > > On Sep 5, 8:29 am, Iceberg wrote: > > > > Currently the error_message of all validators ar

[web2py:30121] Re: TypeError

2009-09-05 Thread mdipierro
I think the error is not there but here: ows = db(db.auth_user.location==request.args [1],db.auth_user.registration_key=='').select() because db(... , ...) is not a valid syntax. Should be ows = db(db.auth_user.location==request.args[1]) (db.auth_user.registration_key=='').select() or ows = d

[web2py:30122] Re: Proposal about easier validators i18n

2009-09-05 Thread mdipierro
I did not say that but let's all think more how this could be done. On Sep 5, 8:21 am, Iceberg wrote: > Does this mean there is no objection, and the i18n-able validators > will soon be available in trunk? :-) > > On Sep5, 8:27pm, mdipierro wrote: > > > I agree with Fran. > > > On Sep 5, 4:21 a

[web2py:30123] Re: TypeError

2009-09-05 Thread Derek
Sweet! Thanks for the advice, I'll adjust those lines. On Sep 5, 10:21 am, mdipierro wrote: > I think the error is not there but here: > > ows = db(db.auth_user.location==request.args > [1],db.auth_user.registration_key=='').select() > > because db(... , ...) is not a valid syntax. Should be > >

[web2py:30124] Is auth comptible with MS active directory?

2009-09-05 Thread max
After lots of tests and research of ldap_auth , I have some questions 1. Does the mode="ad" identify the Active directory in ldap_ath_aux? 2. In my active directory server to use "search_ext_s" i need a administrator account, What i think is general to all ad servers. How can i define it in ld

[web2py:30125] streamer.py

2009-09-05 Thread Jose
Hi, With the svn r.1199 (streamer.py) broke something. File "/usr/home/jose/web2py/gluon/streamer.py", line 49, in stream_file_or_304_or_206 if e[0] == errno.EISDIR: NameError: global name 'errno' is not defined Jose --~--~-~--~~~---~--~~ You received this m

[web2py:30126] Re: streamer.py

2009-09-05 Thread Jonathan Lundell
On Sep 5, 2009, at 8:09 AM, Jose wrote: > With the svn r.1199 (streamer.py) broke something. > > File "/usr/home/jose/web2py/gluon/streamer.py", line 49, in > stream_file_or_304_or_206 >if e[0] == errno.EISDIR: > NameError: global name 'errno' is not defined Try adding 'import errno' to stre

[web2py:30127] Re: streamer.py

2009-09-05 Thread Jose
On 5 sep, 15:19, Jonathan Lundell wrote: > On Sep 5, 2009, at 8:09 AM, Jose wrote: > > > With the svn r.1199 (streamer.py) broke something. > > > File "/usr/home/jose/web2py/gluon/streamer.py", line 49, in > > stream_file_or_304_or_206 > >    if e[0] == errno.EISDIR: > > NameError: global name

[web2py:30128] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mr.freeze
Massimo, This patch allows other validators to be used with IS_IN_SET and still have SQLFORM render a dropdown list: requires=[IS_IN_SET(['Please choose...','English','Chinese','Italian']),IS_EXPR("str(value) ! ='Please choose...' ")] ...would produce a dropdown list with a the text 'Please

[web2py:30129] Google App Engine - no tables selected??

2009-09-05 Thread Derek
Any thoughts? Google App Engine is giving this error: _get_table_or_raise raise SyntaxError, 'Set: no tables selected' SyntaxError: Set: no tables selected without the error tickets at my disposal, anyway to track down where line 96 of default.py is? --~--~-~--~~~

[web2py:30130] Re: Google App Engine - no tables selected??

2009-09-05 Thread Yarko Tymciurak
I expect this is referring to your controller - applications/[your_app]/contollers/default.py On Sat, Sep 5, 2009 at 10:39 AM, Derek wrote: > > Any thoughts? Google App Engine is giving this error: > > _get_table_or_raise >raise SyntaxError, 'Set: no tables selected' > SyntaxError: Set: no t

[web2py:30131] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mr.freeze
I think we're after the same thing but I'm not convinced that people should be forced to use a blank item. The example... requires=[IS_IN_SET(['','English','Chinese','Italian']),IS_NOT_EMPTY ()] ...was just to show the flexibility that you can use multiple/ different validators and have an unsub

[web2py:30132] Re: streamer.py

2009-09-05 Thread Jose
> > Try adding 'import errno' to streamer.py. with import errno does not show error, but still not working. jose --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send e

[web2py:30133] Re: Google App Engine - no tables selected??

2009-09-05 Thread Derek
I guess I shouldn't ask two questions in a message. The first being the most important, any ideas why GAE is returning 'set: no tables selected'? Here's the code it seems to be having a problem with in my default.py: rows = db(db.auth_user.location==argLocation).select() locatio

[web2py:30134] Re: streamer.py

2009-09-05 Thread Jonathan Lundell
On Sep 5, 2009, at 8:53 AM, Jose wrote: >> Try adding 'import errno' to streamer.py. > > > with import errno does not show error, but still not working. What does "not working" mean, exactly? Jose, are you using wsgi? Until somebody who knows more about it that I do responds, you might try re

[web2py:30135] Re: streamer.py

2009-09-05 Thread Jose
On 5 sep, 16:34, Jonathan Lundell wrote: > On Sep 5, 2009, at 8:53 AM, Jose wrote: > > >> Try adding 'import errno' to streamer.py. > > > with import errno does not show error, but still not working. > > What does "not working" mean, exactly? > I use: def imgcaptcha(): if session.image is

[web2py:30136] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
On Sep5, 11:51pm, "mr.freeze" wrote: > Perhaps a better solution is checking if the value for 'default' > argument is *not* in the set and then appending it to the set but not > allowing it to pass validation if selected.  What do you think? > You are a genius! This solution reaches the original

[web2py:30137] Re: Mounting web2py at sub URL of web site and not root of web site.

2009-09-05 Thread Joe Barnhart
+1 for Graham. Backward compatibility is not broken because relocating the web2py site in the directory structure is a new feature. If you want to take advantage of the new feature, you just re-code your URL functions. Old installations work as they always did. (Also - can we call w2p "enterpri

[web2py:30138] web2py and pyamf

2009-09-05 Thread Massimo Di Pierro
Thank you Thijis, and thank you again for pyamf. Massimo On Sep 5, 2009, at 11:30 AM, Thijs Triemstra|Collab wrote: > Hi Massimo, > > thanks for your email. I added a reference to web2py on our > homepage. Thanks for your support! > > Cheers, > > Thijs > > On 2 Sep 2009, at 00:57, Massimo Di

[web2py:30139] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mr.freeze
Very cool! The only thing I would change is to add it to the top of the list of options: if value not in [k for k,v in options]: opts.insert(0, OPTION(value,_value=value)) On Sep 5, 12:03 pm, Iceberg wrote: > On Sep5, 11:51pm, "mr.freeze" wrote: > > > Perhaps a better solution is

[web2py:30140] web2py FORM

2009-09-05 Thread eddwinston
Hi, I want a have a case like this, the authentication form will be displayed on the page at all times if the user is not authenticated irrespective of controller/action, how do i create such a form since it wont be controller/action specific? Thanks. Regards Winston --~--~-~--~~

[web2py:30141] Re: Bug in alternate authentication

2009-09-05 Thread mdipierro
I am not competent on this. Fran is the main author of the ldap module. I suggest you get together and send me a patch. On Sep 1, 10:14 pm, Don Lee wrote: > Agreed. > > On Tue, Sep 1, 2009 at 5:34 PM, Ahmed Soliman wrote: > > > Sure flexibility is needed but what I've spotted is a 'bug', it won

[web2py:30142] Re: Authentication using Facebook / Google / Myspace ...

2009-09-05 Thread mdipierro
please email the author in case he is not monitoring the list. On Sep 2, 12:48 am, "mr.freeze" wrote: > The openID consumer appliance seems to have a problem.  It generates a > ticket when I try to login:http://w2popenid.appspot.com/oidconsumer > > On Sep 2, 12:41 am, Richard wrote: > > > I'm a

[web2py:30143] Re: Mounting web2py at sub URL of web site and not root of web site.

2009-09-05 Thread mdipierro
I am not convinced. I had added this in trunk but I am taking it out because this is not the right solution to the problem and because it does break backward compatibility. 1) You can relocate web2py in a subfolder but you must use routes.py 2) The patch does break backward compatibility if a use

[web2py:30144] Re: Mounting web2py at sub URL of web site and not root of web site.

2009-09-05 Thread mdipierro
I should add that this is not a closed issue. Graham has a valid point and we need to find a way that makes everybody happy. I would like to hear an argument about why this does not break backward compatibility (I think it does if people already use routes for this purpose) and about what is wro

[web2py:30145] Re: web2py FORM

2009-09-05 Thread mdipierro
in layout you can do: {{if not auth.is_logged_in(): response.write(auth.login())}} Massimo On Sep 5, 12:41 pm, eddwinston wrote: > Hi, > > I want a have a case like this, the authentication form will be > displayed on the page at all times if the user is not authenticated > irrespective of con

[web2py:30148] Re: web2py FORM

2009-09-05 Thread eddwinston
Hi, If I just use {{if not auth.is_logged_in(): response.write(auth.login ())}}. It displays the form and that is very okay, but what about customising the form. I would like to specify class name and stuffs like that. How can I pass in such extra value. Thanks Regards, Winston On Sep 5, 9:05 p

[web2py:30149] Re: How to access the checked property?

2009-09-05 Thread mr.freeze
Did you get a chance to look at this? Summary: The web2py_ajax.html ajax function behaves differently than a normal submit (only noticeable on controls that have conditional postback like checkbox). This fixes it and adds the ability to use jQuery selectors ( if s is a string instead of a list of

[web2py:30146] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread mdipierro
Graham what do you think: file_streamer = (request.env.mod_wsgi and \ request.env.mod_wsgi_version >= (2,4) and \ request.env.wsgi_file_wrapper) or streamer or file_streamer = (request.env.web2py_user_wsgi_file_wrapper an

[web2py:30150] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mr.freeze
Iceberg, do you want to submit a patch? Massimo, do you have any issues with this change? I verified that it works when multiple=True as well. On Sep 5, 12:33 pm, "mr.freeze" wrote: > Very cool!  The only thing I would change is to add it to the top of > the list of options: > > if value not in

[web2py:30147] Re: streamer.py

2009-09-05 Thread Jose
I was watching, the error occurs in globals.py: File "/usr/home/jose/web2py/gluon/globals.py", line 204, in download return self.stream(stream, chunk_size = chunk_size) File "/usr/home/jose/web2py/gluon/globals.py", line 172, in stream file_streamer = (request.env.mod_wsgi and \ Attribu

[web2py:30151] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
I thought the change is so obvious that we don't need to "submit" a patch. But anyway, here it is. Index: sqlhtml.py === --- sqlhtml.py (revision 1196) +++ sqlhtml.py (working copy) @@ -200,8 +200,9 @@ else:

[web2py:30152] Ajax login

2009-09-05 Thread eddwinston
Hi, >From the login form generated by web2py, if I intercept the submit event so I can make an ajax request to the server, the request URL I guess will be /[application]/user/login. Then what will be the possible parameters? Or should the request URL be something like this: URL(r=request, c='def

[web2py:30153] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mr.freeze
Iceberg, did you see my previous message about inserting the option at the *top* of the list?: if value not in [k for k,v in options]: opts.insert(0, OPTION(value,_value=value)) What do you think? On Sep 5, 1:46 pm, Iceberg wrote: > I thought the change is so obvious that we don't

[web2py:30154] Re: streamer.py

2009-09-05 Thread Jonathan Lundell
On Sep 5, 2009, at 11:21 AM, Jose wrote: > > I was watching, the error occurs in globals.py: > > File "/usr/home/jose/web2py/gluon/globals.py", line 204, in download >return self.stream(stream, chunk_size = chunk_size) > File "/usr/home/jose/web2py/gluon/globals.py", line 172, in stream >

[web2py:30155] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread Jonathan Lundell
On Sep 5, 2009, at 11:13 AM, mdipierro wrote: > > Graham what do you think: request defaults to None here, so that needs to be checked first. > >file_streamer = (request.env.mod_wsgi and \ > request.env.mod_wsgi_version >= (2,4) and > \ >

[web2py:30156] Re: streamer.py

2009-09-05 Thread Jose
On 5 sep, 18:50, Jonathan Lundell wrote: > > Try this: > >          file_streamer = (request and request.env.mod_wsgi and \ >                               request.env.mod_wsgi_version >= (2,4)   > and \ >                               request.env.wsgi_file_wrapper) or streamer yes, it works

[web2py:30157] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
I did see your message. I just thought my previous patch already take that into consideration. But since you insist, your wish is granted. :-) Index: sqlhtml.py === --- sqlhtml.py (revision 1196) +++ sqlhtml.py (working copy) @@ -2

[web2py:30158] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mr.freeze
Thanks! When I tried it before, it put it at the bottom of the list. I think this one is a winner! On Sep 5, 2:08 pm, Iceberg wrote: > I did see your message. I just thought my previous patch already take > that into consideration. But since you insist, your wish is > granted. :-) > > Index: sql

[web2py:30159] Re: Extending IS_NOT_EMPTY validator

2009-09-05 Thread Matthew
Unfortunately not - the both have exactly one space between , and None. File "validators.py", line 15, in __main__.IS_NOT_WHITESPACE Failed example: IS_NOT_WHITESPACE()(' spaces in between and on end ') Expected: ('spaces in between and on end', None) Got: ('spaces in between and on

[web2py:30160] Re: Extending IS_NOT_EMPTY validator

2009-09-05 Thread Matthew
Unfortunately not - they both have exactly one space between the comma and "None". File "validators.py", line 15, in __main__.IS_NOT_WHITESPACE Failed example: IS_NOT_WHITESPACE()(' spaces in between and on end ') Expected: ('spaces in between and on end', None) Got: ('spaces in bet

[web2py:30161] Re: Mounting web2py at sub URL of web site and not root of web site.

2009-09-05 Thread Joe Barnhart
What is the role of routes.py in a production environment? In the book, you seemed to indicate that routes.py was not the solution of choice: "All major web servers, for example Apache and lighttpd, also have the ability to rewrite URLs. In a production environment we suggest having the web serve

[web2py:30162] Re: web2py FORM

2009-09-05 Thread mdipierro
{{if not auth.is_logged_in():}} {{form=auth.login()}} {{=form.custom.begin}} {{=form.custom.end}} {{pass}} On Sep 5, 1:30 pm, eddwinston wrote: > Hi, > > If I just use {{if not auth.is_logged_in(): response.write(auth.login > ())}}. It displays the form and that is very okay, but what about >

[web2py:30163] Re: How to access the checked property?

2009-09-05 Thread mdipierro
Sorry I forgot. Will do it over the week end. On Sep 5, 1:31 pm, "mr.freeze" wrote: > Did you get a chance to look at this? Summary: > The web2py_ajax.html ajax function behaves differently than a normal > submit (only noticeable on controls that have conditional postback > like checkbox).  This

[web2py:30164] Re: Ajax login

2009-09-05 Thread mdipierro
Yes the url is URL(r=request,c='default', f='user', args='login') or {{=URL(r=request,c='default', f='user', args='login')}} if in the view. On Sep 5, 1:48 pm, eddwinston wrote: > Hi, > > From the login form generated by web2py, if I intercept the submit > event so I can make an ajax request

[web2py:30165] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread mdipierro
Is it ever called with request=None? On Sep 5, 1:53 pm, Jonathan Lundell wrote: > On Sep 5, 2009, at 11:13 AM, mdipierro wrote: > > > > > Graham what do you think: > > request defaults to None here, so that needs to be checked first. > > > > >        file_streamer = (request.env.mod_wsgi and \ >

[web2py:30166] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread Jonathan Lundell
On Sep 5, 2009, at 1:56 PM, mdipierro wrote: > > Is it ever called with request=None? Apparently; Jose was getting a crash to that effect. It's the declared default. > > On Sep 5, 1:53 pm, Jonathan Lundell wrote: >> On Sep 5, 2009, at 11:13 AM, mdipierro wrote: >> >> >> >>> Graham what do yo

[web2py:30167] Re: streamer.py

2009-09-05 Thread mdipierro
ok, fixed in trunk On Sep 5, 2:00 pm, Jose wrote: > On 5 sep, 18:50, Jonathan Lundell wrote: > > > > > Try this: > > >          file_streamer = (request and request.env.mod_wsgi and \ > >                               request.env.mod_wsgi_version >= (2,4)   > > and \ > >                        

[web2py:30168] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread Jonathan Lundell
On Sep 5, 2009, at 2:04 PM, Jonathan Lundell wrote: > On Sep 5, 2009, at 1:56 PM, mdipierro wrote: > >> >> Is it ever called with request=None? > > Apparently; Jose was getting a crash to that effect. It's the declared > default. Response.download(): return self.stream(stream, chunk_si

[web2py:30169] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread mdipierro
please email me the patch On Sep 5, 2:14 pm, "mr.freeze" wrote: > Thanks! When I tried it before, it put it at the bottom of the list. I > think this one is a winner! > > On Sep 5, 2:08 pm, Iceberg wrote: > > > I did see your message. I just thought my previous patch already take > > that into

[web2py:30170] Re: Extending IS_NOT_EMPTY validator

2009-09-05 Thread mdipierro
It must be a doctest then. No idea. On Sep 5, 3:00 pm, Matthew wrote: > Unfortunately not - they both have exactly one space between the comma > and > "None". > > File "validators.py", line 15, in __main__.IS_NOT_WHITESPACE > Failed example: >     IS_NOT_WHITESPACE()('  spaces in between and on

[web2py:30171] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread Jonathan Lundell
On Sep 5, 2009, at 2:06 PM, Jonathan Lundell wrote: > On Sep 5, 2009, at 2:04 PM, Jonathan Lundell wrote: > >> On Sep 5, 2009, at 1:56 PM, mdipierro wrote: >> >>> >>> Is it ever called with request=None? >> >> Apparently; Jose was getting a crash to that effect. It's the >> declared >> default.

[web2py:30172] Re: Mounting web2py at sub URL of web site and not root of web site.

2009-09-05 Thread mdipierro
If the web server provides the functionality to rewrite the output URLs, I'd use it. If not I would use routes.py What I am not comfortable with (but I may be missing something here) it implementing the request.env.script_name in URL since the output of URL is already rewritten by module rewrite

[web2py:30173] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread mdipierro
yes it should. uploading to trunk now. Please check it. On Sep 5, 4:08 pm, Jonathan Lundell wrote: > On Sep 5, 2009, at 2:06 PM, Jonathan Lundell wrote: > > > On Sep 5, 2009, at 2:04 PM, Jonathan Lundell wrote: > > >> On Sep 5, 2009, at 1:56 PM, mdipierro wrote: > > >>> Is it ever called with re

[web2py:30174] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread Jonathan Lundell
On Sep 5, 2009, at 2:12 PM, mdipierro wrote: > > yes it should. uploading to trunk now. Please check it. You said: return self.stream(stream, chunk_size = chunk_size, response=self) it should be: return self.stream(stream, chunk_size = chunk_size, request=request) Also,

[web2py:30175] Re: Optimising returning of file content using wsgi.file_wrapper extension.

2009-09-05 Thread mdipierro
Thanks Jonathan. Fixed and uploading to trunk now. On Sep 5, 4:16 pm, Jonathan Lundell wrote: > On Sep 5, 2009, at 2:12 PM, mdipierro wrote: > > > > > yes it should. uploading to trunk now. Please check it. > > You said: > >          return self.stream(stream, chunk_size = chunk_size,   > respon

[web2py:30176] Re: Bug in alternate authentication

2009-09-05 Thread MišoLietavec
Hi, Ahmed, I should add that Your patch is for the file gluon/tools.py and, probably, the last line should be: > elif self.settings.alternate_requires_registration: Works for me. My opinion is, that the present shape of ldap_auth.py should be rethinked. There are so many

[web2py:30177] Having problem with IS_IN_DB

2009-09-05 Thread eddwinston
Reference field marked with IS_IN_DB(db, ..., ...) is not displayed as drop-down menu in the admin section. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to

[web2py:30178] Re: Having problem with IS_IN_DB

2009-09-05 Thread mr.freeze
Can you post your table definition and/or 'requires' statement? It should look something like this: db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s') On Sep 5, 5:16 pm, eddwinston wrote: > Reference field marked with IS_IN_DB(db, ..., ...) is not displayed as > drop-down menu in th

[web2py:30179] Re: Having problem with IS_IN_DB

2009-09-05 Thread eddwinston
Hi mr.freeze Here it is: http://pastebin.com/d2070a421 On Sep 6, 1:20 am, "mr.freeze" wrote: > Can you post your table definition and/or  'requires' statement? It > should look something like this: > > db.dog.owner.requires = IS_IN_DB(db, 'person.id', '%(name)s') > > On Sep 5, 5:16 pm, eddwinst

[web2py:30180] Re: Having problem with IS_IN_DB

2009-09-05 Thread mr.freeze
I would try changing this line...: db.post.category.requires=[IS_NOT_EMPTY(), IS_IN_DB(db, db.category.id, '%(name)s')] ...to this: db.post.category.requires=IS_IN_DB(db, db.category.id, '%(name)s') IS_IN_DB won't render a dropdown when it is part of a list of validators. IS_NOT_EMPTY isn't need

[web2py:30181] Re: current link indication with MENU() helper

2009-09-05 Thread Richard
How should the active flag be set? Currently I have: response.menu = [ ['Home', request.controller == 'default', URL(request.application, 'default', 'index'), []], ... ] The default examples always have 'False' for active. Richard On Aug 14, 5:28 pm, mdipierro wrote: > Now (in trunk)

[web2py:30182] Re: Having problem with IS_IN_DB

2009-09-05 Thread eddwinston
Hi mr.freeze, It worked. Thanks. Regards, Winston On Sep 6, 2:07 am, "mr.freeze" wrote: > I would try changing this line...: > db.post.category.requires=[IS_NOT_EMPTY(), IS_IN_DB(db, > db.category.id, '%(name)s')] > > ...to this: > db.post.category.requires=IS_IN_DB(db, db.category.id, '%(name

[web2py:30183] Re: current link indication with MENU() helper

2009-09-05 Thread mdipierro
yes but I do not remember if the default layout would use this or not. On Sep 5, 6:18 pm, Richard wrote: > How should the active flag be set? Currently I have: > > response.menu = [ >     ['Home', request.controller == 'default', URL(request.application, > 'default', 'index'), []], >     ... > ]

[web2py:30184] Re: Ajax login

2009-09-05 Thread eddwinston
Hi, I tried creating the url like this because it is in the view: {{=URL (r=request,c='default', f='user', args='login')}} but it does not work. I used the jquery ajax method: jQuery.ajax("{{=URL (r=request,c='default', f='user', args='login')}}", {}, success_callback, failure_callback); I pas

[web2py:30185] Re: Ajax login

2009-09-05 Thread mr.freeze
I don't think your options are set correctly. Try this: jQuery.ajax({ type: "POST", url: "{{=URL(r=request,c='default', f='user', args='login'}}", data: {}, success: success_callback, error: failure_callback }); On Sep 5, 6:47 pm, eddwinston wrote: > Hi, > > I tried creating

[web2py:30186] Re: Ajax login

2009-09-05 Thread eddwinston
Hi mr freeze, My bad, I copied the wrong stuff in the previous post. This is actually how i did it: jQuery.ajax({ type: "POST", url: "{{=URL(r=request,c='default', f='user', args='login'}}", data: {}, success: success_callback, error: failure_callback }); But it did not work. O

[web2py:30187] two tables, one form

2009-09-05 Thread weheh
I have two tables that I want to partially populate using one form. In other words, part of table one's fields and part of table two's fields will be represented in one form. Is there a way to do this with SQLFORM and dbio=True? Or do I have to use SQLFORM and dbio=False and then populate the tab

[web2py:30188] File renaming routine

2009-09-05 Thread weheh
Is there a way to access the file renaming function that creates random filenames in the uploads directory? I have a nice python routine of my own that does this from a website I developed a few years ago, but if there's a built-in routine in web2py I think I'd rather use that. Also, is there an a

[web2py:30189] Re: two tables, one form

2009-09-05 Thread weheh
Actually, I guess there's a question as to whether I can even do this with SQLFORM or if I need to go to SQLFORM.formfactory and do all the db inserts explicitly thereafter? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

[web2py:30190] Re: Authentication using Facebook / Google / Myspace ...

2009-09-05 Thread Bottiger
Here is my version of openID for web2py. There are two versions. http://bitbucket.org/bottiger/web2py-openid/downloads/ CAS 1 is a fixed up version of the one at w2popenid which had some problems with different providers and python 2.6. AUTH 1 is the recommended version. It fully replaces the A

  1   2   >