Hi Kaspar!

On Sep 1, 2011, at 3:39 PM, Kaspar Schiess wrote:

> When you assume:
> - loaded values must be primitive or are typecast otherwise (to primitive)
> - dumped values must be database compatible
> 
> then I would infer that you can check validity in two ways:
> a) check if the loaded values are primitive
> b) check if the dumped values can be stored in the database
> 
> But the above code checks if the dumped values are primitive?!?! Where am I 
> wrong?


Actually you got it right. It will be improved in the future versions of 
DataMapper where primitive or property class will not be used to determine db 
field types as it is now. Resource attributes will be handled by Virtus* and 
those will be mapped to db fields by…well, something else, we still need to 
figure it out :)

If you're writing a complex custom property then you can check dm-types (JSON, 
Flag, Enum, IPAddress etc.) to find out how to make it work.

* https://github.com/solnic/virtus/

Cheers!

# solnic

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en.

Reply via email to