Though files and articles have one-to-many relations, the code uses many-to-many. It seems that it can be solved by just changing the field to ForeignKey, there are cases where the idempotent issue occurred, resulting in two articles with the same content being made. In these cases, attachments have multiple related articles.
Though files and articles have one-to-many relations, the code uses many-to-many. It seems that it can be solved by just changing the field to
ForeignKey
, there are cases where the idempotent issue occurred, resulting in two articles with the same content being made. In these cases, attachments have multiple related articles.