| | |
| | | """ |
| | | from typing import Dict |
| | | |
| | | from django.contrib.auth.models import Group |
| | | from django.core.exceptions import ObjectDoesNotExist, ValidationError |
| | | from django.db import IntegrityError, transaction |
| | | from django.db.models import Count |
| | |
| | | ser = self.get_serializer(obj, many=False) |
| | | return Response(ser.data) |
| | | |
| | | @method_decorator(request_log(level="INFO")) |
| | | def group_list(self, request): |
| | | """获取所有分组列表""" |
| | | groups = Group.objects.all() |
| | | group_list = [{"id": group.id, "name": group.name} for group in groups] |
| | | return Response(group_list) |
| | | |
| | | |
| | | class DashBoardView(APIView): |
| | | """项目看板""" |
| | |
| | | # 包含今天的前6天 |
| | | "recent_days": [get_day(n)[5:] for n in range(-5, 1)], |
| | | "recent_months": [get_month_format(n) for n in range(-5, 1)], |
| | | "recent_weeks": [get_week_format(n) for n in range(-5, 1)], |
| | | "recent_weeks": [get_week_format(n) for n in range(-5, 1)] |
| | | } |
| | | |
| | | return Response(res) |