Answer the question
In order to leave comments, you need to log in
How to implement choice in a model that contains values from another model?
Let's say we have this class:
class One(models.Model):
field = models.CharField(max_length=30)
class Two(models.Model):
choices = *здесь должна быть ссылка на поле "field" класса "One"*
field_choice = models.CharField(choice=choices)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question