我只是简单的要求(并非简单执行),并概括了如何实现这一要求,而不必对 d进行多次打击,在盘问时没有<代码>.extra()。
Task:
name = xxx
status = models.IntegerField(choices=some_choices)
project = ForeignKey(Project)
Project:
name = xxx
code = xxx
Projects contain Tasks which got various statuses. (Assume status=3 is Completed) Now, I want to list out all projects with their total tasks and completed tasks, like below
- Project 1, total_tasks=5, completed_tasks=2
- Project 1, total_tasks=2, completed_tasks=1
我能够拿到全部的“信使”,但还没有完成——信使,因为它需要说明条件。 是否有办法?