Re: DateField is a string in model instance instead of datetime object

2021-08-29 Thread Sebastian Jung
Hello, I think this behaviour is absolut normal. When you create on a databasesystem a datefield and make a insert with this field with string '2021-08-21' then databasesystem convert this string automatical into date... So i think this has nothing to do with python/django and this behaviour i wo

DateField is a string in model instance instead of datetime object

2021-08-29 Thread 1oglop1
Hello, I have a problem that DateField or DateTime fields are `str` instead of datetime objects after the model has been instantiated/created. But when the model is returned from the database it is a correct object. How can I prevent this? given: ``` class My(models.Model): dt_obj = mode