[Answer]-ManytoManyField Django relationships error

1👍

✅

The error is in your def __unicode__. The error you get says that ‘Allergie’ object has no attribute ‘content’. When printing the allergies, Django tries to print what is defined in def __unicode__. This method generates the error. You can maybe change it to:

def __unicode__(self):
    return self.name

Leave a comment