Django: how to solve several Foreign key relationship problem?

I’m having a hard time figuring out what you’re looking for from your description.

The query you’re trying to create appears to be for a Task object. What task object are you trying to retrieve?

This does not appear to be true based on the models posted. The code shown has Mark with two foreign keys, one each to Student and Task.