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

Standardize add, import, and export functionality for tags

This commit is contained in:
Jeremy Stretch
2020-06-12 09:48:23 -04:00
parent 057a022205
commit da906f48d9
7 changed files with 58 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
from django import forms
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.utils.safestring import mark_safe
from mptt.forms import TreeNodeMultipleChoiceField
from taggit.forms import TagField as TagField_
@@ -161,6 +162,17 @@ class TagForm(BootstrapMixin, forms.ModelForm):
]
class TagCSVForm(CSVModelForm):
slug = SlugField()
class Meta:
model = Tag
fields = Tag.csv_headers
help_texts = {
'color': mark_safe('RGB color in hexadecimal (e.g. <code>00ff00</code>)'),
}
class AddRemoveTagsForm(forms.Form):
def __init__(self, *args, **kwargs):