3 (defun find-many-to-many-class (slot-name instance
)
4 (let* ((imd (getf (meta-model::find-slot-metadata instance slot-name
)
6 (jc (make-instance (getf imd
:join-class
)))
7 (jcmd (getf (meta-model::find-slot-metadata jc
(getf imd
:target-slot
))
9 (getf jcmd
:join-class
)))
12 (defattribute many-to-many
()
17 (defdisplay (:description
(attribute many-to-many
))
18 (let ((instances (select-instances object t
))
21 (<:li
(<ucw
:button
:action
(add-new-relation component object
(getp slot-name
))
22 (<:as-html
"Add New")))
23 (<:li
(<ucw
:button
:action
(add-new-relation component object new-instance
)
25 (<ucw
:select
:accessor new-instance
26 (arnesi:dolist
* (i instances
)
29 (display component i
:type
'one-line
)))))
30 (dolist* (i (attribute-value object attribute
))
32 (<ucw
:a
:action
(call-view ((car i
) (action-view slot
) (ucw::parent slot
)))
33 (<:as-html
"(view) "))
34 (<ucw
:a
:action
(delete-relationship slot
(second i
) instance
)
35 (<:as-html
"(remove) "))
36 (display component object
)))))
37 (display component
(mapcar #'car
(slot-value object
(getp :slot-name
)))))