[Answer]-Django: Models with multiple Foreign Key queries

1👍

You can make function in your model and order it in your view. Like this

models.py

class model_name(models.Model)

    ........

    def votes(self):
         return Vote_Name.objects.filter(phrase_id=self).count()

Leave a comment