title: Django model field storing a function or class
body: <p>Is it possible to create a Django Custom Model Field that references a function or class, instead of a model?</p>
  
  <p>In case you're wondering why i would want this, here's a brief explanation of waht i'm trying to achieve.</p>
  
  <p>Basically i have a FreightTable model, that is used to calculate the value of a freight, so it should have method to do this. But the problem is that there are several different ways to calculate it, and each instance of the FreightTable should calculate on its specific way.</p>
  
  <p>At first i thought about solving this using some kind of polymorphism, but then i would have to create an specific model for each different algorithm, and they would also be in different tables in the DB, what would be a problem for me. I also thought about using <a href="https://django-polymorphic.readthedocs.org" rel="nofollow">Django Polymorphic</a>, but i heard it doesnt really scale well, so it's also not a good idea.</p>
  
  <p>My thought is that if I could just reference this different algorithms on a Model Field, I'll have an ellegant and eficient solution.</p>