Documentation error in base tables

Bug #1392721 reported by Marcos Lobo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
Marcos Lobo

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.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/134526

Changed in horizon:
assignee: nobody → Marcos Lobo (marcos-fermin-lobo)
status: New → In Progress
Changed in horizon:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/134526
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=6df5616551b6c31081d36fd68a79eefb5143c391
Submitter: Jenkins
Branch: master

commit 6df5616551b6c31081d36fd68a79eefb5143c391
Author: Marcos Fermin Lobo <email address hidden>
Date: Fri Nov 14 14:14:35 2014 +0100

    Documentation error in base tables link_classes

    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

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

    Change-Id: I61c1807f61364a152a5a51fcec8e9158dfa7067c
    Closes-Bug: #1392721

Changed in horizon:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in horizon:
milestone: none → kilo-1
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: kilo-1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.