我有以下模式:
任务类别:
solvers = ManyToManyField(User, related_name= slvrs )
Now I want to count the total number of solvers of all the tasks. For example there are 3 Task objects in the database. The first one has been solved by 2 users (M2M field relates to 2 users), the second by 3 and the last one by 0. I should get the count of all these solvers: 2 + 3 + 0 = 5.
我认为,我必须使用合计数字,但我知道什么模式和什么说明。