Add multiple instances of same model to a field in Django

I need to build a class structure that allows me to create multiple PackItems for a single Item in the admin panel. Each PackItem should have a quantity field and a reference to the Item it relates to.

class Item(models.Model):
    title = models.CharField(max_length=100)
    price = models.DecimalField(decimal_places=2, max_digits=10)
    is_pack = models.BooleanField(default=False)
    pack_items = models.ManyToManyField('PackItem', blank=True)
class PackItem(models.Model):
    packitem = models.ForeignKey('Item', on_delete=models.CASCADE)
    quantity = models.IntegerField(default=1)

I’m currently creating PackItems one by one, and then adding them to the pack_items field of the Item model. Is this the best way to do it, or is there a better practice?

The approach you are currently using is correct. You create individual PackItem instances and add them to the pack_items field of the related Item. This is the recommended way to implement a many-to-many relationship between two models in Django.