Q:

How can I use  similar functions across all Models in Django

I have three functions which I need in every Django Model:
def __unicode__(self):
            return self.MODELNAME_name

def get_absolute_url(self):
            return "/MODELNAME/list/" 

def get_fields(self):
            return [(field, field.value_to_string(self)) for field in MODELNAME._meta.fields]

The only thing different is the MODELNAME
How can I use inheritance so that I use three functions in one class and other inherit from it?

A:

You could use multiple inheritance:
class CommonFunctions(object):
    def __unicode__(self):
        return self.MODELNAME_name
    def get_absolute_url(self):
        return "/MODELNAME/list/" 
    def get_fields(self):
        return [(field, field.value_to_string(self)) for field in MODELNAME._meta.fields]

class ZeModel(models.Model, CommonFunctions):
    [...]

x = ZeModel()
x.get_absolute_url()

(Make sure you replace MODELNAME with self.__class__.__name__)
I did not test this, but it should work.

