-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Docs: misleading example in prev and next record #1428
Comments
I started to answer with an explanation of how this worked and then realized I had misinterpreted the example code as well. So, yeah, agreed the docs could perhaps be a little more clear, perhaps some code comments in the example code. @capoaira , yes, I do think you are misunderstanding how
Also note that It's been a while since I've worked with django-simple-history and all of the above is coming from memory and reading the code, so I may be wrong! I'll try to spin up a test environment as soon as I can and verify what I said. |
Thank you, @jnovinger. |
Well explained, @jnovinger! I can add that I think the issue partly/mainly stems from the word "first" being slightly ambiguous, in that - in this context - it can both mean "first of a sequence" (i.e.
I definitely agree that this should be clearer in the docs, which I'll try to improve at some point in the future - if not someone else gets to it first :) |
Describe the bug
According to the Docs (https://django-simple-history.readthedocs.io/en/latest/querying_history.html#getting-previous-and-next-historical-record),
history.frist()
will return the first version of the object and therefore,prev_record
will beNone
. But actually it is the other way around.history.frist()
returns the most recent version and thereforenext_record
inNone
Or did I misunderstand something?
Expected behavior
The documentation is not clear about it, which leads to errors.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: