summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-04-15 15:20:16 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-04-15 15:20:16 +0200
commitfc40d7c22a54bf11b05b1e3e0015bc90530d66e8 (patch)
treeb9a23e49858c2dadeeed9755539ad6353377f4da
parent53b004dc40944b919336906216511821c78bf7f5 (diff)
Return unicode data from File.html().
-rw-r--r--db.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/db.py b/db.py
index ada397c..9c49155 100644
--- a/db.py
+++ b/db.py
@@ -52,7 +52,7 @@ class File(Base):
return os.path.join(settings.file_directory, self.hash + os.path.splitext(self.filename)[1])
def html(self):
- return '<a href="/f/{hash}/{filename}">{filename}</a> <sup><a href="/f/{hash}">1</a> <a href="/f/{hash}{ext}">2</a></sup> ({size}) on {date}'.format(
+ return u'<a href="/f/{hash}/{filename}">{filename}</a> <sup><a href="/f/{hash}">1</a> <a href="/f/{hash}{ext}">2</a></sup> ({size}) on {date}'.format(
hash = self.hash, filename = self.filename, ext = os.path.splitext(self.filename)[1],
size = self.pretty_size(os.path.getsize(self.get_path())), date = self.date.strftime('%Y-%m-%d %H:%M:%S UTC'))