changes I wanted to discuss.. but failed ;) #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey,
Sorry I didn't get back to you on gchat. I wanted to discuss, however our waking hours don't line up very well I guess.
I just pushed in some additional stuff that is useful for the public api. I added some methods to the standard objects model manager.
MyModel.objects.locked()
MyModel.objects.unlocked()
MyModel.objects.locked_for(user)
This has been pretty useful in my current app, as I'm using django-forms and views rather than the admin to manipulate data.
I additionally have a locking-form that locks with the current user on load, then unlocks on save ... though the implementation is not very user friendly. When I have the time I will re-write it and make another pull request if you are interested. Though it too has proven to be very useful in my current application.
Here is a dpaste of my current form implementation. Though I think I can come up with something a bit more user friendly (the curry stuff is kind of hacky). Perhaps a method like locked_formset_factory() or some such to generate the formsets associated to the user in the view. Thoughts?
http://dpaste.com/305663/
Thanks...