sdispater / orator

The Orator ORM provides a simple yet beautiful ActiveRecord implementation.
https://orator-orm.com
MIT License
1.43k stars 173 forks source link

Datetime not working #405

Open robertmylne opened 2 years ago

robertmylne commented 2 years ago

Receiving this issue: 'str' object has no attribute 'tzinfo'

Model:

class Review(Model):
    __table__ = 'reviews'
    __guarded__ = ['id', 'created_at', 'updated_at']
    __dates__ = ['reviewed_at']

Creating:

data = {'reviewed_at': '2021-08-07T09:45:20.000Z'}
Review.create(data)

The date seems to be in a parseable format to me. Not sure why I am getting this error.

I have also tried other formats like 2021-10-02 09:44:04.000.