def list(self, request, *args, **kwargs): """ 获取学期列表 """ query = GeneralQuery() query_dict = query.get_query_kwargs(request) return query.model_query(request, education_model.YzyTerm, TermSerializer, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) group_uuid = query_dict.get('group__icontains', None) if group_uuid: query_dict.pop('group__icontains') query_dict['group'] = group_uuid return query.model_query(request, voi_education_model.YzyVoiDesktop, VoiDesktopSerializer, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) group_type = query_dict.get('group_type__icontains', None) if group_type: query_dict.pop('group_type__icontains') query_dict['group_type'] = group_type return query.model_query(request, education_model.YzyGroup, GroupSerializer, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) classify = query_dict.get('classify__icontains', None) if classify: query_dict.pop('classify__icontains') query_dict['classify'] = classify group_uuid = query_dict.get('group', None) if group_uuid: return query.model_query(request, voi_education_model.YzyVoiTemplateGroups, VoiTemplateGroupSerializer, query_dict) else: state = query_dict.get('state', None) if state: # 1-模板展示列表 2-桌面组查询模板的展示 query_dict.pop('state') data = request.GET _mutable = data._mutable data._mutable = True data['state'] = state data._mutable = _mutable return query.model_query(request, voi_education_model.YzyVoiTemplate, VoiTemplateSerializer, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) pool_uuid = query_dict.get('pool_uuid', None) if pool_uuid: query_dict.pop('pool_uuid') query_dict['resource_pool'] = pool_uuid template_uuid = query_dict.get('template_uuid', None) if template_uuid: query_dict.pop('template_uuid') template = models.YzyInstanceTemplate.objects.filter(uuid=template_uuid, deleted=0) if not template: ret = get_error_result("TemplateNotExist", name='') return JsonResponse(ret, json_dumps_params={'ensure_ascii': False}) query_dict['page_size'] = 100 return query.model_query(request, resource_model.YzyNodes, TemplateImageSerializer, query_dict)
def get(self, request, *args, **kwargs): from django.db.models import Q query = GeneralQuery() query_dict = query.get_query_kwargs(request) group = query_dict.get('group__icontains', None) if group: query_dict.pop('group__icontains') query_dict['group'] = group user_name = query_dict.get('user_name__icontains', None) phone = query_dict.get('phone__icontains', None) fil = None if user_name and phone: query_dict.pop('user_name__icontains') query_dict.pop('phone__icontains') fil = (Q(user_name__icontains=user_name) | Q(phone__icontains=phone) | Q(name__icontains=user_name)) return query.model_query(request, models.YzyGroupUser, GroupUserSerializer, query_dict, fil)
def get(self, request, *args, **kwargs): """ 定时任务获取 0-数据库定时任务,1-桌面定时任务,2-主机定时任务,3-终端定时任务 """ query = GeneralQuery() query_dict = query.get_query_kwargs(request) cron_type = query_dict.get('cron_type__icontains', None) if cron_type: query_dict.pop('cron_type__icontains') # cron_type = self.contab_type_switch(cron_type) query_dict['type'] = cron_type cron_type = query_dict.get('cron_type', None) if cron_type: query_dict.pop('cron_type') # cron_type = self.contab_type_switch(cron_type) query_dict['type'] = cron_type return query.model_query(request, YzyCrontabTask, YzyCrontabTaskSerializer, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) classify = query_dict.get('classify__icontains', None) if classify: query_dict.pop('classify__icontains') query_dict['classify'] = classify pool_uuid = query_dict.get('pool_uuid', None) if pool_uuid: query_dict.pop('pool_uuid') query_dict['pool'] = pool_uuid state = query_dict.get('state', None) if state: # 1-模板展示列表 2-桌面组查询模板的展示 query_dict.pop('state') data = request.GET _mutable = data._mutable data._mutable = True data['state'] = state data._mutable = _mutable return query.model_query(request, education_model.YzyInstanceTemplate, TemplateSerializer, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) return query.model_query(request, voi_education_model.YzyVoiTemplateOperate, VoiTemplateOperateSerializer, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) return query.model_query(request, education_model.YzyInstances, DesktopStaticSerializer, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) return query.model_query(request, models.YzyRandomDesktop, DesktopRandomSerializer, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) return query.model_query(request, YzyNodes2, YzyNodesSerializer2, query_dict)
def get(self, request, *args, **kwargs): query = GeneralQuery() query_dict = query.get_query_kwargs(request) return query.model_query(request, YzyDatabaseBack, YzyDatabaseBackSerializer, query_dict)