0

This is what I want to achieve:

class Event(Model):
    attendees = ManyToManyField(User, through='Involvement', related_name='attended_events')
    interested_users = ManyToManyField(User, through='Involvement', related_name='interested_in_events')
    organizers = ManyToManyField(User, through='Involvement', related_name='organized_events')

class Involvement(Model):
    event = ForeignKey(Event, CASCADE)
    user = ForeignKey(User, CASCADE)
    involvement = CharField(choices=(('INTERESTED', 'Interested'), ('ATTENDED', 'Attended'), ('ORGANIZED', 'Organized')))

The error I'm receiving:

 The model has three identical many-to-many relations through the intermediate model 'app.ActivityInvolvement'.

I know limit_choices_to doesn't work on ManyToManyField, how would I go about making this happen, without creating 3 through tables with the same structure?

jc127
  • 343
  • 2
  • 13

0 Answers0