- Add data_filter with 4 searchable fields (name LIKE, model LIKE, providerid, upappid) - Add filter_labels for search form display - Create llm_list.dspy with DBFilter support and LIKE wildcard handling - Create llm_create.dspy, llm_update.dspy, llm_delete.dspy - Create get_organizations.dspy and get_upapps.dspy for dropdown options - Add browserfields alters for providerid and upappid dropdowns - Add editable URLs for DataViewer CRUD operations
24 lines
678 B
Python
24 lines
678 B
Python
#!/usr/bin/env python3
|
|
import json
|
|
|
|
result = {'success': False, 'message': ''}
|
|
|
|
try:
|
|
dbname = get_module_dbname('llmage')
|
|
async with DBPools().sqlorContext(dbname) as sor:
|
|
data = params_kw.copy()
|
|
data.pop('page', None)
|
|
data.pop('rows', None)
|
|
data.pop('data_filter', None)
|
|
record_id = data.get('id')
|
|
if not record_id:
|
|
result['message'] = '缺少id'
|
|
else:
|
|
await sor.D('llm', {'id': record_id})
|
|
result['success'] = True
|
|
result['message'] = '删除成功'
|
|
except Exception as e:
|
|
result['message'] = str(e)
|
|
|
|
return json.dumps(result, ensure_ascii=False, default=str)
|