Closed
Description
Describe the bug
See title.
To Reproduce
Steps to reproduce the behavior:
- Given the following model:
class Person(models.Model): relations = models.ManyToManyField("self") history = HistoricalRecords(m2m_fields=[relations])
- Run the following code (which should also create a historical record for the
Person
object):Person.objects.create()
- This will produce the following error:
django.core.exceptions.FieldError: Cannot resolve keyword 'person' into field. Choices are: from_person, from_person_id, id, to_person, to_person_id
Expected behavior
That a model object and associated historical record were successfully created, and that the error was not raised.
Environment (please complete the following information):
- OS: Windows 11 22H2
- Django Simple History Version: the current
master
branch - Django Version: 4.1.6
- Database Version: SQLite 3.38.4