Answer the question
In order to leave comments, you need to log in
Is it possible to make a variable ForeignKey in a model?
Is it possible in Django to create a variable field that will store the key (chain) when there is data in another model?
As an example:
class Base(models.Model):
...
data = ForeignKey('One' or 'Two')
class One(models.Model):
...
class Two(models.Model):
...
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