Revision history [back]

click to hide/show revision 1
initial version

Adding a column to horizon instances table


we are in the process setting up an Openstack platform for internal use, and I would like to add some information to the instances table, namely the external FQDN associated with the instance's floating IP (if present, obviously).

My first idea was to override the InstancesTable class to add that column, but I'm having trouble with that (probably related to my being a complete python/django newbie). I can manipulate the column order through the Meta class just fine, but trying to add a column yields the following error :

AttributeError: 'module' object has no attribute 'Column'

Here's my override code :

from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard.dashboards.project.instances import tables
from openstack_dashboard.dashboards.project.instances import views

class MyInstancesTable(tables.InstancesTable):
    pubname = tables.Column("pubname", 
                                verbose_name=_("Public name"))

views.IndexView.table_class = MyInstancesTable

So, my questions, in order, are : - is extending the default instances table the best way to achieve my goals, or should I create a brand new data table? - what am I missing with this table override?

Thanks in advance,