-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Added created field to Session model #75
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you have a look at the failing tests and my comment?
field=models.DateTimeField(default=datetime.datetime(2017, 4, 18, 12, 11, 0, 286186), auto_now_add=True), | ||
preserve_default=False, | ||
), | ||
migrations.RunPython(set_created), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrations should be reversible, so please also provide the reverse_code
argument here. It doesn't need to do anything; see also this snippet from the Django docs:
Pass the RunPython.noop method to code or reverse_code when you want the operation not to do anything in the given direction. This is especially useful in making the operation reversible.
Fixed the data migration reversing, but the TravisCI failures are going to take some extra work on my part. Best I can tell they are related to https://code.djangoproject.com/ticket/17654 and the way the |
Maybe we should use |
That might help, I'm going to do some testing over the weekend. |
@bourke, I did some testing at the time and have been using my own fork for a while, but figure it's time to get this PR finalized. The code still works fine, just the tests fail due to Alternatively, could use a |
What's the status of this pull request? I would really like to have this feature in a project I'm working on. |
This project was unmaintained for some years and this PR went stale during that period. Currently, it has several merge conflicts, so would need to be rebased. |
Check out django-qsessions for a drop-in replacement that supports a |
@blag Thanks for the suggestion. I may end up doing that, but it might be difficult because my project is already using @WhyNotHugo If @dwasyl updates this pull request (or if they're not able or willing to, I could create a new pull request), would merging it relatively soon be a possibility? What is the release process? I see that it has been close to one and a half years since the last release was made. My project would need this in the next couple weeks and I'm wondering if that's realistic or if I should look at other options. |
@ataylor32 glad it's not just me that likes the functionality. I've used it in production for a while without any issues, the only problem I ever had was in running the test suite due to the auto_add_now and the re_use of pk's. There never seemed to be a preference or interest in it so I left it as is and used it. Let me see if I have an updated fork to push. |
Yeah, a rebased version of this sounds good to merge. |
@dwasyl Would you be able to update this pull request anytime soon? If not, I can open a separate pull request to replace this one. |
@ataylor32 Sure, I should have time this weekend! |
In response to Issue #66 I added the field myself and created this PR. Shouldn't negatively impact anything, and I made the migration set the
created
to be equal to the value oflast_activity
rather than being ahead of it for backward compatibility.