I am trying to get a queryset but it is not displaying anything. Basically, I want to get the Asset objects that are assigned via foreign key to an employee, which is a foreign key of the signed in user.
views.py
def get_queryset(self):assetlist = Asset.objects.filter(organisation__employee__user=self.request.user)print(assetlist)return assetlist
models.py
class Employee(models.Model):name = models.CharField("Employee Name", max_length=50, blank=False)email = models.CharField("Employee Email", max_length=50, blank=True)user = models.ForeignKey(User)clientID = models.ForeignKey(Organisation)def save(self):self.name = self.user.get_full_name()self.email = self.user.emailsuper(Employee, self).save()def __str__(self):return self.nameclass Asset(models.Model):name = models.CharField("Asset Name", max_length=30, primary_key=True)organisation = models.ForeignKey(Organisation)def __str__(self):return self.nameclass Organisation(models.Model):name = models.CharField("Organisation Name", max_length=50, blank=False)location = models.TextField("Organisation Address", max_length=200, blank=True)tel = models.CharField("Telephone Number", max_length=20)def __str__(self):return self.name