diff options
Diffstat (limited to 'db.py')
-rw-r--r-- | db.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -73,9 +73,11 @@ class File(Base): def is_image(self): return self.get_mime_type().startswith('image') - def image_html(self): - return u'<a href="{root}f/{hash}{ext}" title="{filename}"><img src="{root}t/{hash}" alt="{filename}" onerror="thumb_onerror(this)" /></a>'.format( - root = settings.virtual_root, hash = self.hash, filename = self.filename, ext = os.path.splitext(self.filename)[1]) + @property + def ext(self): + return os.path.splitext(self.filename)[1] Base.metadata.create_all() Session = sessionmaker(bind = engine, autoflush = True, autocommit = False) + +# vim: noet ts=4 |