well, right now i'm not even using clsql, i'm just using prevalence.
and actually, i do have the deftype and the typespec methods defined,
which is why i couldn't figure out why that wasn't working. this is
the code i used, straight from that link:

(deftype money () 'number)

(defclass money-presentation (text-presentation input-presentation) ()
  (:documentation "@short{A presentation for displaying money}"))

(defclass money-parser (parser)
  () ;; No slots
  (:default-initargs :error-message "a money value (no dollar sign)"))

(defmethod typespec->form-view-field-parser ((scaffold form-scaffold)
                                             (typespec (eql 'money))
args)
  (values t (make-instance 'money-parser)))

(defmethod typespec->view-field-presentation (scaffold
                                              (typespec (eql 'money))
args)
  (values t (make-instance 'money-presentation)))

On Dec 11, 7:29 pm, Stephen Compall <[email protected]> wrote:
> Matt Moriarity <[email protected]> writes:
> > i just kinda figured it would figure it out based on the type in the
> > slot.
>
> In order for that to work, you need matching eql-specializers in the
> typespec->* generic functions.  The ones defined in that tutorial use
> (eql 'money).  Of course, unless all slots with type float should be
> interpreted as money, the :present-as/:parse-as is a better solution.
>
> Another alternative is to (deftype money () float) and use :type money
> for your slots, but, for example, if you use CLSQL, you have to take
> care to let it know about the type alias, by defining methods on
> database-get-type-specifier, database-output-sql-as-type,
> and read-sql-value.  These are trivial forwards to the (eql 'float)
> variants defined in CLSQL proper, but defining them still entails
> store-specific hacking in your app, if that is your thing.
>
> --
> I write stuff athttp://failex.blogspot.com/now.  But the post
> formatter and themes are terrible for sharing code, the primary
> content, so it might go away sooner or later.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to