<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def query_under_condition(condition, kind='2'):
        '''
        Get All data of certain kind according to the condition
        '''
        if DB_CFG['kind'] == 's':
            return TabPost.select().where(
                (TabPost.kind == kind) & (TabPost.valid == 1)
            ).order_by(
                TabPost.time_update.desc()
            )

        return TabPost.select().where(
            (TabPost.kind == kind) &
            (TabPost.valid == 1) &
            TabPost.extinfo.contains(condition)
        ).order_by(TabPost.time_update.desc())