Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Database template column support using values from other columns https://github.com/siyuan-note/siyuan/issues/9327

Daniel7556d1c3a28c
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index d72d62ce57..9938ebbc3b 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -54,6 +54,9 @@ func renderTemplateCol(blockID, tplContent string, rowValues []*av.KeyValues) st
for k, v := range ial {
dataModel[strings.ReplaceAll(k, "custom-", "custom_")] = v
}
+ for _, rowValue := range rowValues {
+ dataModel[rowValue.Key.Name] = rowValue.Values[0].String()
+ }
if err := tpl.Execute(buf, dataModel); nil != err {
logging.LogWarnf("execute template [%s] failed: %s", tplContent, err)
}