cached property
This commit is contained in:
parent
850ecc97c8
commit
0a5af976b8
|
@ -8,6 +8,7 @@ from django.utils.html import mark_safe
|
|||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.db.models.signals import m2m_changed
|
||||
from django.dispatch import receiver
|
||||
from django.utils.functional import cached_property
|
||||
|
||||
|
||||
from photologue.models import Photo, Gallery
|
||||
|
@ -155,7 +156,7 @@ class Content(models.Model):
|
|||
if src:
|
||||
return mark_safe(u'<a href="{}"><img src="{}"></a>'.format(self.get_absolute_url(), src))
|
||||
|
||||
@property
|
||||
@cached_property
|
||||
def image_url(self):
|
||||
if self.photo:
|
||||
url = self.photo.image.url
|
||||
|
|
Loading…
Reference in New Issue
Block a user