django-object-actions
django-object-actions copied to clipboard
Object action not showing in admin change form
Thanks for creating this useful package. I followed the setup process however the actions are not showing in admin.
I'm using Python 3.5, Django 1.9.2 and Flat Admin Theme.
This is my implementation:
@admin.register(Entry)
class ProcedureEntryAdmin(DjangoObjectActions, admin.ModelAdmin):
# ...
def publish_this(self, request, obj):
obj.publish()
publish_this.label = "Publish"
change_actions = ['publish_this' ]
Thanks!
I checked my demo admin and it was working for me there. So I guess it has something to do with the Flat Admin Theme. Here's the relevant part of the readme:
- If you provide your own custom
change_form.html, you'll also need to manually copy in the relevant bits ofour change form <https://github.com/crccheck/django-object-actions/blob/master/django_obj ect_actions/templates/django_object_actions/change_form.html>_. You can also usefrom django_object_actions import BaseDjangoObjectActionsinstead.
https://github.com/crccheck/django-object-actions#limitations
FYI I had the same problem and it was caused by older version of django-object-actions which did not use change_actions attribute but objectactions.
Good point. I was deciding between doing a more graceful deprecation and just changing it. Since it's below version 1.0, I just changed it to minimize the amount of code. But seeing that is making me think about doing it more gracefully in the future.