crccheck / django-object-actions

A Django app for easily adding object tools in the Django admin
https://pypi.org/project/django-object-actions/
Apache License 2.0
680 stars 82 forks source link

Use custom admin `list_display` field. #24

Open pahaz opened 10 years ago

pahaz commented 10 years ago

I think need use list_display without template usage.

class Admin(DjangoObjectActions, ...):
    list_display = ( ... , 'object_actions')

class DjangoObjectActions(...)
   def object_actions(self, obj):
       for x in objectactions:
           ...
       return "HTML WITH BUTTONS"

   object_actions.allow_tags = True

It is may be more simple, and not require work with templates. What do you think about it?

And it is fix grappelli issuse, and all issuse connected to custom templates.

crccheck commented 10 years ago

I think I get what you're asking. Seems like a good feature to me. Some smells I can think of:

But I think since it would be opt-in, and might simplify code elsewhere, it's worth pursing.