Ask Your Question

Adding a drop down tab on Dashboard

asked 2013-10-17 07:43:31 -0500

updated 2013-10-20 09:45:06 -0500

Openstack newbie here. I want to add a new drop down tab in the "Create Network" box that pops up on clicking "+Create Network" in the Networks panel of Admin. I don't have a good experience in Django framework.
I have located the file that has a class CreateNetwork in the path:

class CreateNetwork(forms.SelfHandlingForm):
    name = forms.CharField(max_length=255,
    tenant_id = forms.ChoiceField(label=_("Project"))
    if api.neutron.is_port_profiles_supported():
        net_profile_id = forms.ChoiceField(label=_("Network Profile"))
    admin_state = forms.BooleanField(label=_("Admin State"),
                                     initial=True, required=False)
    shared = forms.BooleanField(label=_("Shared"),
                                initial=False, required=False)
    external = forms.BooleanField(label=_("External Network"),
                                  initial=False, required=False)

    ## The new field
    new_field = forms.ChoiceField(choices=[(1, 'Freemium'), (2, 'Basic'), (3, 'Premium')],
                                           label=_("New Field"))

I added another variable just to see if it is visible in the GUI but it fails. I also tried changing the label names of the fields that was visible, example changing External Network to Network External, to verify if I am in the right file, but the changes were not reflected on the Dashboard.

Can anyone suggest me ways to make changes on the fly such that I can test it's visibility on the dashboard by a normal refresh? Thanks

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-10-18 05:39:09 -0500

jpichon gravatar image

You also need to restart your web server after modifying a Python file (sudo service httpd restart or sudo service apache2 restart), to be able to see the changes. I can see the new field just fine, using what you wrote.

Django also has a development server you can use to see changes directly during development, you can start it with python runserver (this starts the server on port 8000 by default)

See also , for more information.

edit flag offensive delete link more

answered 2015-08-17 04:07:34 -0500

sanjana gravatar image

You can create the drop down by making your class inherit tables.LinkAction in your file. The changes will be reflected only after you run the following commands in the devstack directory to restart the web server. sudo service apache2 start ./

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2013-10-17 07:43:31 -0500

Seen: 772 times

Last updated: Aug 17 '15