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

Naik, Chinmay cnaik at paypal.com
Sat Feb 23 02:28:17 UTC 2013


Thanks Malini for your idea and suggestions, I added a new function inside class ModalFormView in horizon/forms/views.py to handle my case. It seems to be working fine.

Thanks for your time once again.

-Chinmay Naik

From: "Bhandaru, Malini K" <malini.k.bhandaru at intel.com<mailto:malini.k.bhandaru at intel.com>>
Reply-To: OpenStack Development Mailing List <openstack-dev at lists.openstack.org<mailto:openstack-dev at lists.openstack.org>>
Date: Sat, 23 Feb 2013 00:55:07 +0000
To: OpenStack Development Mailing List <openstack-dev at lists.openstack.org<mailto:openstack-dev at lists.openstack.org>>
Subject: Re: [openstack-dev] [Horizon] Changing success_url at runtime.

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
_______________________________________________ OpenStack-dev mailing list OpenStack-dev at lists.openstack.org<mailto:OpenStack-dev at lists.openstack.org> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130223/1bcabdf0/attachment.html>


More information about the OpenStack-dev mailing list