diff --git a/apps/assets/api.py b/apps/assets/api.py index 534e837eb..f02f1411f 100644 --- a/apps/assets/api.py +++ b/apps/assets/api.py @@ -3,8 +3,9 @@ from rest_framework import serializers from rest_framework import viewsets, serializers,generics from .models import AssetGroup, Asset, IDC, AssetExtend - - +from common.mixins import BulkDeleteApiMixin +from rest_framework_bulk import BulkListSerializer, BulkSerializerMixin,ListBulkCreateUpdateDestroyAPIView +from .serializers import * class AssetGroupSerializer(serializers.ModelSerializer): class Meta: model = AssetGroup @@ -51,3 +52,6 @@ class IDCViewSet(viewsets.ReadOnlyModelViewSet): queryset = IDC.objects.all() serializer_class = IDCSerializer +class AssetListUpdateApi(BulkDeleteApiMixin, ListBulkCreateUpdateDestroyAPIView): + queryset = Asset.objects.all() + serializer_class = AssetBulkUpdateSerializer \ No newline at end of file diff --git a/apps/assets/templates/assets/asset_list.html b/apps/assets/templates/assets/asset_list.html index c9d7f298f..25ae809ab 100644 --- a/apps/assets/templates/assets/asset_list.html +++ b/apps/assets/templates/assets/asset_list.html @@ -1,21 +1,26 @@ {% extends '_base_list.html' %} {% load i18n %} +{% load static %} {% load common_tags %} {% block custom_head_css_js %} + + + {% endblock %} {% block content_left_head %} @@ -59,6 +64,7 @@ div.dataTables_wrapper div.dataTables_filter { {% block table_head %}