Skip to content Skip to sidebar Skip to footer

Check If All Objects Belong To A List Django

Template: {% for level in levels %} {% if level.todo_set.all in tasks %}
  • <
  • Solution 1:

    You are probably best to handle this inside your view.

    for level in levels_list:
        if Todo.objects.filter(level=level).count() == Task.objects.filter(student=student, level=level).count():
            return (level completion code)
    

    Solution 2:


    Post a Comment for "Check If All Objects Belong To A List Django"