Bug 1041989 - [RFE][horizon]: DataTable with support for Django Formset
Summary: [RFE][horizon]: DataTable with support for Django Formset
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-django-horizon
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Upstream M2
: 5.0 (RHEL 7)
Assignee: RHOS Maint
QA Contact: Ido Ovadia
URL: https://blueprints.launchpad.net/hori...
Whiteboard: upstream_milestone_icehouse-2 upstrea...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-12 20:27 UTC by RHOS Integration
Modified: 2014-09-08 05:42 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-08 15:43:24 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2014:0855 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Enhancement - Dashboard 2014-07-08 19:33:24 UTC

Description RHOS Integration 2013-12-12 20:27:39 UTC
Cloned from launchpad blueprint https://blueprints.launchpad.net/horizon/+spec/formset-data-table.

Description:

DataTable is an excellent way to display tabular data, and Django Formsets are an excellent way to input tabular data -- but there seems to be no easy way to use them together. There should be a way to associate a DataTable with a Formset, so that they are both fed with the same initial data and displayed consistently.

This solves a somewhat different (but related) problem to that solved by https://blueprints.launchpad.net/horizon/+spec/inline-table-editing and https://blueprints.launchpad.net/horizon/+spec/inline-table-add-remove-rows which allow you to edit an existing data table. With a Formset-enabled data table you can do more:

* Input completely new data that is not kept anywhere yet until the form is submitted. An example of use case where we actually use that in Tuskar is the Resource Class creation dialog, where the user has to specify the Flavors for the new Resource Class -- since the Resource Class being created doesn't exist yet, you can't really do AJAX-based editing of data.
* Extend existing data with additional information -- for example, again in Resource Class creation dialog in Tuskar, we display a list of available Racks, with an additional column with checkboxes for selecting which Racks should be included in the newly created Resource Class.

The basic idea is that we use a mixin to DataTable, which allows us to specify the Formset class to use. The formset is created together with the DataTable instance, and populated with the data taken from the column data (the fields to be populated have to be named the same as the columns) and the POST data. Then, when the DataTable is rendered, the columns that correspond to fields from the formset have the corresponding widgets rendered instead of the plain data in them. Any validation errors are also displayed. Then you can get the Formset instance for the DataTable instance, validate it and get all the data from it.

There is also some additional (optional) JavaScript for making it easier to add and delete rows of the table.

I'm sure that this would be useful in many places in Horizon in general, not just in Tuskar, so I would like to include it.

Specification URL (additional information):

None

Comment 2 Stephen Gordon 2014-01-23 20:51:10 UTC
Moving to POST based on upstream status (Implemented).

Comment 3 Ido Ovadia 2014-03-23 15:10:48 UTC
Does it need QE verificaton?
If yes, please provide any steps

Comment 4 Matthias Runge 2014-03-25 14:15:43 UTC
This implements infrastructure for development. IMHO, no QE verification required.

Comment 6 Ido Ovadia 2014-04-13 13:04:33 UTC
Regression passed

Comment 8 errata-xmlrpc 2014-07-08 15:43:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2014-0855.html


Note You need to log in before you can comment on or make changes to this bug.