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

Rename Tag.comments to description

This commit is contained in:
Jeremy Stretch
2020-03-13 17:00:00 -04:00
parent 1a8554fd32
commit d4f6909859
8 changed files with 40 additions and 25 deletions

View File

@@ -91,7 +91,7 @@ class TagSerializer(ValidatedModelSerializer):
class Meta:
model = Tag
fields = ['id', 'name', 'slug', 'color', 'comments', 'tagged_items']
fields = ['id', 'name', 'slug', 'color', 'description', 'tagged_items']
#

View File

@@ -144,12 +144,11 @@ class CustomFieldFilterForm(forms.Form):
class TagForm(BootstrapMixin, forms.ModelForm):
slug = SlugField()
comments = CommentField()
class Meta:
model = Tag
fields = [
'name', 'slug', 'color', 'comments'
'name', 'slug', 'color', 'description'
]
@@ -181,9 +180,13 @@ class TagBulkEditForm(BootstrapMixin, BulkEditForm):
required=False,
widget=ColorSelect()
)
description = forms.CharField(
max_length=200,
required=False
)
class Meta:
nullable_fields = []
nullable_fields = ['description']
#

View File

@@ -0,0 +1,23 @@
# Generated by Django 3.0.3 on 2020-03-13 20:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('extras', '0039_standardize_description'),
]
operations = [
migrations.AlterField(
model_name='tag',
name='comments',
field=models.CharField(blank=True, max_length=200),
),
migrations.RenameField(
model_name='tag',
old_name='comments',
new_name='description',
),
]

View File

@@ -1051,9 +1051,9 @@ class Tag(TagBase, ChangeLoggedModel):
color = ColorField(
default='9e9e9e'
)
comments = models.TextField(
description = models.CharField(
max_length=200,
blank=True,
default=''
)
def get_absolute_url(self):

View File

@@ -77,7 +77,7 @@ class TagTable(BaseTable):
class Meta(BaseTable.Meta):
model = Tag
fields = ('pk', 'name', 'items', 'slug', 'color', 'actions')
fields = ('pk', 'name', 'items', 'slug', 'color', 'description', 'actions')
class TaggedItemTable(BaseTable):