Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistencies with field access regarding m2m fields #1186

Open
mjsir911 opened this issue Jun 8, 2023 · 0 comments · May be fixed by #1187
Open

Inconsistencies with field access regarding m2m fields #1186

mjsir911 opened this issue Jun 8, 2023 · 0 comments · May be fixed by #1187

Comments

@mjsir911
Copy link
Contributor

mjsir911 commented Jun 8, 2023

Hi,

Describe the bug
We've been working with historical records assuming that they can be transparently swapped with underlying instances and used in the same context.

To Reproduce

obj = Document()
histobj = obj.history.latest() # should be able to be used equivalently?

obj.name == histobj.name # normal fields act the same
obj.attachments.all() == histobj.attachments.all() # m2m fields do not, historical m2m fields resolve out to the through field

Expected behavior
I expect the m2m field to work the same as it does within django, resolving the through field connection and returning an object associated with the other side of the connection (not sure if this can be a historical object?)

Environment (please complete the following information):

  • Django Simple History Version: master: 5128890
  • Django Version: 4.2.2
  • Database Version: sqlite 3.41.2

Additional context
Add any other context about the problem here.

mjsir911 added a commit to mjsir911/django-simple-history that referenced this issue Jun 9, 2023
mjsir911 added a commit to mjsir911/django-simple-history that referenced this issue Aug 18, 2023
mjsir911 added a commit to mjsir911/django-simple-history that referenced this issue Aug 18, 2023
mjsir911 added a commit to mjsir911/django-simple-history that referenced this issue Aug 18, 2023
mjsir911 added a commit to terrapower/django-simple-history that referenced this issue Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant