Categories of the model, how to implement?

Here is the model for example about the book, the book can have multiple genres. And when you click on a genre, a list of books with this genre of how to implement it?
March 20th 20 at 11:32
1 answer
March 20th 20 at 11:34
Solution
class Category(models.Model):
pass

class Book(models.Model):
 categories=models.ManyToManyField(Category)

https://docs.djangoproject.com/en/2.2/topics/db/mo...

Find more questions by tags Django