Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion restfulpy/orm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from nanohttp import HttpBadRequest, context, HttpNotFound
from sqlalchemy import Column, event
from sqlalchemy.orm import validates, Query, CompositeProperty
from sqlalchemy.orm.attributes import InstrumentedAttribute
from sqlalchemy.orm.relationships import RelationshipProperty
from sqlalchemy.ext.hybrid import HYBRID_PROPERTY
from sqlalchemy.ext.associationproxy import ASSOCIATION_PROXY
Expand Down Expand Up @@ -33,7 +34,7 @@ def get_column(cls, column):
@classmethod
def import_value(cls, column, v):
c = cls.get_column(column)
if isinstance(c, Column):
if isinstance(c, Column) or isinstance(c, InstrumentedAttribute):
if c.type.python_type is bool and not isinstance(v, bool):
return str(v).lower() == 'true'
return v
Expand Down