i'd like to make the DateTimefield of models accept unix timestamp (in seconds) values.
I found this but the acepted solution doesn't work?
unixtimestamp input in DataTimeField
i.e. i don't see how adding '%s' as an input format will work, especially when the code for to_python() of the standard datetime field doesn't include any logic for handling unix timestamps.
If there is a setting that allows me to do this great.
Otherwise, what I think i want is to subclass DateTimeField and somehow automatically convert the int to a datetime object when i set the value. I want to do this before saving instead of overriding save() because i want consistency when retrieving the value of this field. i.e. when I take the value out, I don't want to worry about if i have a datetime object or an int regardless of if the instance has been saved or not.
I looked at source of django.db.models.fields and it's not apparent to me.