summaryrefslogtreecommitdiff
path: root/db.py
diff options
context:
space:
mode:
Diffstat (limited to 'db.py')
-rw-r--r--db.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/db.py b/db.py
index 8652540..3436ef3 100644
--- a/db.py
+++ b/db.py
@@ -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(