Skip to content
Justice Tech School

ManyToMany

Link many to many.

Example
class Tag(models.Model):
    name = models.CharField(max_length=30)

class Post(models.Model):
    tags = models.ManyToManyField(Tag)

post.tags.add(tag)

Exercise

Add a link.

post.tags.(tag)

Quiz Test

Which relation needs a join table?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.