I have a table1 , with col_a, col_b, col_c,col_c. I have another table2, with tb_col1, tb_col2, tb_col3, i want to reference col_a ->tb_col, col_b ->tb_col2 , col_c -> tb_col3.
should I use composite keys, If so how do i implement this in Django(python)
my Models :
class product_models(models.Model):
products = models.ForeignKey('products')
model_name = models.CharField(max_length=50)
model_price = models.IntegerField(max_length=4)
model_desc = models.TextField(blank=True)
commision = models.IntegerField(max_length=3)
def __unicode__(self):
return self.model_name
class sales_process(models.Model):
prospect = models.ForeignKey('prospect')
employee = models.ForeignKey(User)
first_call = models.DateTimeField
product = models.ForeignKey('products')
model_name = models.ForeignKey('product_models')
#price = reference to product_model for the price
#commission = reference to product_model for commission
Here how can i refer price
to product_models
and commission
to product_models