Answer the question
In order to leave comments, you need to log in
Is it worth it to merge two tables with different ForeignKeys into one, but at the same time one of the ForeignKeys will be null?
Hello, I have something like this:
class Factory(models.Model):
name = models.CharField(max_length=126)
worker = models.ForeignKey(Worker, null=True)
manager = models.ForeignKey(Manager, null=True)
class FactoryWorker(models.Model):
name = models.CharField(max_length=126)
worker = models.ForeignKey(Worker, null=True)
class FactoryManager(models.Model):
name = models.CharField(max_length=126)
manager = models.ForeignKey(Manager, null=True)
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