burke-software / django-mass-edit

Make bulk changes in the Django admin interface
156 stars 68 forks source link

Allow massadmin to be used with a custom AdminSite #61

Closed ecederstrand closed 6 years ago

ecederstrand commented 8 years ago

Django allows customization of AdminSites, as described in https://docs.djangoproject.com/en/1.9/ref/contrib/admin/#customizing-adminsite This patch allows massadmin to work with a custom AdminSite by passing the custom site to the view (it is also necessary to add the mass_change_selected action to the custom site):

from massadmin import mass_change_selected

admin_site = MyCustomAdminSite(name='custom_admin')
admin_site.add_action(mass_change_selected)

url(r'^admin/', include(massadmin.urls), kwargs={'admin_site': admin_site}),
coveralls commented 8 years ago

Coverage Status

Coverage remained the same at 91.111% when pulling 6e668877a5013deab129efeec67b6bdd80415c59 on ecederstrand:patch-1 into 38b2b28c997a4d4c1998f51ff4989c00b60edb8e on burke-software:master.

PetrDlouhy commented 8 years ago

@ecederstrand Could you please also add test for this functionality?

ecederstrand commented 8 years ago

Sorry for the late reply. Of course a test should go with the patch, but 'm unfamiliar with your test suite and unsure how to go about testing this. Could you nudge me in the rigt, general direction?

PetrDlouhy commented 6 years ago

@ecederstrand I finished this and merged in #76, so I am closing this.