So I didn't really know how to name my problem, so that was my best shot. Right now, my situation is I have a couple tables:
Post
---------
Id
#....
Alert
-------------
Id
like_id
Seen
Like
--------
id
post_id
And right now, I need to setup request handling where I have the id of the post, but what I need to find out is whether another alert corresponding to the same post has already been initiated. So basically, its a "two layer" query, where I have to find alerts that correspond to a like that correspond to the same post. How could I do this with sqlalchemy?