As some people above said it's imposible to actualy store a time in
sqlserver since the server does not have a time type, what it has is
datetime.
Now if you don't mind ugly hacks (I dont and you saw my implementations
of limit/offset which I see some people find as ugly) then one would be
like this, at least in the sqlserver->python direction:
if year==1899 and month==12 and day==30: return datetime.Time
elif hr==0 and min==0 and sec==0: return datetime.Date
else return datetime.datetime
The Time is ok, the Date is of course probably somewhat problematic if
adding a datetime at midnight. This is the only way I can see this
implemented.
Why 1899/12/30, ask microfost.
Going the other direction there is nothing you need to do because when
you just put a "time string", it will be "1899/12/30 time" datetime, or
if you put a "date string", it will be "date 00:00:00" datetime while
"datetime string" is just that.
For more info on sqlserver in the context of a python ORM somewhat
similar to django, look at my implementation for my own ORM webform
(http://www.emilas.com/pwh/)
I hope this helped
Gheorghe Milas
(http://www.emilas.com/george/)