then perhaps crud.*   next=.... [id]  behavior should be reviewed?

On Mon, Sep 21, 2009 at 4:08 PM, mdipierro <[email protected]> wrote:

>
> because in web2py request.args are optional I think it is dangerous to
> have relative URLs that do not start with '/'.
> web2py assumes that if a url does not start with '/' that is an
> extenal URL (starts with http:, ftp: etc.)
>
> On Sep 21, 11:20 am, Yarko Tymciurak <[email protected]> wrote:
> > sounds like this needs to be straightened out;  probably deserves some
> > discussion (as Iceberg suggests)...
> >
> > Massimo - can you add your thoughts to this?
> >
> > On Sun, Sep 20, 2009 at 4:09 AM, Iceberg <[email protected]> wrote:
> >
> > > On Sep20, 4:28pm, szimszon <[email protected]> wrote:
> > > > I'm a bit puzzled :(
> >
> > > > I modified the code:
> >
> > > > n=str(URL(r=request,f='sablonsor_jog')+'/[id]')
> > > > sablon_sor=crud.create(db.oklevel_sablon,next=n)
> >
> > > > but it's not working. Type of 'n' is 'str'.
> >
> > > > And the
> >
> > > > n='/borverseny/adatok/sablonsor_jog'+'/[id]'
> >
> > > > doesn't work either.
> >
> > > > But
> >
> > > > n='borverseny/adatok/sablonsor_jog'+'/[id]'
> >
> > > > works. So I think the point is that if the url string begins with the
> > > > '/' then the replace doesn't work. If the url begins not with '/'
> than
> > > > everything is working right.
> >
> > > Yeah, I met same problem before. It is all because web2py's gluon/
> > > tools.py does the "[id]" magic ONLY for a url NOT begins with the '/'.
> > > The source code has many snippets like this.
> >
> > >                if next and not next[0] == '/' and next[:4] != 'http':
> > >                    next = self.url(next.replace('[id]', str
> > > (form.vars.id)))
> >
> > > I don't know the reason for requiring a leading '/'. Perhaps Massimo
> > > will tell us more.
> >
> > > Sincerely,
> > > Iceberg
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to