changes I wanted to discuss.. but failed ;)#3
Open
chromakey-io wants to merge 2 commits intodebrouwere:masterfrom
Open
changes I wanted to discuss.. but failed ;)#3chromakey-io wants to merge 2 commits intodebrouwere:masterfrom
chromakey-io wants to merge 2 commits intodebrouwere:masterfrom
Conversation
added 2 commits
January 11, 2011 02:16
… access with the public api. objects.locked(), objects.unlocked(), objects.locked_for(user) ... which could be useful in a number of cases
Owner
|
Hi Kevin. I just moved to London so I'm a tad bit busy right now, but I hope to be able to take a look at your stuff early next week. Thanks for your patience & cheers. |
Owner
|
So, I've just pushed a bunch of changes to Am I missing anything obvious? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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...