nuxeo-localizer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nuxeo-localizer] Redirects from changeLanguageForm


From: Juan David Ibáñez Palomar
Subject: Re: [Nuxeo-localizer] Redirects from changeLanguageForm
Date: Sat, 06 Apr 2002 15:20:30 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020402 Debian/2:0.9.9-4

I'm not sure this is the right thing to do.

If you look at the Zope's source, you'll find that usually
the actions of forms end with the lines:

if REQUEST is not None:
return self.manage_main(self, REQUEST)

I guess you've done this. I prefer to use a redirect:

if REQUEST is not None:
RESPONSE.redirect('manage_main')

If you use the second approach your problem will disappear. I
guess it will be something like:

def addItems(self, ...., REQUEST, RESPONSE):
....

RESPONSE.redirect('listItems')


If your patch is really needed I'll apply it, but I'd like to
be sure.

Remember also that you can write your own changeLanguage (as
with changeLanguageForm). The goal is not to write a complex
changeLanguage that works 100% of the time, the goal is to
write a simple changeLanguage that works 95% of the time. The
other 5% still can be solved with a custom changeLanguage.



On an indirectly related note, a while ago Milos requested to
add a message "Saved changes." to the ZMI when a LocalContent
content object is changed. This is already in the CVS. Well,
it's unfinished, works for LocalContent but not for the screens
of other objects.



Garikoitz Araolaza wrote:


OK, I know... We only do requests and "feedbacks" ;-) Hopefully we can soon help a little bit with icon design and documentation too...


This is a feature request:

We'd like to control the redirect done by changeLanguage in Localizer.py

An example:

My user is in a folder called ShoppingCart where he came from somewhere else adding an article.

....../ShoppingCart/addItems?item:list=book&item:list=CD

If a user decides to use (as they usually do) the changeLanguageForm in this place, the items 'book' and 'CD' will be added again, as method changeLanguage returns the user to the HTTP_REFERRER

So, it would be nice to have this patch or a similar one in changeLanguage method:

def changeLanguage(self, REQUEST, RESPONSE, return_url=REQUEST['HTTP_REFERER']):
....
RESPONSE.redirect(return_url)

changeLanguageForm should provide the proper value for return_url too:

<dtml-if return_url>
<dtml-with "_[return_url].absolute_url()">
</dtml-if>

We would just have to create an string property in the ShoppingCart folder with the text 'ShoppingCart'


Is that a very particular interest request, or does anybody else find it useful too?

Gari

_______________________________________
Garikoitz Araolaza
Code&Syntax
address@hidden

BIC-Berrilan
Azitaingo Industrialdea
E-20600-EIBAR
Tel: +34 943 82 06 06



_______________________________________________
Nuxeo-localizer mailing list
address@hidden
http://mail.freesoftware.fsf.org/mailman/listinfo/nuxeo-localizer



--
J. David Ib??ez, Nuxeo.com
Zope developer (http://www.zope.org)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]