From 1e5d67977972cc7fd12fe9011ad8f5b35a5e11b2 Mon Sep 17 00:00:00 2001 From: Drew Crampsie Date: Thu, 2 Mar 2006 01:49:26 -0800 Subject: [PATCH] fixes from sunrise darcs-hash:20060302094926-5417e-19b82319570c4742c07b89eda68a1b0586d50242.gz --- src/slot-presentations/date.lisp | 4 ++-- src/validation.lisp | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/slot-presentations/date.lisp b/src/slot-presentations/date.lisp index 161b31c..ac34d9b 100644 --- a/src/slot-presentations/date.lisp +++ b/src/slot-presentations/date.lisp @@ -76,7 +76,7 @@ (defclass %date-field (date-field) ((day :component (%integer-range-field :min-value 1 :max-value 31)) (month :component (%integer-range-field :min-value 1 :max-value 12)) - (year :component (%integer-range-field :min-value 2005 :max-value 2015) )) + (year :component (%integer-range-field :min-value 2006 :max-value 2015) )) (:metaclass standard-component-class)) (defmethod shared-initialize :after ((field %date-field) slot-names @@ -241,4 +241,4 @@ form.")) (iterate (for value from (min-value range) to (max-value range)) (<:option :value value :selected (= value (lisp-value range)) - (<:as-html value))))) \ No newline at end of file + (<:as-html value))))) diff --git a/src/validation.lisp b/src/validation.lisp index e118727..d013218 100644 --- a/src/validation.lisp +++ b/src/validation.lisp @@ -77,7 +77,17 @@ Returns T if the ATTRIBUTE-VALUE in INSTANCE passes all the validation functions :attribute attribute)))) - +(defun validate-true (instance attribute) + + (warn "validate ~A ~A" instance attribute) + (let ((value (lol::attribute-value instance attribute))) + (warn "value is ~A" value) + (unless value + + (signal 'attribute-validation-condition + :message (format nil "~A must be true." + (getf (attribute.plist attribute) :label)) + :attribute attribute)))) -- 2.20.1