[Django]-Django models to hold a list of objects from another Model


A ManyToManyField is the way to go, you can work with:

class Cart(models.Model):
    items = models.ManyToManyField(

class Product(models.Model):
    # …

The Django documentation has a section on many-to-many relations that specifies how to add, remove, query, etc. ManyToManyFields.

Leave a comment