I have a calculated column that takes the first non-NULL value among
three dates.  It should remain a datetime object but instead it's
being converted to a string.  Is it possible to tell SQLAlchemy to
treat this value like a DateTime column?

# Table t_incident defined with
    sa.Column("last_entry_date", sa.types.DateTime, nullable=True),
    sa.Column("create_date", sa.types.DateTime, nullable=False),

# Standalone column definition
c_activity = sa.func.coalesce(
    t_incident.c.last_entry_date,
    t_incident.c.create_date,
    ).label("activity")

# Mapping
orm.mapper(Incident, t_incident, properties={
    "activity": orm.column_property(c_activity)
    })

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to