-
Notifications
You must be signed in to change notification settings - Fork 82
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
feat: provide action decorator to pass label, description and atts to the admin method #141
feat: provide action decorator to pass label, description and atts to the admin method #141
Conversation
Reference: crccheck#115
I reused the same logic that is now in the django project. The test is a bit tautological, but at least it’s here. Let me know if you have any suggested changes. |
fd80a02
to
425b4b6
Compare
425b4b6
to
27822e3
Compare
Thanks, if I need to do a major version release to drop old Django versions, I can do that. I'm just starting to get back into Python/Django so I can hopefully take a deeper look soon. |
I messed up with the test, sorry about that. Pushing the fix. I don’t think we need to drop anything for this to be merged, but let’s see once the tests run again. |
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.
I finally sat down and looked at the Django @action
doc and everything looks good to me. I'm a little worried that action
is too generic/overloaded but people can always rename it like
from django_object_actions import DjangoObjectActions, action as chocolate
I had one note but it's not a big deal. I'll merge tomorrow either way.
Fix docstring method name Co-authored-by: Chris Chang <[email protected]>
That’s what happen when you copy code… |
Add an
@action
decorator that behave's like Django'sadmin.action
decorator1 to clean up customizing object actions.closes #115
Also relates to #107
Footnotes
https://docs.djangoproject.com/en/stable/ref/contrib/admin/actions/#django.contrib.admin.action ↩