[openstack-dev] Horizon Issue
Kieran Spear
kispear at gmail.com
Wed Nov 13 02:11:36 UTC 2013
Hi,
On 13 November 2013 12:54, K S <khyatitp at gmail.com> wrote:
> Hi I'm a newbie to horizon and I'm working on a trove related issue.
> My use case is that on successful execution of the "workflow" in
> trove, I need to redirect the workflow to a view. Additionally I want
> to pass a couple of parameters from the workflow to the chained view.
>
> I have tried the following approaches till now :
>
> - set the success_url in workflow. This redirects me to the view,
> however I am unable to pass parameters.
You can define a get_success_url() method on your workflow and return
the URL you want. There's an example here:
https://github.com/openstack/horizon/blob/7a51bc7ddd57b39f4389e84ac77bd2dc98c9a3cd/openstack_dashboard/dashboards/project/networks/subnets/workflows.py#L69-L71
class CreateSubnet(network_workflows.CreateNetwork):
<snip>
def get_success_url(self):
return reverse("horizon:project:networks:detail",
args=(self.context.get('network_id'),))
Hope that helps,
Kieran
>
> - 'return redirect() ' in the "handle" method of the workflow. This
> does not help as expected output of the handle method is a boolean.
>
> Please help me if I am missing some concepts here. Or if this is a
> limitation of the workflow. Can I redirect a workflow (passing
> parameters) to a view? I know we can easily achieve this behavior with
> forms but not sure if this is possible with workflows in horizon.
>
> Your help will be highly appreciated.
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
More information about the OpenStack-dev
mailing list