diff --git a/src/view.lisp b/src/view.lisp index f0cbe8b..262240c 100644 --- a/src/view.lisp +++ b/src/view.lisp @@ -49,3 +49,16 @@ :url-for)) (setf djula:*djula-execute-package* (find-package :ritherdon-archive.djula)) + +;; Custom filters and template code added below... +;; ============================================================================= + +;; This filter is for converting Integers used to store Boolean values +;; in a SQLite database. The intended place you will use this filter +;; is in the /software section. The most notable parts being the /add +;; and /edit sections. In the SQLite database, I have set: +;; - 0 => false +;; - 1 => true. +;; In this case, if the `VALUE' is not 1, it is always false (I.E. 0). +(djula::def-filter :integer-to-checkbox (value) + (format nil "~S" (if (= 1 value) "on" "off")))