Django newbie here. I am crafting a Django model for a SQLite database with string timestamps, e.g. 2014-09-23T18:43:26.692Z. Because I would like to eventually use Django's filtering engine for queries (instead of using strftime), I want my model to generate DateTimeField objects from ISO strings. If I try to declare a DateTimeField on the raw DB field like this
startTime = models.DateTimeField(db_column='startTime')
I get an error: 'unicode' object has no attribute 'isoformat'
I did some digging and tried the following code:
startTime = models.DateTimeField(dateutil.parser.parse(models.TextField(db_column='startTime'))
But now the error is AttributeError: 'TextField' object has no attribute 'read'. What am I doing wrong? Is this even the right approach?