You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Code snippet below illustrates the issue. There are assumptions to the name of the fields in through tables for m2m tables.
For the default through tables it works, but for the custom ones it does not.
If you try to save object of PageArticle you will see:
from django.db import models
from simple_history.models import HistoricalRecords
class Tag(models.Model):
name = models.CharField(max_length=100)
class ArticleTag(models.Model):
article = models.ForeignKey("PageArticle", on_delete=models.CASCADE)
tag = models.ForeignKey(Tag, on_delete=models.CASCADE)
class PageArticle(models.Model):
title = models.CharField(max_length=100)
article_tags = models.ManyToManyField(Tag, through=ArticleTag)
history = HistoricalRecords(m2m_fields=[
article_tags,
])
Expected behavior
A model should be saved without any errors.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
OS: MacOS, Windows
Browser (if applicable): [e.g. chrome, safari]
Django Simple History Version: 3.2.0
Django Version: 4.1.5
Additional context
Pull request that addresses the issue is #1093
The text was updated successfully, but these errors were encountered:
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Code snippet below illustrates the issue. There are assumptions to the name of the fields in through tables for m2m tables.
For the default through tables it works, but for the custom ones it does not.
If you try to save object of PageArticle you will see:
Expected behavior
A model should be saved without any errors.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
Additional context
Pull request that addresses the issue is #1093
The text was updated successfully, but these errors were encountered: