B
B
bogdan_242016-07-10 22:38:14
Django
bogdan_24, 2016-07-10 22:38:14

Adding list to django model?

The task is to add likes to the site, for this I want to add a like table to store likes.

class Like(models.Model):
    count = models.IntegerField()
    product = models.ForeignKey(Product)
    users = ???

How to add a list to store users who have already liked a post?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-07-10
@sim3x

users = models.ManyToMany(settings.AUTH_USER_MODEL)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question