X-Git-Url: https://git.hcoop.net/clinton/lisp-on-lines.git/blobdiff_plain/15bc66bdec222f512812a9db7e0789bb45b20fb3..8c6914bd27843fc74d07da3965fafaac09c85c4e:/src/slot-presentations.lisp diff --git a/src/slot-presentations.lisp b/src/slot-presentations.lisp index c92fa4b..188db91 100644 --- a/src/slot-presentations.lisp +++ b/src/slot-presentations.lisp @@ -1,4 +1,7 @@ +;; i know this is horrible, but it works wonders. (declaim (optimize (speed 0) (space 3) (safety 0))) + + (in-package :lisp-on-lines) @@ -95,12 +98,12 @@ When T, only the default value for primary keys and the joins are updated.") (default-to-now-p :accessor default-to-now-p :initarg :default-to-now-p :initform nil)) (:type-name clsql-sys:wall-time)) -(defmethod presentation-slot-value ((slot clsql-wall-time-slot-presentation) instance) +(defmethod lol::presentation-slot-value ((slot clsql-wall-time-slot-presentation) instance) (let ((date (call-next-method))) (when date (multiple-value-bind (y m d) (clsql:time-ymd date) (format nil "~a/~a/~a" m d y))))) -(defmethod (setf presentation-slot-value) ((value string) (slot clsql-wall-time-slot-presentation) instance) +(defmethod (setf lol::presentation-slot-value) ((value string) (slot clsql-wall-time-slot-presentation) instance) (let ((new-time (clsql:parse-date-time (remove #\Space value))) (old-time (when (slot-boundp instance (slot-name slot)) (slot-value instance (slot-name slot))))) @@ -112,17 +115,17 @@ When T, only the default value for primary keys and the joins are updated.") (defmethod label :around ((slot clsql-wall-time-slot-presentation)) (concatenate 'string (call-next-method) " (m/d/y)")) -(defmethod present-slot ((slot clsql-wall-time-slot-presentation) instance) - (let ((date (presentation-slot-value slot instance))) +(defmethod lol::present-slot ((slot clsql-wall-time-slot-presentation) instance) + (let ((date (lol::presentation-slot-value slot instance))) ;; Default values (when (and (not date) (default-to-now-p slot)) - (setf (presentation-slot-value slot instance) (clsql:get-time))) + (setf (lol::presentation-slot-value slot instance) (clsql:get-time))) ;;simple viewer (if (and date (not (editablep slot))) (<:as-html date)) ;; editor (when (editablep slot) - (