1๐
โ
I think a simple solution would be to combine Supervisor
and Salesman
into 1 model. You could simply call this Staff
and create a field called is_supervisor
which would differentiate supervisors from regular salesmen.
To do this, you would set up your model something like this:
class Product(models.Model):
staff = models.ForeignKey(Staff, null=True)
# other stuff
class Staff(models.Model):
name = models.CharField(max_length=100)
supervisor = models.ForeignKey('self', null=True)
is_supervisor = models.BooleanField()
๐คWritten
Source:stackexchange.com