I have the following model
class MonitorData(models.Model): [... other stuff] starttime = models.CharField(max_length=64, db_column='spurlStartTime', blank=True)
So, the starttime is a char field (in the database, it represents a datetime column)
Now, here's what I am doing:
oo=models.MonitorData.objects.all() print oo[0].starttime print type(oo[0].starttime)
And here's what I am getting:
00:35:59 <type 'datetime.time'>
For my own reasons (don't want to discuss them) I want to read it as a varchar and then parse it myself. But django is NOT allowing me to do that because, for reasons unknown to me, it converts that to a datetime !!!
Can anybody explain to me why django has that behaviour and how can I get my precious strings back ? Is there a way to force django cast this value as string ?
ps: I know how to use str() so pls don't answer me that
oo[0].spurlstarttimeis a typo and should beoo[0].starttime? - astevanovicIntegrityError- Chris Pratt