[web2py] Re: unicode support for args

2011-10-25 Thread Pawel Jasinski
On Oct 26, 5:25 am, Jonathan Lundell wrote: > On Oct 25, 2011, at 2:06 PM, Pawel Jasinski wrote: > > > hi, > > > thanks! That solved my ~ problem. > > > Unfortunately for my öäü (chars above 128 and below 255 in latin-1) I > > still need to overcome 2 challenge

[web2py] Re: unicode support for args

2011-10-25 Thread Pawel Jasinski
acceptable? 2. at some point before match call args have to be subjected to decode('utf-8') to become unicode Any suggestions? --Pawel On Oct 25, 9:18 pm, Jonathan Lundell wrote: > On Oct 25, 2011, at 11:57 AM, Pawel Jasinski wrote: > > > hi, > > >> of directory

[web2py] Re: unicode support for args

2011-10-25 Thread Pawel Jasinski
hi, > of directory traversal attacks (~ specifically). how exactly? I am talking about arguments and only arguments. I agree that ~ in case of application/controller/method makes no sense In case of static agree 100%, but that is different control path. The arguments are just that, arguments. If

[web2py] unicode support for args

2011-10-25 Thread Pawel Jasinski
hi all, I have discovered that args in url are restricted to ascii. In addition tilde (~) is also not considered valid in arguments. I am using rest mapping @request.restful() where as far as I can tell there is no technical reason to restrict args (RFC 3986). I also found similar limitation for h

Re: [web2py] Re: vars vs. kwargs

2011-06-09 Thread Pawel Jasinski
believe it is a bad idea to give variable a name which matches name of the build-in function cheers, pawel On Thu, Jun 9, 2011 at 3:26 PM, Massimo Di Pierro wrote: > I do not understand. :-( > > On Jun 9, 3:21 am, Pawel Jasinski wrote: >> hi, >> it is cosmetic, but can be a p

[web2py] vars vs. kwargs

2011-06-09 Thread Pawel Jasinski
hi, it is cosmetic, but can be a pain for someone no so familiar with python. In examples for restful api: def index(): def GET(*args,**vars): patterns = [ "/persons[person]", "/{person.name.startswith}", "/{person.name}/:field", "/{perso

Re: [web2py] Re: postgress outer join

2011-05-01 Thread Pawel Jasinski
es) if groupby: if isinstance(groupby, (list, tuple)): groupby = xorify(groupby) On Fri, Apr 29, 2011 at 3:53 PM, Massimo Di Pierro wrote: > Can you please try: > > db(db.first.id.belongs(db()._select(db.second.r12_first_id))) > .select(db.first.ALL,d

Re: [web2py] Re: postgress outer join

2011-04-29 Thread Pawel Jasinski
.ALL, > left= [ > db.second.on(db.first.id==db.second.r12_first_id), > db.third.on(db.third.r13_first_id==db.first.id), > db.fourth.on(db.fourth.r14_second_id==db.second.id), > ]) > > > > On Apr 28, 2:22 pm, Pawel Jasinski wrote: >> hi, >> >> this a

[web2py] Re: postgress outer join

2011-04-29 Thread Pawel Jasinski
hi, short update > I could use executesql, but is there an easy way to reconnect the > result of executesql into the rows returned by db(...).select(...)? As a work around I do the following: 0. modify DAL so select( ) accepts extra parameter to overwrite generated sql 1. develop and test with s

[web2py] postgress outer join

2011-04-28 Thread Pawel Jasinski
hi, this appears to be an old issue already discussed and marked as solved: http://groups.google.com/group/web2py/browse_thread/thread/d7f5e5820176813/4d990c3c7475c48b http://groups.google.com/group/web2py/browse_thread/thread/f4ef82fd34371863/8e7a741d676cea6e but, I got it again :-( Here is my m

[web2py] Re: SQLFORM and read-only references

2011-01-26 Thread Pawel Jasinski
Hi, > Are you sure you want the form readonly? Yes > What if you remove readonly? The 'None' changes into drop down with ids or whatever is in the format argument of the field. > If you want readonly you do not need accepts Good point, changed. It does not help with the main problem. I also hav

[web2py] Re: SQLFORM and read-only references

2011-01-26 Thread Pawel Jasinski
=SQLFORM(db.bar,record,readonly=True) >     if form.accepts(request.vars,session): >         session.flash="accepted" >     return dict(form=form) > > On Jan 26, 10:37 am, Pawel Jasinski wrote: > > > Hi, > > > I just hit the same problem and can repro

[web2py] Re: SQLFORM and read-only references

2011-01-26 Thread Pawel Jasinski
Hi, I just hit the same problem and can reproduce in trivial case in model: db.define_table('foo', Field('x')) db.define_table('bar', Field('label'), Field('ref',db.foo)) in controller: def insertone(): id=db.foo.insert(x="xxx") db.bar.insert(label="label",ref=id) def index(): recor

[web2py] multiple SQLFORM.factory per page

2010-12-27 Thread Pawel Jasinski
hi, when I try to put multiple forms generated with SQLFORM.factory things act a bit odd. #controller def index(): form1 = SQLFORM.factory(Field('a')) if form1.accepts(request.vars, session) : print "form1 accepted" form2 = SQLFORM.factory(Field('b')) if form2.accepts(req