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:
parent
a04c76b0c6
commit
2acf06e5e5
@ -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 []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user