transfering to a different url without using redirect.

0 views
Skip to first unread message

axh...@gmail.com

unread,
May 3, 2009, 3:42:53 PM5/3/09
to juno-framework
Hi!

I have a simple webapp
-------------
from juno import *

init({'use_sessions':True, 'dev_port':8090, 'use_templates':True,
'template_lib': 'mako'})

@route("/test1")
def test1(web):
return 'test1'

@route("/test2")
def test2(web):
# do something
return test1(web)

if __name__ == '__main__':
run()
--------------

When I access /test2 I get

Internal Server Error
Explanation: (<type 'exceptions.TypeError'>, TypeError("'NoneType'
object is not callable",), <traceback object at 0x90b7edc>)

How do I redirect /test2 to /test1 without using redirect() (a round
trip)

Ashish
How do I redirect? I don't

Stefan Scholl

unread,
May 10, 2009, 11:14:03 AM5/10/09
to juno-framework
Hi Ashish!

How about this (instead of redirects):

def test():
return "test"

@route("/test1")
def test1(web):
return test()

@route("/test2")
def test2(web):
# do something
return test()


Regards,
Stefan

Brian

unread,
May 11, 2009, 6:04:01 AM5/11/09
to juno-framework
Hmm, this seems strange. Something must be wrong with the decorators
because the functions are None even in a python shell session. I'll
take a look at it tomorrow, heading off to bed now.

-- Brian

axh...@gmail.com

unread,
May 12, 2009, 6:56:01 PM5/12/09
to juno-framework
Yes, this is possible and I have done something similar. I posted this
because I think this should be possible. If not, I would like to know
why.

Ashish
Reply all
Reply to author
Forward
0 new messages