Skip to content

Commit 7303274

Browse files
committed
Added custom field type behaviour for case without options
1 parent 895311c commit 7303274

File tree

3 files changed

+41
-29
lines changed

3 files changed

+41
-29
lines changed

Diff for: get-table-view-field.lisp

+32-26
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,36 @@
7575
(strip-tags slot-val)
7676
(prin1-to-string slot-val))))))))
7777
(:method ((type (eql :single-relation)) description model-description-list)
78-
(let ((relation-model-description-list (get-model-description-from-field-description-options description)))
79-
(cond
80-
(relation-model-description-list
81-
(list
82-
(list
83-
(keyword->symbol (getf description :name))
84-
:label (getf description :title)
85-
:present-as 'text
86-
:reader (if (description-of-a-tree-p relation-model-description-list)
87-
(lambda (item)
88-
(let ((item (slot-value item (keyword->symbol (getf description :name)))))
89-
(and
90-
item
91-
(tree-path-pretty-print item))))
92-
(lambda (item)
93-
(let ((item (slot-value item (keyword->symbol (getf description :name)))))
94-
(and
95-
item
96-
(bootstrap-typeahead-title item))))))))
97-
(t (list
98-
(list
99-
(keyword->symbol (getf description :name))
100-
:hidep t
101-
:label (getf description :title)))))))
78+
(let ((relation-model-description-list (get-model-description-from-field-description-options description)))
79+
(cond
80+
(relation-model-description-list
81+
(list
82+
(list
83+
(keyword->symbol (getf description :name))
84+
:label (getf description :title)
85+
:present-as 'text
86+
:reader (if (description-of-a-tree-p relation-model-description-list)
87+
(lambda (item)
88+
(let ((item (slot-value item (keyword->symbol (getf description :name)))))
89+
(and
90+
item
91+
(tree-path-pretty-print item))))
92+
(lambda (item)
93+
(let ((item (slot-value item (keyword->symbol (getf description :name)))))
94+
(and
95+
item
96+
(bootstrap-typeahead-title item))))))))
97+
(t (list
98+
(list
99+
(keyword->symbol (getf description :name))
100+
:hidep t
101+
:label (getf description :title)))))))
102102
(:method ((type (eql :custom)) description model-description-list)
103-
(destructuring-bind (package symbol) (mapcar #'string-upcase (ppcre:split ":+" (getf description :options)))
104-
(funcall (intern symbol package) :table description model-description-list))))
103+
(let ((parts (ppcre:split ":+" (getf description :options))))
104+
(if (equal (length parts) 2)
105+
(destructuring-bind (package symbol) (mapcar #'string-upcase parts)
106+
(funcall (intern symbol package) :form description model-description-list))
107+
(list
108+
(list
109+
(keyword->symbol (getf description :name))
110+
:hidep t))))))

Diff for: get-view-field.lisp

+8-2
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,11 @@
146146
:hidep t
147147
:label (getf description :title)))))))
148148
(:method ((type (eql :custom)) description model-description-list)
149-
(destructuring-bind (package symbol) (mapcar #'string-upcase (ppcre:split ":+" (getf description :options)))
150-
(funcall (intern symbol package) :form description model-description-list))))
149+
(let ((parts (ppcre:split ":+" (getf description :options))))
150+
(if (equal (length parts) 2)
151+
(destructuring-bind (package symbol) (mapcar #'string-upcase parts)
152+
(funcall (intern symbol package) :form description model-description-list))
153+
(list
154+
(list
155+
(keyword->symbol (getf description :name))
156+
:hidep t))))))

Diff for: version.lisp-expr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"0.4.0"
1+
"0.4.1"

0 commit comments

Comments
 (0)