GM-25: Added comments

This commit is contained in:
Anatoly 2019-09-16 09:35:20 +03:00
parent 555aa9a4e1
commit 306cb76e1c

View File

@ -300,6 +300,7 @@ class Carousel(models.Model):
@property
def name(self):
# Check if Generic obj has name or title
if hasattr(self.content_object, 'name'):
return self.content_object.name
if hasattr(self.content_object, 'title'):
@ -322,7 +323,9 @@ class Carousel(models.Model):
@property
def image(self):
# Check if Generic obj has an image
if not hasattr(self.content_object.image, 'url'):
# Check if Generic obj has a FK to gallery
return self.content_object.image.image.url
return self.content_object.image.url