1.74.5 is OUT

6 views
Skip to first unread message

mdipierro

unread,
Dec 30, 2009, 4:58:10 PM12/30/09
to web2py-users
What's new?

- bug fixes
- auth.user_id (shortcut for auth.user.id that defaults to None if not
logged it)
- support for all native types on Google App Engine (for example
StringListProperty)
- restored python 2.4 support,thanks ont.rif
- cache.ram usage statictics, thanks Thadus
- no more auth manu in scaffolding
- no more spash screen with -Q
- fixed doctest in html.py, thanks Anand Vaidya
- export_to_csv_file has represent, thanks Thadeus

szimszon

unread,
Dec 31, 2009, 5:24:24 AM12/31/09
to web2py-users
Hello!

Possible I found a bug.

It's the "[id]" thing with crud next url...

Before:

url: http://127.0.0.1:8000/borverseny/adatok/sablonok

controllers/adatok.py:

def sablonok():
...
n='sablonsor_jog/[id]'
sablon_sor=crud.create(db.oklevel_sablon,
message=T("Oklevél sablonsor felvéve"),
next=n)
The resulted url was: http://127.0.0.1:8000/borverseny/adatok/sablonok/sablonsor_jog/7

Now:

url: http://127.0.0.1:8000/borverseny/adatok/sablonok

controllers/adatok.py:

def sablonok():
...
n='sablonsor_jog/[id]'
sablon_sor=crud.create(db.oklevel_sablon,
message=T("Oklevél sablonsor felvéve"),
next=n)
The resulted url now: http://127.0.0.1:8000/borverseny/default/sablonsor_jog/7

http://127.0.0.1:8000/borverseny/adatok/sablonok/sablonsor_jog/7 <- OK
http://127.0.0.1:8000/borverseny/default/sablonsor_jog/7 <-
Error

mdipierro

unread,
Dec 31, 2009, 10:52:17 AM12/31/09
to web2py-users
The correct behaviour is the latter. Which version ever caused the
former behavior?

Massimo

On Dec 31, 4:24 am, szimszon <szims...@gmail.com> wrote:
> Hello!
>
> Possible I found a bug.
>
> It's the "[id]" thing with crud next url...
>
> Before:
>
> url:http://127.0.0.1:8000/borverseny/adatok/sablonok
>
> controllers/adatok.py:
>
> def sablonok():
> ...
> n='sablonsor_jog/[id]'
> sablon_sor=crud.create(db.oklevel_sablon,
>                        message=T("Oklevél sablonsor felvéve"),
>                        next=n)
> The resulted url was:http://127.0.0.1:8000/borverseny/adatok/sablonok/sablonsor_jog/7
>
> Now:
>
> url:http://127.0.0.1:8000/borverseny/adatok/sablonok
>
> controllers/adatok.py:
>
> def sablonok():
> ...
> n='sablonsor_jog/[id]'
> sablon_sor=crud.create(db.oklevel_sablon,
>                        message=T("Oklevél sablonsor felvéve"),
>                        next=n)
> The resulted url now:http://127.0.0.1:8000/borverseny/default/sablonsor_jog/7
>

> http://127.0.0.1:8000/borverseny/adatok/sablonok/sablonsor_jog/7<- OKhttp://127.0.0.1:8000/borverseny/default/sablonsor_jog/7        <-

guruyaya

unread,
Dec 31, 2009, 9:11:30 PM12/31/09
to web2py-users
Did you update Mercurial?

szimszon

unread,
Jan 1, 2010, 6:25:54 AM1/1/10
to web2py-users
There is a small thread about the behavior of the [id]:

http://groups.google.com/group/web2py/browse_frm/thread/eca9b3d5e71c32f0/3f87cba2c93f5c2c?lnk=gst&q=%5Bid%5D#3f87cba2c93f5c2c

which says to me that:

If I call crud with the
http://127.0.0.1:8000/borverseny/adatok/sablonok
url, the next="sablonsor_jogok/[id]", then I get
http://127.0.0.1:8000/borverseny/adatok/sablonok/sablonsor_jogok/7
and _not_:
http://127.0.0.1:8000/borverseny/default/sablonsor_jogok/7
which is the result now.

So why is the controller replaced from the calling controller to the
default controller and removed the calling function?

With the Version 1.74.3 (2009-12-16 15:11:54) I got
http://127.0.0.1:8000/borverseny/adatok/sablonok/sablonsor_jogok/7


On the other thread:

"12. Yarko Tymciurak
További lehetőségek 2009 szept. 23, 20:01

On Wed, Sep 23, 2009 at 1:53 PM, szimszon <szims...@gmail.com> wrote:
> Okay :)
> I'm not particular good in English but in:
> "• 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."
> is nowhere that the URL must not contain '/' in the first place.


... thanks for the correction ... also, must not be absolute path...
"

So if the next "must not be absoulte path" then it's I think the
expected behavior that the next is just written after the original URL
so the original controller's function can handle it...

Thanks for the prompt replay and a Happy New Year to Everyone! :)

mdipierro

unread,
Jan 1, 2010, 12:24:30 PM1/1/10
to web2py-users
You are right. There was an ambiguity in the previous version that
made it behave in different ways in different cases. You you can
specify this behavior:

auth.settings.controller ='adatok'

You can also set

auth.settings.controller =None

to make the controller to be the same as the one of the calling
action.


On Jan 1, 5:25 am, szimszon <szims...@gmail.com> wrote:
> There is a small thread about the behavior of the [id]:
>

> http://groups.google.com/group/web2py/browse_frm/thread/eca9b3d5e71c3...

szimszon

unread,
Jan 1, 2010, 12:44:23 PM1/1/10
to web2py-users
You mean
crud.settings.controller ='adatok'
?

Or what is the relation of auth and the next [id] thing? What if I
doesn't have auth at all?

If I understand it well then the crud "next" parameter's relative path
is the uri's part after the application and the default controller:

So the expected behavior is:
http[s]://<domain.tld>[:portnumber]/application/<[crud|
auth]?.settings.controller>/<next>

and not:
http[s]://<domain.tld>[:portnumber]/application/<contoller of the
function the crud in it>/<the function where the crud is>/<next>

It's a bit weird to me. :-o And not backward compatible :(

mdipierro

unread,
Jan 1, 2010, 3:37:32 PM1/1/10
to web2py-users
Sorry you are right.

crud.settings.controller ='adatok'

next can have three possible values:
1) a full url starting with http://
2) an absolute url starting with /
3) a function/args than it is relative to /application/controller/
where controller is crud.settings.controller

If in some early version it behaved differently in case 3 that was a
bug.

Massimo

szimszon

unread,
Jan 1, 2010, 3:59:52 PM1/1/10
to web2py-users
Okay it's clear now. I have to modify my app then... :-o I have to say
that it's better now :) But it's not right documented it the book :-o

Thanks anyway.

Reply all
Reply to author
Forward
0 new messages