I have defined my model as following , and how to define a query to filter the Sanity_Test set which the associated Test_Product's product name are in the specified name list ? Many thanks
For example:
Sanity_Test_A contains Test_Product_A(Product name was A) , Test_Product_B(Product name was B)
Sanity_Test_B contains Test_Product_C(Product name was A) , Test_Product_D(Product name was C)
I want to filter the Sanity_Test record list which it's Test_Product record's Product name is A
APP : CT.model
class Sanity_Test(models.Model):
build = models.OneToOneField('CI.Build')
system_test = models.ForeignKey(System_Test,null=True,blank=True)
......
class Test_Product(models.Model):
product = models.ForeignKey('CI.Product',verbose_name='Product')
sanity_test = models.ForeignKey(Sanity_Test)
......
# APP : CI.model
class Product(models.Model):
name = models.CharField(max_length=255,unique=True)
......