The following works
posts = BlogPost.query.with_entities(
BlogPost.id, BlogPost.title, BlogPost.subtitle, BlogPost.img_url,
User.id, User.name
)
But the following does not
posts = BlogPost.query(
BlogPost.id, BlogPost.title, BlogPost.subtitle, BlogPost.img_url,
User.id, User.name
)
Cant work out why? I thought both were suposed to be equivelent.
I actualy want to do this partly so I can have a column alius, so
posts = BlogPost.query(
BlogPost.id, BlogPost.title, BlogPost.subtitle, BlogPost.img_url,
User.id, User.name.label("username")
)