*sigh*

Me and record aren't getting along so well :-/

I'm thinking the right thing would be to add additional fields into 
net.liftweb.record.field for optional/nullable versions, e.g. 
OptionalStringField[OwnerType] extends Field[Option[String], OwnerType] and 
then make my JSON-specific versions, e.g. JSONOptionalStringField. This way 
anyone coming along to write another record implementation can just extend 
those as they can for the other base fields. Oh, and Option not Box because I 
don't know what role Failure would be and it seems nice to simplify match 
statements and so on.

I've gone along that path in my working copy; if anyone thinks that's not the 
right thing to do, please by all means let me know.

I'm hoping to have a finished version ready for review by mid this coming week, 
though I may just end up pushing a branch version if I don't have enough time 
to wrap up all the loose ends, so everyone can take a look if they like. 

-Ross

On Jan 8, 2010, at 7:52 PM, Timothy Perrett wrote:

> Whilst I didn't need option feilds, making custom field types is part of the 
> course with Record as the defaults are just that; defaults :-)
> 
> Cheers, Tim
> 
> Sent from my iPhone
> 
> On 8 Jan 2010, at 23:37, Ross Mellgren <dri...@gmail.com> wrote:
> 
>> So I'm trying to write the CouchDB / Lift-JSON record instance, however I've 
>> run into a major snag, which is null handling. The DBRecord implementation 
>> is not complete, so I can't see how other things are doing it, and I tried 
>> hacking around and I can't figure out how Record supports null fields 
>> (missing values, really). In particular I need this for the couch type of 
>> record because not every record has an _id or _rev, so I need to represent 
>> no-value. I prefer to use Option or Box for this, but none of the built in 
>> field types have this pattern.
>> 
>> Do I need to make new net.liftweb.record.field.OptionalStringField, 
>> OptionalBooleanField, etc etc? Or is there something I'm missing?
>> 
>> -Ross
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Lift" group.
>> To post to this group, send email to lift...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> liftweb+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/liftweb?hl=en.
>> 
>> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Lift" group.
> To post to this group, send email to lift...@googlegroups.com.
> To unsubscribe from this group, send email to 
> liftweb+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/liftweb?hl=en.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.


Reply via email to