case_expression = case([(Serp.periodical==1, text("DATE_ADD(MAX(_positions.checkdt) , INTERVAL 1 DAY)")),
                        (Serp.periodical==2, text("DATE_ADD(MAX(_positions.checkdt) , INTERVAL 2 DAY)"))],            
                        else_ = text("DATE_ADD(MAX(_positions.checkdt) , INTERVAL 7 DAY)")).label('next_check')
serps_list = Session.query(Serp, SerpGroups, case_expression).join(SerpGroups).outerjoin(Positions).group_by(Serp.rid)

Add a code snippet to your website: www.paste.org