diff options
Diffstat (limited to 'db.py')
-rw-r--r-- | db.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -51,6 +51,9 @@ class File(Base): def get_path(self): return os.path.join(settings.file_directory, self.hash + os.path.splitext(self.filename)[1]) + def get_size(self): + return os.path.getsize(self.get_path()) + def html(self): return u'<a href="{root}f/{hash}/{filename}">{filename}</a> ' \ '<sup><a href="{root}f/{hash}">1</a> <a href="{root}f/{hash}{ext}">2</a></sup> ({size}) on {date}'.format( |