minor change in db-structure, made mailtext column selectable
This commit is contained in:
@ -57,3 +57,15 @@ class Entry(Base):
|
||||
pp.pprint(entry.get('enclosures'))
|
||||
#self.enclosures = entry.get('enclosures')
|
||||
self.lastfetched = datetime.now()
|
||||
|
||||
def get_text(self):
|
||||
if self.feed.contentcolumn == 'summary':
|
||||
text = self.summary
|
||||
elif self.feed.contentcolumn == 'content':
|
||||
text = self.content
|
||||
elif self.feed.contentcolumn == 'fullpage':
|
||||
text = self.fullpage
|
||||
elif self.feed.contentcolumn == 'readability':
|
||||
text = self.readability
|
||||
return text
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
#coding: utf-8
|
||||
|
||||
from sqlalchemy import Column, Integer, String, Boolean
|
||||
from sqlalchemy import Column, Integer, String, Boolean, Enum
|
||||
|
||||
from models import Base
|
||||
|
||||
@ -15,16 +15,17 @@ class Feed(Base):
|
||||
resolveredirects = Column(Boolean)
|
||||
readability = Column(Boolean)
|
||||
fullpage = Column(Boolean)
|
||||
html2textsummary = Column(Boolean)
|
||||
contentcolumn = Column(Enum('summary', 'content', 'fullpage', 'readability'))
|
||||
html2textcontent = Column(Boolean)
|
||||
html2textignoreimages = Column(Boolean)
|
||||
enabled = Column(Boolean)
|
||||
|
||||
def __init__(self, url, daily, readability, fullpage, enabled, html2textsummary):
|
||||
def __init__(self, url, daily, readability, fullpage, enabled, html2textcontent):
|
||||
self.url = url
|
||||
self.daily = daily
|
||||
self.readability = readability
|
||||
self.fullpage = fullpage
|
||||
self.html2textsummary = html2textsummary
|
||||
self.html2textcontent = html2textcontent
|
||||
self.enabled = enabled
|
||||
|
||||
def __repr__(self):
|
||||
|
Reference in New Issue
Block a user