I'm trying to do the following in Flask-SQLAlchemy:
SELECT recipe_id
FROM UserRecipe
WHERE
user_id == 3
AND
status != 'donotshow'
This is the best I've come up with so far:
user = User.query.filter_by(url=url).first_or_404()
userrecipes = UserRecipe.query.filter(user_id==user.id, status!='donotshow').with_entities(UserRecipe.recipe_id)
I get an error:
NameError: name 'user_id' is not defined
Would really appreciate some help :)