Django model with methods to register various kinds of events Is there any better way to define the function in the class which shares most of the same parameters like functools.partial?

from django.db import models


class RegisterUserAction(models.Manager):
    def register_adhoc_created(self, **kwargs):
        return self.create(action_type="ADHOC_CREATED", **kwargs)

    def register_adhoc_deleted(self, *args, **kwargs):
        return self.create(action_type="ADHOC_DELETED", **kwargs)

    def register_broadcast_created(self, **kwargs):
        return self.create(action_type="BROADCAST_CREATED", **kwargs)
One way would be keep a map of these method names and related action_type. Now we can override __getattribute__ to check if one of these methods were accessed and return the partial function with related action_type.

from functools import partial

from django.db import models


register_map = {
    'register_adhoc_created': 'ADHOC_CREATED',
    'register_adhoc_deleted': 'ADHOC_DELETED',
    'register_broadcast_created': 'BROADCAST_CREATED',
}


class RegisterUserAction(models.Manager):

    def __getattribute__(self, attr):
        if attr in register_map:
            return partial(self.create, action_type=register_map[attr])
        return super(RegisterUserAction, self).__getattribute__(attr)


Personally I would do something like this only when the number of such methods are huge and are polluting the code base. Because simplicity in this case greater than being DRY and other devs will have to spend some understanding it. Also because of this custom implementation the code editors won't allow developers to jump into respective code because such method(s) actually doesn't exist.