Answer the question
In order to leave comments, you need to log in
How to link objects to the same object via ManyToManyField?
Good afternoon, I want to add a "similar objects" field, tobish:
class Picture(models.Model):
''' модель для картины (фильма, мультфильма, аниме)'''
#похожие картины на текущую картину:
similar_picture = models.ManyToManyField(Picture)
Answer the question
In order to leave comments, you need to log in
similar_picture = models.ManyToManyField('self')
Relevant section of the documentation .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question