Ask Your Question

Changing a form on Horizon [closed]

asked 2014-05-21 04:52:07 -0500

iceman gravatar image

updated 2014-05-22 01:58:57 -0500

*I want to change the Create Volume form in Horizon, i.e. i want to add a new field to the already existing ones.

*I have typed in a separate python script for it because i dont want to change the existing Horizon code.

*Added a 'customization-module' field in as follows:

'customization_module': 'openstack_dashboard.dashboards.project.volume.myfilename.overrides'

and added the path of my file to WSGIDaemonProcess in Apache's Horizon Config file just like it is stated in ( .

*Is this all that i need to do? coz i cant see the changes, seems like iv missed out on something or am i doing it the wrong way? Would really appreciate it if someone can guide me through.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by iceman
close date 2014-05-28 07:08:49.000547

2 answers

Sort by ยป oldest newest most voted

answered 2014-05-28 07:07:43 -0500

iceman gravatar image

updated 2014-05-28 07:11:12 -0500

thanks a ton @jpichon. i managed to override the "create volume" form as well. you're right, the call to a form does go through "". what i did was i created a separate file for my form and just made the following changes in "":

from openstack_dashboard.dashboards.project.volumes.mycreateform import CreateForm as ProjectCreateForm

from openstack_dashboard.dashboards.project.volumes.views import CreateView as xyz


These 3 lines did it. "CreateForm" is my class in the file "" file. I dont know if this the correct way to do it, but for now it works pretty good.

edit flag offensive delete link more


Sweet, glad it worked!

jpichon gravatar imagejpichon ( 2014-05-28 09:52:44 -0500 )edit

answered 2014-05-21 07:20:44 -0500

jpichon gravatar image

You might want to update the question to include pieces of code and paths. Where did you put your 'overrides' file? (Note that in this case it means the file name is "". If you called it "" or something else this is what you should include instead).

Looking at the Customisation documentation at , I would pay particular attention to the way it advises getting to the existing panels (e.g. settings.get_panel("user")) in order to make sure you're overriding the existing panels rather than redefining elements without actually hooking the new code into the existing dashboards/panels.

In any case, code examples would help to help you better!

edit flag offensive delete link more


The file was exactly what i was confused about. I was under the impression that its a file that is required and that i havn't created it. If not required, il change the dotted path in 'customization-module' as you mentioned, till just my filename. And if required, what should be in it?

iceman gravatar imageiceman ( 2014-05-22 01:59:21 -0500 )edit

And about overriding the existing panels, I really dont require all of it. I mainly need to change the 'create volume' form that appears. Isnt there a way to just do that? Like, creating my own python script for the form, overriding the existing one, without having to change any other components.

iceman gravatar imageiceman ( 2014-05-22 02:06:20 -0500 )edit

The file does not need to be called that or be placed in "my_project". Just make sure the path to the script in "customization_module" is set properly. I think the top level in that path should be one of the dashboards that is imported in the INSTALLED_APPS or the plug-in system.

jpichon gravatar imagejpichon ( 2014-05-27 08:22:31 -0500 )edit

You can of course only overrides as much or as little as you need, all the panel customisation pieces in the documentation are only there to serve as helpful examples. Good luck!

jpichon gravatar imagejpichon ( 2014-05-27 08:24:29 -0500 )edit

@jpichon thanks a lot julie. i figured out the problem. i hadnt created an "" file at all. i created one and changed the paths in "customization_module" to it. so overriding now works fine for a few examples. but my objective of overriding the create-form remains. trying to figure that.

iceman gravatar imageiceman ( 2014-05-28 00:57:11 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-05-21 04:52:07 -0500

Seen: 233 times

Last updated: May 28 '14