>
> I will give this a try, meanwhile I have created my own column type:
>
> --
> class ISO8601Validator(validators.Validator):
>   def from_python(self, value, state):
>       if value is not None:
>           value = value.strftime('%Y-%m-%d %H:%M:%S.%f')
>       return value
>
>   def to_python(self, value, state):
>       if value is not None:
>           value = datetime.datetime.strptime(value, '%Y-%m-%d %H:%M:%S.%f')
>       return value
>
> class SOISO8601Col(SOStringCol):
>   def createValidators(self):
>       return [ISO8601Validator()] + \
>           super(SOISO8601Col, self).createValidators()
>
> class ISO8601Col(StringCol):
>   baseClass = SOISO8601Col
> --
>
> If you want to go your own way, what about magic attributes?

http://www.sqlobject.org/SQLObject.html#adding-magic-attributes-properties

I think it is possible to store the time value as decimal and when in the
time of reading you can convert it into the desired format.

Regards

Petr
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to