I have two apps each has one model:
company app models.py
class Company(models.Model): name = models.CharField() address = models.CharField()
client app models.py
class Client(models.Model): company = models.ForeignKey(Company) name = models.CharField()
I have a listview of my company:
class CompanyListView(ListView): model = Company form_class = CompanyForm def get_context_data(self, **kwargs): context = super(CompanyListView, self).get_context_data(**kwargs) context[client_list] = ??? return context
My problem is how can I pass to context[client_list]
client list count related to a specific company?