I'm currently working with a couple of models that have a one to many relationship.
I've managed to access all the attributes/foreign key attributes in my template files using template tags and one.many_set.all etc.
class One(models.Model)
name = models.CharField(max_length=50)
class Many(models.Model)
name = models.CharField(max_length=50)
related = models.ForeignKey(One, null=True, blank=True)
def __str__(self):
return self.name
What I'd like to do is split them up, so for example, have a drop down list for the 'One' model, which, on change, updates another list with it's related 'Many' objects, which I would then work with.
I've looked around and there doesn't seem to be anything I can find which specifically helps. Any advice would be much appreciated.
Thanks