title: SQLAlchemy update record with case clause and enum
body: <p>I have defined the following model and <code>enum</code>:</p>
  
  <pre><code>class StatusEnum(enum.Enum):
      NEW = 'NEW'
      PROCESSED = 'PROCESSED'
      IN_PROGRESS = 'IN_PROGRESS'
  
  class RequestLog(Base):
      __tablename__ = 'request_log'
  
      ...
      status = Column(Enum(StatusEnum))
      ...
  </code></pre>
  
  <p>I'm trying to update the record in the following way:</p>
  
  <pre><code>&gt;&gt;&gt; session.query(RequestLog).filter(RequestLog.id.in_([8])).update(
  {'status': case(
      [(RequestLog.attempt_done_count == RequestLog.attempt_count - 1, StatusEnum.PROCESSED)],
      else_=StatusEnum.IN_PROGRESS)},
  synchronize_session=False)
  </code></pre>
  
  <p>During this, I received an error:</p>
  
  <pre><code>sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'StatusEnum' [SQL: 'UPDATE request_log SET status=CASE WHEN (request_log.attempt_done_count = request_log.attempt_count - %(attempt_count_1)s) THEN %(param_1)s ELSE %(param_2)s END WHERE request_log.id IN (%(id_1)s)'] [parameters: {'param_2': &lt;StatusEnum.IN_PROGRESS: 'IN_PROGRESS'&gt;, 'attempt_count_1': 1, 'param_1': &lt;StatusEnum.PROCESSED: 'PROCESSED'&gt;, 'id_1': 8}]
  </code></pre>