[web2py] Re: How to order drop down

2010-05-29 Thread mdipierro
FREQS=( (0,'never'), (900,'15 minutes'), (1800,'30 minutes'), ...etc. ) On May 30, 1:11 am, weheh wrote: > I have Field('freq','integer',requires=IS_IN_SET(FREQS,zero=None)) as > part of a table. > > FREQS={ >   0:'never', >   900:'15 minutes', >   1800:'30 minutes', > ...etc. > > } > > I w

[web2py] Re: Email "perfect" regex

2010-05-29 Thread mdipierro
+1 On May 30, 1:12 am, Jonathan Lundell wrote: > On May 29, 2010, at 9:39 PM, mdipierro wrote: > > > The one your propose fails two of our tests: > > Failed example: > >    IS_EMAIL()('a...@d_-f.us') > > Expected: > >    ('a...@d_-f.us', None) > > Got: > >    ('a...@d_-f.us', 'enter a valid email

Re: [web2py] Re: Email "perfect" regex

2010-05-29 Thread Jonathan Lundell
On May 29, 2010, at 9:39 PM, mdipierro wrote: > The one your propose fails two of our tests: > Failed example: >IS_EMAIL()('a...@d_-f.us') > Expected: >('a...@d_-f.us', None) > Got: >('a...@d_-f.us', 'enter a valid email address') Underscores are not allowed, but we accept them becaus

[web2py] How to order drop down

2010-05-29 Thread weheh
I have Field('freq','integer',requires=IS_IN_SET(FREQS,zero=None)) as part of a table. FREQS={ 0:'never', 900:'15 minutes', 1800:'30 minutes', ...etc. } I want to force the drop down to order ascending by the keys of FREQS. Anyone know the syntax to do this in the Field declaration?

[web2py] onlinepayment anybody?

2010-05-29 Thread mdipierro
http://pypi.python.org/pypi/onlinepayment/1.0.0 Massimo

[web2py] 1.79.0rc1 please check it out

2010-05-29 Thread mdipierro
http://web2py.com/examples/static/nightly/web2py_src.zip http://web2py.com/examples/static/nightly/web2py_win.zip http://web2py.com/examples/static/nightly/web2py_osxzip x509 emails, thanks Gyuris attachment and html in Mail on GAE, thanks PanosJee fixed docstring in SQLTABLE, thanks aabelyakov TA

[web2py] Re: Email "perfect" regex

2010-05-29 Thread Iceberg
On May30, 10:36am, blackthorne wrote: > http://fightingforalostcause.net/misc/2006/compare-email-regex.php > > Take it as a suggestion for a better email regex validator... +1. The post contains implementations as well as test cases. It should be easy to convert them into a web2py validator WIT

[web2py] Re: Email "perfect" regex

2010-05-29 Thread mdipierro
The one your propose fails two of our tests: Failed example: IS_EMAIL()('a...@d_-f.us') Expected: ('a...@d_-f.us', None) Got: ('a...@d_-f.us', 'enter a valid email address') ** File "gluon/validators.py", line 859, in _

[web2py] Re: custom auth_user with avatar image, session cannot pickle

2010-05-29 Thread mdipierro
This is related to an old issue on whether form.vars.file when db.table.file.type=='upload' should be a FieldStorage object of the new filename. User Hamdy argued the latter and I the former in order to keep backward compatibility. You proved to us this is a bug because it breaks auth. I now fixe

[web2py] Re: Custom registration form -- password_two [CLOSED]

2010-05-29 Thread weheh
OK Thadeus & Massimo, I agree now that you're right that the way to do it is as you showed using SQLFORM.factory and then a custom form. Then do my own form validation etc. and forget using the default registration code. Doing the custom controller is the same as any other controller and gives yo

[web2py] Email "perfect" regex

2010-05-29 Thread blackthorne
http://fightingforalostcause.net/misc/2006/compare-email-regex.php Take it as a suggestion for a better email regex validator...

Re: [web2py] Re: "wizard" style forms in web2py

2010-05-29 Thread Robby O'Connor
Okay thank you! P.S. I'm working with Sahana Py (now referred to as Sahana Eden) =) --rob On 5/29/2010 9:37 PM, mdipierro wrote: Yes. The idea is to user request.args(0) to decide the page of the wizard and the relative form. On May 29, 7:36 pm, Robby O'Connor wrote: Okay, Looking at th

[web2py] Re: "wizard" style forms in web2py

2010-05-29 Thread mdipierro
Yes. The idea is to user request.args(0) to decide the page of the wizard and the relative form. On May 29, 7:36 pm, Robby O'Connor wrote: > Okay, > > Looking at this deeper, I there will be a complete form (one covering > one db table; then another covering a completely different database > tabl

Re: [web2py] Re: "wizard" style forms in web2py

2010-05-29 Thread Robby O'Connor
Okay, Looking at this deeper, I there will be a complete form (one covering one db table; then another covering a completely different database table. Let me see if I got this right. Can this implementation idea work for that case? --rob On 5/29/2010 11:19 AM, mdipierro wrote: db.define_tab

[web2py] Re: gaehandler.py change

2010-05-29 Thread mdipierro
Before I add the line I need some diagnostic. Is env['PATH_INFO'] unicode? In this case shouldn't it be env['PATH_INFO'] = env['PATH_INFO'].encode('utf8') On May 29, 6:40 pm, howesc wrote: > Hi all, > > in order to use blobstore on google app engine we have to be able to > handle redirection bac

[web2py] Re: help with auth.requires_login()

2010-05-29 Thread mdipierro
I need to try this. there is a potential issue wich scope of variables. On May 29, 11:09 am, Mathieu Clabaut wrote: > Did i miss something ot the following would be ok ? > >     def requires_login(self, next=None, message=self.message.access_denied > ): >         """ >         decorator that prev

[web2py] gaehandler.py change

2010-05-29 Thread howesc
Hi all, in order to use blobstore on google app engine we have to be able to handle redirection back from google's upload API. when we are re- directed back all variables come from google in unicode. the fix i have is to add the following line just before the return from wsgiapp() in gaehandler.

[web2py] Re: Complicated Join...

2010-05-29 Thread howesc
Jason, the python stuff and sql ninja stuff are the results of some great code-reviewers teaching me tricks and lots of complex queries over the years! tags = db(db.concert_tag.playlist== \ active_playlist.id).select(db.concert_tag.tag) that's a simple web2py query. i take you can follow tha

[web2py] Re: jQgrid navigator - form editing through a grid

2010-05-29 Thread Yarko Tymciurak
btw - trying to wade thru these doesn't seem to point to anything (and just makes my head hurt!): http://www.trirand.com/jqgridwiki/doku.php?id=wiki:navigator&s[]=navigator http://www.trirand.com/jqgridwiki/doku.php?id=wiki:common_rules http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editi

[web2py] resize window after redirect.

2010-05-29 Thread annet
I have the following code in a view: {{=A(club.companyname,_onmouseover="this.style.cursor='pointer';",\ _onclick="javascript:clublocatordetails('%s')"%URL(r=request,f='details',args=[club.id]))}} The javascript clublocatordetails function (in web2py_ajax.html) resizes the window. I extende

[web2py] jQgrid navigator - form editing through a grid

2010-05-29 Thread Yarko Tymciurak
I admit it - I'm a jQuery novice; no, worse: a javascript ninny: I have not been able (yet) to make sense of how things work, what the underlying structure is, so that I can "know" what I need to do (even before I think about "all the ways" I can do something). So - I wanted to use a few jquery

[web2py] Re: "wizard" style forms in web2py

2010-05-29 Thread Iceberg
It is always fun to see Massimo asking questions, because he can usually comes up with a clean solution based on some unpopular web2py trick. :) This time, it is the SQLFORM(..., fields=...) that I did not notice. Thanks. :) Thadeus also gives a good suggestion. And this kind of logic is better i

Re: [web2py] help with auth.requires_login()

2010-05-29 Thread Mathieu Clabaut
Did i miss something ot the following would be ok ? def requires_login(self, next=None, message=self.message.access_denied ): """ decorator that prevents access to action if not logged in """ def decorator(action): def f(*a, **b):

Re: [web2py] Re: "wizard" style forms in web2py

2010-05-29 Thread Thadeus Burgess
I would use the jQuery form wizard plugin. It is very nice and dose the pagination for you. The only issue is if the data in the second step depend on what is in the first step, then you would need to use some ajax/javascript to alter accordingly. -- Thadeus On Sat, May 29, 2010 at 10:39 AM,

Re: [web2py] Re: Group some fields into a

2010-05-29 Thread Mathieu Clabaut
Thanks for the advice... I'm not sure it will help for my making of several group inside the form, but it may be not necessary with the formstyle='divs' style. On Sat, May 29, 2010 at 17:51, Yarko Tymciurak wrote: > > On May 29, 10:04 am, mdipierro wrote: > > Mind you also have the new > > > >

[web2py] Re: Group some fields into a

2010-05-29 Thread Yarko Tymciurak
On May 29, 10:04 am, mdipierro wrote: > Mind you also have the new > > form=SQLFORM(...,formstyle='divs') > form=SQLFORM(...,formstyle='table3cols') > form=SQLFORM(...,formstyle='table2cols') > form=SQLFORM(...,formstyle='ul') Note: these canned styles were added in 1.77.1; check the README f

Re: [web2py] Re: "wizard" style forms in web2py

2010-05-29 Thread Mathieu Clabaut
Nice idea ! I needed something similar... I'll give a try.. Thanks ! On Sat, May 29, 2010 at 17:19, mdipierro wrote: > db.define_table('mytable', > Field('field1'), Field('field2'), Field('field3'), > Field('field4')) > > make sure they all have defaults. > > def wizard(): > fields=[['

[web2py] Re: "wizard" style forms in web2py

2010-05-29 Thread mdipierro
db.define_table('mytable', Field('field1'), Field('field2'), Field('field3'), Field('field4')) make sure they all have defaults. def wizard(): fields=[['field1'], # first page ['field2','field3'], # second page ['field4']] # third page record_id =i

[web2py] Re: Plugin_jqgrid problem

2010-05-29 Thread mdipierro
The way it is designed you cannot insert the same grid twice. You need to instantiate two grids. On May 29, 2:24 am, leo wrote: > thank you ,Golden Tiger > > yes, I'm sure I insert  the records. > > and the first grid can display, > > 1.all data > {{ =grid}} > > but the second can not! > > 2.al

[web2py] Re: Question about the wiki

2010-05-29 Thread mdipierro
I agree. It needs cleanup. Fox example: >>> class A: ... z=3 ... def f(self): return self.z ... >>> a=A() >>> print a.f() 3 >>> a.z=5 >>> print a.f() 5 >>> b=A() >>> print b.f() 3 >>> print a.f() 5 So z is not quite equivalent to a static member variable in C++. On May 28, 11:15 pm, Doug

[web2py] Re: Filter records based on Subdomain value when running on GAE

2010-05-29 Thread mdipierro
Thanks. On May 28, 12:03 pm, Hala wrote: > Here is the code to print a certain record to match a subdomain or > print all -- in case someone asks: > >    try: >        appname = request.env.http_host.split('.')[0] >        app_id = db(db.app.name > ==str.lower(appname)).select().first().id >    

[web2py] Re: How to duplicate a record

2010-05-29 Thread mdipierro
myrecord = db.table[5] db.table.insert(**db.table._filter_fields(myrecord)) On May 28, 9:30 am, Thadeus Burgess wrote: > myrecord = db.table[5] > > db.table.insert(a = myrecord.a, b = myrecord.b, c = myrecord.c) > > Are you looking for an audit logging ability? > > http://www.web2pyslices.com/mai

[web2py] Re: Group some fields into a

2010-05-29 Thread mdipierro
Mind you also have the new form=SQLFORM(...,formstyle='divs') form=SQLFORM(...,formstyle='table3cols') form=SQLFORM(...,formstyle='table2cols') form=SQLFORM(...,formstyle='ul') On May 28, 3:50 am, Mathieu Clabaut wrote: > Ok... I'll try with that. > > On Fri, May 28, 2010 at 03:11, Candid wrote

[web2py] Re: uploads problem

2010-05-29 Thread mdipierro
This will give you tons of problems: db.image.file.uploadfolder=os.path.join(request.folder,"uploads/%i" % auth.user.company_id) because it breaks download. You can upload in a user defined folde, but donwload does not know where to locate the image form download. On May 28, 2:06 am, annet wro

[web2py] Layout Modification in Login Form

2010-05-29 Thread Ralph Stachulla
Hello, I´m new in web2py and I´m trying to do an user - autification. Everything works fine so far, I did it the way it is described in the web2py book. But now I want to modificate the layout a little bit, the text-fields are too long, I want to have "E-Mail:" and "Password:" in a separate line..

[web2py] Re: auth forms i cant belive this is soooo hard

2010-05-29 Thread Ralph Stachulla
I`ve just had the same problems and now I could fix the problem. But I´ve just one more problem and I hope you can help me. With your code {{=form.costum.begin}} etc. my "Remember My Login"- Checkbox is missing now. It`s defined in the db.py: auth.messages.label_remember_me = " Remember Me" Can

[web2py] Re: New to web app development -- is web2py a good choice

2010-05-29 Thread Robert O'Connor
Some of the cookbooks are handy. What if somebody provided a way to do "wizard" style user interfaces. (I requested information on a separate thread -- which is currently awaiting moderation) There is both a lack of official documentation and even resources of those who've used it! I've done goog

[web2py] "wizard" style forms in web2py

2010-05-29 Thread Robert O'Connor
Hey, I need to implement a "wizard" style form. (things will exist on different screens; each "step" or page will post to the next page and have those values stored and used in the next step. Now here's the problem: there's seems to be very few examples in developing something like this in web2py

[web2py] Re: Hide tables to appadmin based on user permissions

2010-05-29 Thread Richard
very useful - in the past I use appadmin myself and created custom interfaces for my users to edit data. On May 28, 3:16 am, Thadeus Burgess wrote: > This is what I settled with: > > if auth.is_logged_in() \ >         and auth.has_membership('Operations', auth.user.id) \ >         and not auth.h

Re: [web2py] Re: Complicated Join...

2010-05-29 Thread Jason Brower
Perhaps if you broke it down a bit I could get what is going on. For example, it looks like some pretty cool python syntax with. [t.tag for t in tags] I really can't understand what that does but it looks cool. :P I also didn't know you could use or operators in the limitby, spiffy. Thanks for you

[web2py] Re: Plugin_jqgrid problem

2010-05-29 Thread leo
thank you ,Golden Tiger yes, I'm sure I insert the records. and the first grid can display, 1.all data {{ =grid}} but the second can not! 2.all data {{ =grid}} On May 29, 7:32 am, GoldenTiger wrote: > did you insert any record? > > On 28 mayo, 15:28, leo wrote: > > > > > Hi,everyone, i'