Q:

Multiple relations of the same instance - Django

Let's say I have a model that acts as a list
class ListModel(models.Model):
    name = models.CharField(max_length=254)

and a model which will populate the list
class Model(models.Model):
    name = models.CharField(max_length=254)
    list = models.ManyToManyField(ListModel, related_name='model')

How can I have one instance of Model in my ListModel multiple times.
Is there a way to have a single instance related multiple times? Could I have some kind of 'count' for each instance of Model?
Edit: Should have been ManyToManyField, not ForeignKey. Still the same question of the same instance of Model being related multiple times to ListModel.

A:

You can use ManyToMany field instead of a ForeignKey.
class Model(models.Model):
    name = models.CharField(max_length=254)
    lists = models.ManyToManyField(ListModel, related_name="models")

This way a Model can relate to multiple ModelLists and a ModelList can be related to multiple Models.
model1.lists
model_list1.models

