main_image foo bar

This commit is contained in:
Sanj 2011-11-25 00:45:25 +05:30
parent a96e8aad3f
commit 2ca3724057

View File

@ -88,7 +88,9 @@ class ItfModel(models.Model):
def get_main_image(self): def get_main_image(self):
main_image = self.main_image() main_image = self.main_image
if type(main_image).__name__ == 'function':
main_image = main_image()
if main_image is not None: if main_image is not None:
imgfield = main_image imgfield = main_image
elif self.get_modelextra().default_image: elif self.get_modelextra().default_image:
@ -106,9 +108,10 @@ class ItfModel(models.Model):
'thumb': thumb 'thumb': thumb
} }
'''
def main_image(self): def main_image(self):
return None return None
'''
def get_template_path(self): def get_template_path(self):
kls = self.__class__ kls = self.__class__