Subclassing Django’s ModelAdmin

After writing about sweetening URLFields on Django admin forms, I got to thinking, why not subclass ModelAdmin instead? It works!

from django.contrib import admin

class LocalModelAdmin(admin.ModelAdmin):
    class Media:
        js = (

from import LocalModelAdmin

class MyModelAdmin(LocalModelAdmin):

MyModel list and add/change forms now get the js files from LocalModelAdmin.