title: SQL Alchemy - Setting datetime as a string and getting a date?
body: <p>I'm currently setting up a class using SQL Alchemy. This class has a <code>start_date</code> attribute, defined such as:</p>
  
  <pre><code>from sqlalchemy import Column, DateTime
  from sqlalchemy.dialects.postgresql import UUID
  from sqlalchemy.ext.declarative import declarative_base
  
  Base = declarative_base()
  
  class Foo(Base):
      __tablename__ = "foo"
  
      id = Column(UUID(as_uuid=True), primary_key=True)
      start_date = Column(DateTime, nullable=True)
  </code></pre>
  
  <p>Yet, I'm facing a type issue:</p>
  
  <pre><code>foo = Foo(start_date="2019-05-05")
  print(foo.start_date, type(foo.start_date))
  
  # 2019-05-05 &lt;class 'str'&gt;
  </code></pre>
  
  <p>I would expect a datetime here, especially as when fetching the same record from the database, I retrieve a date time object:</p>
  
  <pre><code>foo = Foo(id=uuid.uuid4(), start_date="2019-05-05")
  db_session.add(foo)
  db_session.commit()
  
  db_session.refresh(foo)
  print(foo.start_date, type(foo.start_date))
  
  # 2019-03-01 00:00:00 &lt;class 'datetime.datetime'&gt;
  </code></pre>
  
  <p>Is there any way to force a cast from the <code>Column</code> declaration? </p>