GM-25: Added comments
This commit is contained in:
parent
555aa9a4e1
commit
306cb76e1c
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user