mirror of
https://github.com/gryf/pygtktalog.git
synced 2025-12-17 11:30:19 +01: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:
@@ -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