def make_contrib(func=None):
    def contribute_to_class(self, cls, name):
        if func:
            func(self, cls, name)
        else:
            super(self.__class__, self).contribute_to_class(cls, name)
        setattr(cls, self.name, Creator(self))

    return contribute_to_class
Returns a suitable contribute_to_class() method for the Field subclass.
dataset/ETHPy150Open CollabQ/CollabQ/vendor/django/db/models/fields/subclassing.py/make_contrib