[openstack-dev] horizon table display question

Gabriel Hurley Gabriel.Hurley at nebula.com
Tue Aug 28 21:44:25 UTC 2012


Feeding in a list of dictionaries is supported, though in general DataTables are set up to support objects, so you may have to do a little extra work to get the data from the dict lookup instead of an attribute on the dict. As far as your specific question about ids, take a look at the get_object_id and get_object_display methods on the table, which you'll definitely want to override:

http://docs.openstack.org/developer/horizon/ref/tables.html#horizon.tables.DataTable.get_object_id
http://docs.openstack.org/developer/horizon/ref/tables.html#horizon.tables.DataTable.get_object_display

All the best,

    - Gabriel


> -----Original Message-----
> From: Bhandaru, Malini K [mailto:malini.k.bhandaru at intel.com]
> Sent: Tuesday, August 28, 2012 1:40 AM
> To: openstack-dev at lists.openstack.org
> Subject: [openstack-dev] horizon table display question
> 
> Hello All!
> 
> I have an api call that will return a dictionary .. {u'trusted_compute': u'true',
> u'num_colors': u'5'} Would it be possible to directly display dictionaries as a
> table, columns being key and value Or does one have to create a wrapper
> class and then return a list of these wrapper classes to meet the "id"
> requirement.
> 
> Regards
> Malini
> 
> _______________________________________________
> 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