I am trying to set the choices for a Child field equal to two choices that are fields that come from the Parent class that it's related to (each child only has one parent). How do I access these values?
class Parent(models.Model):
attribute1 = models.CharField(max_length=100)
attribute2 = models.CharField(max_length=100)
class Child(models.Model):
choices_in = ((WHAT TO PUT HERE, WHAT TO PUT HERE), (WHAT TO PUT HERE, WHAT TO PUT HERE))
parent = models.ForeignKey(Parent, on_delete=models.CASCADE)
item = models.CharField(max_length=100, null=True, choices=choices_in)