Skip to content

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

:art: Supports multiple views for the database https://github.com/siyuan-note/siyuan/issues/9751

Daniel57b7a90f55e5
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index b95d88c848..57c17705a1 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -1431,11 +1431,6 @@ func addAttributeViewColumn(operation *Operation) (err error) {
return
}
- view, err := attrView.GetCurrentView()
- if nil != err {
- return
- }
-
keyType := av.KeyType(operation.Typ)
switch keyType {
case av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset, av.KeyTypeTemplate, av.KeyTypeCreated, av.KeyTypeUpdated, av.KeyTypeCheckbox:
@@ -1446,9 +1441,11 @@ func addAttributeViewColumn(operation *Operation) (err error) {
key := av.NewKey(operation.ID, operation.Name, icon, keyType)
attrView.KeyValues = append(attrView.KeyValues, &av.KeyValues{Key: key})
- switch view.LayoutType {
- case av.LayoutTypeTable:
- view.Table.Columns = append(view.Table.Columns, &av.ViewTableColumn{ID: key.ID})
+ for _, v := range attrView.Views {
+ switch v.LayoutType {
+ case av.LayoutTypeTable:
+ v.Table.Columns = append(v.Table.Columns, &av.ViewTableColumn{ID: key.ID})
+ }
}
}