List Info

Thread: redirect vs return




redirect vs return
user name
2006-03-14 19:14:49
got_milk_ehyahoo.com wrote:
> Hi, in my cherrypy app I have a number of functions
that do some
> processing and either return some results or call
another function to
> display the results.  So far I've been using
internalredirect
> (cherrypy.InternalRedirect("/display",
results) to call the display
> functions, passing the results.  However return (return
> display(results)) can also work by calling the display
function and
> again passing the results.  The trouble with
internalredirect 
> is having
> to pass the html path to access a function versus
return using the
> function name.  Which is the suggested/best method to
use?  Thanks,

IMO the latter is best. InternalRedirect is a fine technique
for Apache,
where everything must be specified declaratively; when
you've already
got Python, why not just call the display function directly?

To devs: Personally, I would not mind if we dropped
InternalRedirect in
a future release.



Robert Brewer
System Architect
Amor Ministries
fumanchuamor.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

redirect vs return
user name
2006-03-15 17:14:22
I've been using the following for redirects:

raise cherrypy.HTTPRedirect(url)

It however seems rather inefficient (if my understanding is
correct).
Is there a way to forward to a different url without having
to do
another round turn with the browser.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )