Re: Query on 2 non related models

2019-05-20 Thread Rafael E. Ferrero
Hello Ivan... you say Unrelated but I see you have a relation with VendorGroup... why don't use a ForeignKey?... any way you can use the pipe charater " | " to concatenate two querysets. https://simpleisbetterthancomplex.com/tips/2016/06/20/django-tip-5-how-to-merge-querysets.html Cheers!

Query on 2 non related models

2019-05-20 Thread Ivan Martić
Hi guys, hope you can help me. I have 2 models and i want to make a count query on them. I need a count on how many articles i have in every category. Models: class Vendors(models.Model): id = models.AutoField(db_column='id', primary_key=True, blank=False, unique=True) name =