Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Feed view is not working properly with sqllite #22

Open
yarsanich opened this issue Apr 14, 2019 · 0 comments
Open

Feed view is not working properly with sqllite #22

yarsanich opened this issue Apr 14, 2019 · 0 comments

Comments

@yarsanich
Copy link

yarsanich commented Apr 14, 2019

Hi,

Thanks for Flask implementation of realworld backend app.

I tried to launch it with sqllite as db. I got an error on feed view.

def articles_feed(limit=20, offset=0):
return Article.query.join(current_user.profile.follows). \
order_by(Article.createdAt.desc()).offset(offset).limit(limit).all()
returned

AttributeError: 'AppenderQuery' object has no attribute 'is_selectable'

I saw that UserProfile follows relation has defined join, but looks like it is not working properly. I did not try to launch it with PostgreSQL, maybe issue related to DB.

Explicit join works fine

return Article.query.join(UserProfile).join(followers_assoc, (followers_assoc.c.followed_by == Article.author_id)).\
        filter(followers_assoc.c.follower == user_profile_id).\
        order_by(Article.createdAt.desc()).offset(offset).limit(limit).all()
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant