mirror of
https://github.com/gryf/pygtktalog.git
synced 2026-10-06 13:40:42 +02:00
Changing soft fields for Image object
Till now there was an idea to expose full path to image file and thumbnail. It's quite impossible in certain situations, where path to the media files is not known. Therefore 'imagepath' was removed due to redundancy with filename stored in db, and 'thumpath', which now is a simple calculation of the expected thumbnail relative filepath.
This commit is contained in:
1 parent
a87da6b27c
commit
33a8f99d48
1 file changed
+3
-10
+3
-10
@@ -213,20 +213,13 @@ class Image(Base):
|
||||
return img
|
||||
|
||||
@property
|
||||
def thumbpath(self):
|
||||
def thumbnail(self):
|
||||
"""
|
||||
Return full path to thumbnail of this image
|
||||
Return path to thumbnail for this image
|
||||
"""
|
||||
path, fname = os.path.split(self.filename)
|
||||
base, ext = os.path.splitext(fname)
|
||||
return os.path.join(self.img_path, path, base + "_t" + ext)
|
||||
|
||||
@property
|
||||
def imagepath(self):
|
||||
"""
|
||||
Return full path to image
|
||||
"""
|
||||
return os.path.join(self.img_path, self.filename)
|
||||
return os.path.join(path, base + "_t" + ext)
|
||||
|
||||
def __repr__(self):
|
||||
return "<Image('%s', %s)>" % (str(self.filename), str(self.id))
|
||||
|
||||
Reference in new issue
Block a user