def get(self, request, device_type_id, asset_nid): obj = asset.Asset() response = obj.assets_edit(device_type_id, asset_nid) # 获取的数据和资产详情是一样的 print(response.data) return render(request, 'asset_edit.html', {'response': response})
def get(self, request, *args, **kwargs): service_obj = asset.Asset() model_form_class = service_obj.create_model_form() model_form_obj = model_form_class() return render(request, 'add_asset.html', { "model_form_obj": model_form_obj, "service_obj": service_obj })
def get(self, request, *args, **kwargs): obj = asset.Asset() return render( request, 'add_asset.html', { 'device_status_list': obj.device_status_list, 'device_type_list': obj.device_type_list, 'idc_list': obj.idc_list, 'business_unit_list': obj.business_unit_list })
def get(self,request): """ 获取资产数据 :param request: :return: """ obj = asset.Asset() response = obj.fetch_assets(request) return JsonResponse(response.__dict__)
def get(self, request): obj = asset.Asset() response = obj.fetch_assets(request) return JsonResponse(response.__dict__)
def __init__(self, **kwargs): self.obj = asset.Asset() super(AssetJsonView, self).__init__(**kwargs)