merged
This commit is contained in:
commit
f447026581
|
@ -253,17 +253,15 @@ class ItfModel(models.Model):
|
||||||
Get the main image thumbnail for this object - checks if object has either a field or custom method called 'main_image', then checks for default_images on the ModelExtra for this model.
|
Get the main image thumbnail for this object - checks if object has either a field or custom method called 'main_image', then checks for default_images on the ModelExtra for this model.
|
||||||
'''
|
'''
|
||||||
def get_main_image(self, size="142x150"):
|
def get_main_image(self, size="142x150"):
|
||||||
|
imgfield = None
|
||||||
if hasattr(self, 'main_image'):
|
if hasattr(self, 'main_image'):
|
||||||
main_image_getter = self.main_image
|
main_image_getter = self.main_image
|
||||||
if type(main_image_getter).__name__ == 'instancemethod':
|
if type(main_image_getter).__name__ == 'instancemethod':
|
||||||
imgfield = main_image_getter()
|
imgfield = main_image_getter()
|
||||||
else:
|
else:
|
||||||
imgfield = main_image_getter
|
imgfield = main_image_getter
|
||||||
else:
|
|
||||||
imgfield = self.get_modelextra().default_image #FIXME!!
|
|
||||||
|
|
||||||
if imgfield is None or imgfield.name == '' and self.get_modelextra():
|
if imgfield is None or imgfield.name == '':
|
||||||
imgfield = self.get_modelextra().default_image
|
imgfield = self.get_modelextra().default_image
|
||||||
|
|
||||||
if imgfield:
|
if imgfield:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user