Merge branch 'master' of github.com:kylewm/woodwind
This commit is contained in:
commit
9897b5270d
2 changed files with 3 additions and 5 deletions
|
@ -107,8 +107,8 @@ class Feed(db.Model):
|
|||
|
||||
class Subscription(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
user_id = db.Column(db.Integer, db.ForeignKey(User.id))
|
||||
feed_id = db.Column(db.Integer, db.ForeignKey(Feed.id))
|
||||
user_id = db.Column(db.Integer, db.ForeignKey(User.id), index=True)
|
||||
feed_id = db.Column(db.Integer, db.ForeignKey(Feed.id), index=True)
|
||||
|
||||
# user-editable name of this subscribed feed
|
||||
name = db.Column(db.String(256))
|
||||
|
|
|
@ -37,8 +37,7 @@ def index():
|
|||
entry_query = db.session.query(Entry, Subscription)\
|
||||
.options(
|
||||
sqlalchemy.orm.subqueryload(Entry.feed),
|
||||
sqlalchemy.orm.subqueryload(Entry.reply_context)
|
||||
)\
|
||||
sqlalchemy.orm.subqueryload(Entry.reply_context))\
|
||||
.join(Entry.feed)\
|
||||
.join(Feed.subscriptions)\
|
||||
.join(Subscription.user)\
|
||||
|
@ -71,7 +70,6 @@ def index():
|
|||
entry_query = entry_query.order_by(Entry.retrieved.desc(),
|
||||
Entry.published.desc())\
|
||||
.offset(offset).limit(per_page)
|
||||
print('found some entries:', len(entry_query.all()))
|
||||
entry_tups = entry_query.all()
|
||||
|
||||
# stick the subscription into the entry.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue