def METHOD_NAME(self):
    """ Assembles an sqlalchemy query object """
    _andlist = []
    if self.title:
        _andlist.append(Activity.title.like('%' + self.title + '%'))
    if self.sport:
        _andlist.append(Activity.sport == self.listSport[self.sport-1])
    if self.listPast[self.past][1]:
        _delta = datetime.timedelta(days=self.listPast[self.past][1])
        _date = datetime.datetime.today() + _delta
        _andlist.append(Activity.date > _date)
    if self.listDuration[self.duration][1]:
        _dur_min = int(self.listDuration[self.duration][1][0])
        _dur_max = int(self.listDuration[self.duration][1][1])
        _andlist.append(Activity.duration.between(_dur_min, _dur_max))
    if self.listDistance[self.distance][1]:
        _dis_min = int(self.listDistance[self.distance][1][0])
        _dis_max = int(self.listDistance[self.distance][1][1])
        _andlist.append(Activity.distance.between(_dis_min, _dis_max))
    ret = None
    first = True
    for expr in _andlist:
        if first:
            ret = expr
            first = False
        else:
            ret = and_(ret, expr)
    return ret