Django Many to Many Relationship Add Not Working
I'm using Django's ManyToManyField for one of my models. class Requirement(models.Model): name = models.CharField(max_length=200) class Course(models.Model): requirements = models.ManyToManyField(Requirement) I want to be able to assign requirements for my classes, so to do that, I try the following: I get a class, course, that is already saved or that I have just saved, and I run the following: c = Course.objects.get(title="STACK 100") req = Requirement.objects.get(name="XYZ") c.requirements.add(req) While this works when I do it through the Django manage.py shell, it does not work when I do