I have 2 tables and wanted to combine
1st and 2nd table and show it in 3rd table
class Date(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return self.name
class Month(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return self.name
I have my 3rd table which is combination of 1st and 2nd table
I tried to use models.ForeignKey(Date,Month)
in my 3rd table but only Month table data was shown in admin panel Date table data was not populated
My 3rd table looks like this
class Group(models.Model):
name = models.ForeignKey(Month,Date)
def __unicode__(self):
return self.name
I there any alternate way of populating data from different tables?
Any help is populating data of different tables in one table is very helpfull
Thanks in advance