-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Providing custom deferred types results in an error
TypeError: __call__() takes exactly 3 arguments (1 given)
The column
class MyModel(DbBase):
name = sa.Column(sa.Float(), info={'colanderalchemy': {'typ': deferred_type}})
The deferred type
@colander.deferred
def deferred_type(node, kw):
if kw['use_float'] == True:
return colander.Float()
else:
return colander.Integer()
When generating the schema with SQLAlchemySchemaNode, we get the error.
The error comes from the fact that a colander.deferred has a 'call' method.
https://github.com/stefanofontanelli/ColanderAlchemy/blob/master/colanderalchemy/schema.py#L286
An exception should be added for colander.deferreds.
Metadata
Metadata
Assignees
Labels
No labels