feat: 任务中心只展示生图任务(模特上身图/平台套图/图片创作)
- AITaskViewSet 支持 ?task_type=a,b,c 过滤 - 前端任务中心请求 task_type=person_image,product_image,过滤掉 entity_extraction/script_*/storyboard 等流水线内部任务,只留生图工作室产出 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,17 @@ class AITaskViewSet(TeamScopedViewSetMixin, ReadOnlyModelViewSet):
|
||||
search_fields = ["idempotency_key", "provider_task_id", "project__name"]
|
||||
ordering_fields = ["created_at", "updated_at", "completed_at"]
|
||||
|
||||
def get_queryset(self):
|
||||
# 可选 ?task_type=a,b,c 过滤:生图工作室的任务中心只想看生图任务(模特上身图/平台套图/
|
||||
# 图片创作 = person_image / product_image),不掺脚本/实体抽取/故事板等流水线内部任务。
|
||||
queryset = super().get_queryset()
|
||||
raw = self.request.query_params.get("task_type", "").strip()
|
||||
if raw:
|
||||
types = [t.strip() for t in raw.split(",") if t.strip()]
|
||||
if types:
|
||||
queryset = queryset.filter(task_type__in=types)
|
||||
return queryset
|
||||
|
||||
|
||||
class ModelConfigViewSet(ReadOnlyModelViewSet):
|
||||
# 按创建序固定排序:最早创建的 active 模型排第一 = 前端选择器默认项,与 get_default_model 口径一致
|
||||
|
||||
Reference in New Issue
Block a user