mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
0254541f6c
@ -43,7 +43,7 @@
|
||||
|
||||
## 文档
|
||||
|
||||
[https://docs.onlinejudge.me/](https://docs.onlinejudge.me/)
|
||||
[http://opensource.qduoj.com/](http://opensource.qduoj.com/)
|
||||
|
||||
## 截图
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ Follow me: [https://github.com/Harry-zklcdc/OnlineJudgeDeploy/tree/2.0](https:/
|
||||
|
||||
## Documents
|
||||
|
||||
[https://docs.onlinejudge.me/](https://docs.onlinejudge.me/)
|
||||
[http://opensource.qduoj.com/](http://opensource.qduoj.com/)
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
||||
@ -9,7 +9,11 @@ from contest.models import ContestRuleType
|
||||
|
||||
class ProblemTagAPI(APIView):
|
||||
def get(self, request):
|
||||
tags = ProblemTag.objects.annotate(problem_count=Count("problem")).filter(problem_count__gt=0)
|
||||
qs = ProblemTag.objects
|
||||
keyword = request.GET.get("keyword")
|
||||
if keyword:
|
||||
qs = ProblemTag.objects.filter(name__icontains=keyword)
|
||||
tags = qs.annotate(problem_count=Count("problem")).filter(problem_count__gt=0)
|
||||
return self.success(TagSerializer(tags, many=True).data)
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user