django-object-actions icon indicating copy to clipboard operation
django-object-actions copied to clipboard

Object action not showing in admin change form

Open PabloVallejo opened this issue 9 years ago • 3 comments

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!

PabloVallejo avatar Mar 07 '16 15:03 PabloVallejo

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:

  1. If you provide your own custom change_form.html, you'll also need to manually copy in the relevant bits of our 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 use from django_object_actions import BaseDjangoObjectActions instead.

https://github.com/crccheck/django-object-actions#limitations

crccheck avatar Mar 08 '16 04:03 crccheck

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.

dboczek avatar Jul 20 '16 10:07 dboczek

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.

crccheck avatar Jul 20 '16 14:07 crccheck