it's the instance that has the data, not the class

thingy_objects
Marnanel Thurman 2018-08-19 16:56:18 +01:00
rodzic 368434fd89
commit 0c07191660
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -37,8 +37,8 @@ class Cobject(models.Model):
if method_name==None:
method_name = field
if hasattr(self.__class__, method_name):
method = getattr(self.__class__, method_name)
if hasattr(self, method_name):
method = getattr(self, method_name)
if callable(method):
result[field] = str(method())