How to store functions in django models
问题 edit: I completely rewrote the question as the original one didn't clearly explain my question I want to run a function which is specific to each particular model instance. Ideally I want something like this: class MyModel(models.Model): data = models.CharField(max_length=100) perform_unique_action = models.FunctionField() #stores a function specific to this instance x = MyModel(data='originalx', perform_unique_action=func_for_x) x.perform_unique_action() #will do whatever is specified for