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

#4416: Remove individual view for extras.Tag

This commit is contained in:
Jeremy Stretch
2020-07-01 14:21:51 -04:00
parent c484fa99e2
commit 57b73c485f
5 changed files with 1 additions and 36 deletions

View File

@@ -40,33 +40,6 @@ class TagListView(ObjectListView):
table = tables.TagTable
class TagView(ObjectView):
queryset = Tag.objects.all()
def get(self, request, slug):
tag = get_object_or_404(self.queryset, slug=slug)
tagged_items = TaggedItem.objects.filter(
tag=tag
).prefetch_related(
'content_type', 'content_object'
)
# Generate a table of all items tagged with this Tag
items_table = tables.TaggedItemTable(tagged_items)
paginate = {
'paginator_class': EnhancedPaginator,
'per_page': request.GET.get('per_page', settings.PAGINATE_COUNT)
}
RequestConfig(request, paginate).configure(items_table)
return render(request, 'extras/tag.html', {
'tag': tag,
'items_count': tagged_items.count(),
'items_table': items_table,
})
class TagEditView(ObjectEditView):
queryset = Tag.objects.all()
model_form = forms.TagForm