def METHOD_NAME(cls, view):
    if view.chain:
        plch = view.ndb.schema.plch
        where = '''
                WHERE
                    main.f_target = %s AND
                    main.f_ifindex = %s
                ''' % (
            plch,
            plch,
        )
        values = [view.chain['target'], view.chain['index']]
    else:
        where = ''
        values = []
    return (where, values)