← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1278956] [NEW] Table rendering broken for certain objects

 

Public bug reported:

The patch that was submitted for Bug #1203391
(https://bugs.launchpad.net/horizon/+bug/1203391) introduced a slight
refactoring of the Column.get_raw_data method
(https://github.com/openstack/horizon/commit/abb76704d014eab68dc0aabe6c8d1d0d762e56e9#diff-0).
Specifically, the ordering of the Dict lookup and basic object lookup
was reversed.

Unfortunately, this results in errors for certain objects that may want
to be rendered in a table. Any object which is iterable will be treated
as a dictionary. However, an error will be raised if that object doesn't
also implement a 'get' method (called on line 312). I have a few pages
which use tables to display data from mongoengine-based models -- these
models are iterable, but do NOT implement a get method and are now
resulting in errors when rendered in a table.

  File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 1553, in get_rows
    row = self._meta.row_class(self, datum)
  File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 477, in __init__
    self.load_cells()
  File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 503, in load_cells
    cell = table._meta.cell_class(datum, column, self)
  File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 592, in __init__
    self.data = self.get_data(datum, column, row)
  File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 628, in get_data
    data = column.get_data(datum)
  File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 339, in get_data
    data = self.get_raw_data(datum)
  File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 308, in get_raw_data
    if callable(self.transform):
AttributeError: 'Application' object has no attribute 'get'

** Affects: horizon
     Importance: Undecided
     Assignee: Brian DeHamer (brian-dehamer)
         Status: New

** Changed in: horizon
     Assignee: (unassigned) => Brian DeHamer (brian-dehamer)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1278956

Title:
  Table rendering broken for certain objects

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  The patch that was submitted for Bug #1203391
  (https://bugs.launchpad.net/horizon/+bug/1203391) introduced a slight
  refactoring of the Column.get_raw_data method
  (https://github.com/openstack/horizon/commit/abb76704d014eab68dc0aabe6c8d1d0d762e56e9#diff-0).
  Specifically, the ordering of the Dict lookup and basic object lookup
  was reversed.

  Unfortunately, this results in errors for certain objects that may
  want to be rendered in a table. Any object which is iterable will be
  treated as a dictionary. However, an error will be raised if that
  object doesn't also implement a 'get' method (called on line 312). I
  have a few pages which use tables to display data from mongoengine-
  based models -- these models are iterable, but do NOT implement a get
  method and are now resulting in errors when rendered in a table.

    File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 1553, in get_rows
      row = self._meta.row_class(self, datum)
    File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 477, in __init__
      self.load_cells()
    File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 503, in load_cells
      cell = table._meta.cell_class(datum, column, self)
    File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 592, in __init__
      self.data = self.get_data(datum, column, row)
    File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 628, in get_data
      data = column.get_data(datum)
    File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 339, in get_data
      data = self.get_raw_data(datum)
    File "/adminui/.venv/local/lib/python2.7/site-packages/horizon/tables/base.py", line 308, in get_raw_data
      if callable(self.transform):
  AttributeError: 'Application' object has no attribute 'get'

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1278956/+subscriptions


Follow ups

References