Hi I have the following classes
Class Test1(models.Model):
user = models.OneToOneField(User)
myotherid = models.CharField(max_length=255)
Class TestData(models.Model):
data = models.ForeignKey(Data)
test1 = models.ForeignKey(Test1)
Class Data(models.Model):
title = models.CharField(max_length=255)
I'm very new to Django models and all of this, how can I get all of Test1 items with myotherid=1234 and Data.title= "foo"
Essentially, doing this SQL:
select Test1.* from Test1 t, TestData td, Data d where t.myotherid=1234 and t.id = td.test1 and td.data = d.id and d.title = "foo"
Thanks for your help