1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

initial pass on migrating to custom tag model with color and comments fields

This commit is contained in:
John Anderson
2019-02-20 03:52:47 -05:00
parent e521508de9
commit fc2bb724fa
32 changed files with 524 additions and 63 deletions

View File

@ -1,9 +1,8 @@
import django_tables2 as tables
from django_tables2.utils import Accessor
from taggit.models import Tag, TaggedItem
from utilities.tables import BaseTable, BooleanColumn, ToggleColumn
from .models import ConfigContext, ObjectChange
from utilities.tables import BaseTable, BooleanColumn, ColorColumn, ToggleColumn
from .models import ConfigContext, ObjectChange, Tag, TaggedItem
TAG_ACTIONS = """
{% if perms.taggit.change_tag %}
@ -71,10 +70,11 @@ class TagTable(BaseTable):
attrs={'td': {'class': 'text-right'}},
verbose_name=''
)
color = ColorColumn()
class Meta(BaseTable.Meta):
model = Tag
fields = ('pk', 'name', 'items', 'slug', 'actions')
fields = ('pk', 'name', 'items', 'slug', 'color', 'actions')
class TaggedItemTable(BaseTable):