mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-22 23:46:44 -06:00
Support translation for column name
This commit is contained in:
parent
02c2d9f378
commit
ce6d642cb4
@ -96,12 +96,13 @@ Plugins can register their own custom columns on core tables using the `register
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
import django_tables2
|
import django_tables2
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from dcim.tables import SiteTable
|
from dcim.tables import SiteTable
|
||||||
from utilities.tables import register_table_column
|
from utilities.tables import register_table_column
|
||||||
|
|
||||||
mycol = django_tables2.Column(
|
mycol = django_tables2.Column(
|
||||||
verbose_name='My Column',
|
verbose_name=_('My Column'),
|
||||||
accessor=django_tables2.A('description')
|
accessor=django_tables2.A('description')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user