I'm trying to add attribute to relationship.
I have a model Scheduler, Product and User.
There are multiple Scheduler objects in database. Each can have multiple products. And each product has some of those schedulers.
The user can choose which scheduler to use with a product.
I want user to be able to name this scheduler (note that one scheduler can be used by many products by multiple users).
Use case:
User creates a product and choose from allowed schedulers. When they choose the scheduler they can assign some name to this scheduler.
For user1, the scheduler with id=5 has name='My scheduler - everyday'
For user2, the same scheduler (id=5) has name='Everyday schedule'
class Product(models.Model):
user = models.ForeignKey(User, null=False, blank=False)
scheduler = models.ForeignKey('Scheduler', null=True, blank=True, related_name='products')
class Scheduler(models.Model):
weekhours = models.ManyToManyField('WeekHour', related_name='schedulers')
identificator = models.TextField(null=True,blank=True)
Is it possible to do that in some simple way?