On Dec 27, 2007, at 7:26 PM, [EMAIL PROTECTED] wrote:
>
> I am attempting to upgrade from sqlalchemy 0.3.11 to current release
> 0.4.1 and i am getting the following error:
>
> / recs = session.query(PurchaseOrder).filter_by(description =
> 'Shipped').all()
> File "C:\Python24\Lib\site-packages\sqlalchemy\orm\query.py", line
> 322, in filter_by
> clauses = [self._joinpoint.get_property(key,
> resolve_synonyms=True).compare(operator.eq, value)
> File "C:\Python24\Lib\site-packages\sqlalchemy\orm\mapper.py", line
> 192, in get_property
> raise exceptions.InvalidRequestError("Mapper '%s' has no property
> '%s'" % (str(self), key))
> InvalidRequestError: Mapper 'Mapper|PurchaseOrder|purchaseorder' has
> no property 'description'
> /
> I am trying to query a column in a related table with the following
> query:
> recs = session.query(PurchaseOrder).filter_by(description =
> 'Shipped').all()
>
theres a certain "magical" behavior in 0.3 which we've removed in
filter_by(), which is that when you say "description" it searches
downwards through "orderstatus" to find it. 0.4 wants you to be
explicit and say
session
.query
(PurchaseOrder
).join('orderstatus').filter_by(description='Shipped').all().
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---