Django many to many field keeps adding every instance to itself

I have model "post" and model "profile". I need to add likes to the post, so I did "ForeignKey" at first, now I have ManyToMany relationship, but I keep seeing how every possible instance of "profile" is automatically being added to every instance of "post". Why is it happening? I didnt have problems like that in my previous projects.

models.py for profile

from django.db import models
from django.conf import settings
from django.contrib.auth.models import User

    
class Profile(models.Model):
    """Fields that can be used to modify the profile page"""
    name = models.CharField(max_length=50, null=True, blank=True)
    bio = models.TextField(max_length=160, null=True, blank=True)
    profilePicture = models.ImageField(null=True, blank=True, upload_to='profiles/', default='default/default-pfp.jpg')  
    """Technical fields unaccessable for users"""
    owner = models.OneToOneField(User, on_delete=models.CASCADE, related_name='account')
    following = models.ForeignKey("self", on_delete=models.DO_NOTHING, blank=True, null=True, unique=False)
    
    def __str__(self):
        str=self.owner.username
        str=str + "'s profile"
        return str

model.py for pot

from django.db import models
from django.conf import settings
from django.contrib.auth.models import User

class Post(models.Model):
    title = models.CharField(max_length=360)
    body = models.TextField()
    image = models.ImageField(null=True, blank=True)
    likes = models.ManyToManyField(User, related_name="blog_posts")
    author = models.ForeignKey(User, on_delete=models.CASCADE)
    date = models.DateTimeField(auto_now=False, auto_now_add=True)
        
    def __str__(self):
        str=self.author.username
        str= self.date.strftime("%d/%m %H:%M ") + str + "'s post"
        return str

    def date_posted(self):
        str = self.date.strftime('%H:%M %d/%m/%y')
        return str


[![Admin panel][1]][1] [1]: https://i.stack.imgur.com/rwgBP.png

So, they changed visual interface since I did my last project and I didnt understand that 😂 It did not select all of them by default, interface just looks like that. My bad, thanks for time of those who wondered around :)

Back to Top