[openstack-dev] [Horizon] Changing success_url at runtime.

Bhandaru, Malini K malini.k.bhandaru at intel.com
Sat Feb 23 00:55:07 UTC 2013


Chinmay - you could define a "get_success_url(self)" method in the view, see examples in /opt/stack/horizon/openstack_dashboard/dashboards/project/access_and_security/keypairs/views.py.
If you could access your form fields and their values therein, you would be all set to take the user to different pages.
Also check Django website to see if there is help there. Django is the framework underlying Horizon.
Regards
Malini

From: Naik, Chinmay [mailto:cnaik at paypal.com]
Sent: Friday, February 22, 2013 3:16 PM
To: OpenStack Development Mailing List
Subject: [openstack-dev] [Horizon] Changing success_url at runtime.

Hi All,

Wanted to know if there is a way to change the success_url attribute in my view (inheriting from forms.ModalFormView) based on a specific user input, selected on the corresponding form ?

Using my new view, user will be displayed a form(inheriting from forms.SelfHandlingForm) with a drop down list. The user selects a value in the drop down list which can be known in the handle() of that form. Depending on what user selected, how can I change the 'success_url' attribute of my view to take him to different urls depending on the input selected. Is it possible to change the 'success_url' from the forms handle() func ?

Any help is much appreciated. Thanks for your time.

Thanks,
Chinmay Naik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130223/df60953d/attachment.html>


More information about the OpenStack-dev mailing list