made interface status value translatable

in the interface table the value of status
column is not translatable.

this patch adding a display choices tuple
with translatable option.

Change-Id: I27f433ebbf4a1c8859024e4379ac1b7322de6cba
Closes-Bug: #1420683
This commit is contained in:
Masco Kaliyamoorthy 2015-02-11 14:47:47 +05:30
parent afc549552e
commit cefbbd4608

View File

@ -94,6 +94,12 @@ DISPLAY_CHOICES = (
("UP", pgettext_lazy("Admin state of a Port", u"UP")),
("DOWN", pgettext_lazy("Admin state of a Port", u"DOWN")),
)
STATUS_DISPLAY_CHOICES = (
("ACTIVE", pgettext_lazy("current status of port", u"Active")),
("BUILD", pgettext_lazy("current status of port", u"Build")),
("DOWN", pgettext_lazy("current status of port", u"Down")),
("ERROR", pgettext_lazy("current status of port", u"Error")),
)
class PortsTable(tables.DataTable):
@ -102,7 +108,9 @@ class PortsTable(tables.DataTable):
link="horizon:project:networks:ports:detail")
fixed_ips = tables.Column(project_tables.get_fixed_ips,
verbose_name=_("Fixed IPs"))
status = tables.Column("status", verbose_name=_("Status"))
status = tables.Column("status",
verbose_name=_("Status"),
display_choices=STATUS_DISPLAY_CHOICES)
device_owner = tables.Column(get_device_owner,
verbose_name=_("Type"))
admin_state = tables.Column("admin_state",