mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-04-01 12:30:24 +00:00
Add stringify methods to LazyGeneratedImageFile
This commit is contained in:
parent
d6b73b8da7
commit
75962976d0
1 changed files with 15 additions and 0 deletions
|
|
@ -73,3 +73,18 @@ class LazyGeneratedImageFile(LazyObject):
|
|||
self._wrapped = GeneratedImageFile(generator)
|
||||
|
||||
self.__dict__['_setup'] = setup
|
||||
|
||||
def __repr__(self):
|
||||
if self._wrapped is None:
|
||||
self._setup()
|
||||
return '<%s: %s>' % (self.__class__.__name__, self or 'None')
|
||||
|
||||
def __str__(self):
|
||||
if self._wrapped is None:
|
||||
self._setup()
|
||||
return str(self._wrapped)
|
||||
|
||||
def __unicode__(self):
|
||||
if self._wrapped is None:
|
||||
self._setup()
|
||||
return unicode(self._wrapped)
|
||||
|
|
|
|||
Loading…
Reference in a new issue