Pete Erickson wrote:
>
> class Response(Packet):
> __tablename__ = 'responses'
> __mapper_args__ = {'polymorphic_identity': 'response',
> 'inherit_condition':id==Packet.id}
>
> id = Column(Integer, ForeignKey('packets.id'),
> primary_key=True)
> req_id = Column(Integer, ForeignKey('packets.id'))
> response = Column(String)
the fact that it thinks "id" takes arguments is a clue that it is
receiving the Python built-in function "id" rather than a column
construct. Above, the __mapper_args__ include a reference to "id" within
the scope of "class Response", but this is before the "id" member of
"Response" has been declared. the __mapper_args__ needs to be moved below
the local Column objects it needs to reference.
> File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.6-py2.6.egg/
> sqlalchemy/orm/session.py", line 755, in execute
> clause, params or {})
> File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.6-py2.6.egg/
> sqlalchemy/engine/base.py", line 824, in execute
> return Connection.executors[c](self, object, multiparams, params)
> File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.6-py2.6.egg/
> sqlalchemy/engine/base.py", line 872, in _execute_clauseelement
> parameters=params
> File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.6-py2.6.egg/
> sqlalchemy/engine/base.py", line 938, in __create_execution_context
> return dialect.execution_ctx_cls(dialect, connection=self,
> **kwargs)
> File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.6-py2.6.egg/
> sqlalchemy/engine/default.py", line 167, in __init__
> self.compiled_parameters = [compiled.construct_params(m) for m in
> parameters]
> File "/Library/Python/2.6/site-packages/SQLAlchemy-0.5.6-py2.6.egg/
> sqlalchemy/sql/compiler.py", line 243, in construct_params
> pd[self.bind_names[bindparam]] = bindparam.value()
> TypeError: id() takes exactly one argument (0 given)
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To post to this group, send email to [email protected].
> 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.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
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.