Source

tgapp-smallpress / smallpress / model / models.py

Diff from to

File smallpress/model/models.py

 
 import os
 from datetime import datetime
-from tgext.datahelpers.fields import AttachedImage
+from tgext.datahelpers.fields import Attachment as DatahelpersAttachment, AttachedFile
 from smallpress.model import DeclarativeBase, DBSession
 from tgext.pluggable import app_model, primary_key
 from tgext.pluggable import call_partial
 except ImportError:
     sqla_events = False
 
-AttachmentType = tg.config.get('_smallpress',{}).get('attachment_type', AttachedImage)
+AttachmentType = tg.config.get('_smallpress',{}).get('attachment_type', AttachedFile)
 
 class Blog(DeclarativeBase):
     __tablename__ = 'smallpress_blogs'
 
     uid = Column(Integer, autoincrement=True, primary_key=True)
     name = Column(Unicode(16), nullable=False)
-    content = Column(AttachmentType)
+    content = Column(DatahelpersAttachment(AttachmentType))
 
     article_id = Column(Integer, ForeignKey(Article.uid))
     article = relation(Article, backref=backref('attachments', cascade='all, delete-orphan'))