← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1392721] [NEW] Documentation error in base tables

 

Public bug reported:

In /horizon/tables/base.py there is a mistake in the documentation here:
https://github.com/openstack/horizon/blob/master/horizon/tables/base.py#L197

"An iterable of CSS classes which will be added when the column's text
is displayed as a link.
This is left for backward compatibility. Deprecated in favor of the
link_attributes attribute.
Example: ``classes=('link-foo', 'link-bar')``.
Defaults to ``None``"

The name of the attribute is "link_classes", not "classes" like the
example suggests. That could be confusing for developers.

For example, if you modify openstack-
dashboard/dashboards/project/images/images/tables.py file and add this:

name = tables.Column(get_image_name_version,
                         link=("horizon:project:images:images:detail"),
                         verbose_name=_("Image Name"),
                         classes=("css-foo","css-bar"))

You expect something like:

<a href="whatever" class="css-foo css-bar">my name</a>

But doesn't work.

** Affects: horizon
     Importance: Undecided
     Assignee: Marcos Lobo (marcos-fermin-lobo)
         Status: In Progress

-- 
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/1392721

Title:
  Documentation error in base tables

Status in OpenStack Dashboard (Horizon):
  In Progress

Bug description:
  In /horizon/tables/base.py there is a mistake in the documentation
  here:
  https://github.com/openstack/horizon/blob/master/horizon/tables/base.py#L197

  "An iterable of CSS classes which will be added when the column's text
  is displayed as a link.
  This is left for backward compatibility. Deprecated in favor of the
  link_attributes attribute.
  Example: ``classes=('link-foo', 'link-bar')``.
  Defaults to ``None``"

  The name of the attribute is "link_classes", not "classes" like the
  example suggests. That could be confusing for developers.

  For example, if you modify openstack-
  dashboard/dashboards/project/images/images/tables.py file and add
  this:

  name = tables.Column(get_image_name_version,
                           link=("horizon:project:images:images:detail"),
                           verbose_name=_("Image Name"),
                           classes=("css-foo","css-bar"))

  You expect something like:

  <a href="whatever" class="css-foo css-bar">my name</a>

  But doesn't work.

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


Follow ups

References