I have a form that has a field which allows the user to select multiple options from the field's options (forms.ModelMultipleChoiceField). I would think the appropriate model would need to be a many to many relationship but I am not sure how to structure it or how it would look in the actual database. How would this ManyToMany relationship look in mysql? Let me know if more information is needed, I'm pretty new to this.
in my forms.py:
class ProjectForm(forms.ModelForm): role = forms.ModelMultipleChoiceField(ProjectRole.objects, ..., a bunch of form modifiers,)
in my models.py:
class ProjectRole(models.Model): role_name = models.CharField(max_length=100) def __str__(self): return '%s' % self.role_name class Project(models.Model): role = models.ManyToManyField(ProjectRole, ... extra stuff...)