feat: get_code.dspy supports prepend_all=1 to add '全部' option

When prepend_all=1 is passed, insert {valueField:'', textField:'全部'}
as the first item in the result array. Used by InlineForm search fields.
This commit is contained in:
Hermes Agent 2026-06-22 12:11:51 +08:00
parent a04c76b0c6
commit 2acf06e5e5

View File

@ -23,5 +23,7 @@ debug(f'/appbase/get_code.dspy: {sql=}')
async with db.sqlorContext(params_kw.dbname) as sor: async with db.sqlorContext(params_kw.dbname) as sor:
rs = await sor.sqlExe(sql, ns) rs = await sor.sqlExe(sql, ns)
if params_kw.get('prepend_all') == '1':
rs.insert(0, {params_kw.valueField: '', params_kw.textField: '全部'})
return rs return rs
return [] return []