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.
On szept. 19, 21:00, Yarko Tymciurak <[email protected]> wrote:
> On Sat, Sep 19, 2009 at 1:46 PM, szimszon <[email protected]> wrote:
>
> > Hi All!
>
> > I wonder if somebody could help me.
>
> > I have:
>
> > form=crud.create(db.oklevel_sablon,next=URL
> > (r=request,f='sablonsor_jog',args="[id]"))
>
> > But the next url looks:
> > .../sablonsor_jog/%5Bid%5D
>
> > The "[id]" isn't replaced with the created record's number :(
>
> I think you misread this:   it says:
>
> """
> * next is the URL to redirect to after success.  If the URL [NOTE: NOT the
> CALL to the helper function URL(), but the string of the target URL
> itself!]  contains the substring "[id]" this will be replaced by the id of
> the record currently created/updated
> """
>
> Is this enough of a hint, or do you need an example?
> (Suggestion:  put the output from the URL() call in a variable, don't
> specify "args" in the URL() call, rather catenate "[id]" to what URL() gives
> you)
>
> > I read in the book page 217:
>
> > "• next     is the URL to redirect to after success. If the URL
> > contains the
> >  substring "[id]" this will be replaced by the id of the record
> > currently
> >  created/updated."
--~--~---------~--~----~------------~-------~--~----~
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