Sorry. I butchered the code when I was trying to make it an example.
It was self.login() . I'm saying this does not work, but I think it is a fairly
common case, i.e. some logic within a method causes you to want to
goto/call/transfer to a different method (usually based on user inputs). I
understand it is not considered a good idea (esp. with foo.html being rendered
under bar), but I'm not sure I buy the arguments. It is not supposed to be
specifically a 'login' example.
So trying to clean up my braindamaged pseudocode:
class AController(BaseController):
def foo(self):
#do stuff
print 'in foo'
return render("/foo.html")
def bar(self):
'v' in request.params or self.foo() # foo should not return, it
is calling render
print 'what am i doing here?'
v = request.params['v'] #attribute error if I visit
http://localhost/pylons/a/bar/. Why doesn't it render foo?
#continue doing stuff
However this code prints 'in foo' then 'what am I doing here?' and I think its
because the request cycle is getting things confused (kind of jumping into
another one before finishing first). While perhaps not a bug (but I'm not sure
of that, it is indeterminate what will happen), it could be handled better and
would be if I could throw out the response so far and restart with the new
method (be more performant as well).
But I'm no expert.
And thanks for responses. Muchos appreciated but still wondering.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en.