On Jun 1, 2012, at 12:30 PM, Antonio Beamud Montero wrote:
> El 01/06/12 16:59, Michael Bayer escribió:
>> @appender needs to be a method that just accepts a mapped object to be added
>> to the collection. then, @internally_instrumented is needed to prevent the
>> collections system from placing additional insturmentation on standard
>> methods like __setitem__. Also building custom dictionary collections is
>> very difficult in any case (for me as well) so you were close, and that's
>> pretty good !
>>
>
> Only one more question.. Querying for example the ULine object, always give
> me the permissions for all objects.. Exists any way to filter that
> permissions by the User object I filter in the query, i.e. something like:
>
> objs =
> session.query(ULine).join(PermissionAssoc).join(Permission).join(User).filter(User.username
> == u'kratos').all()
> print objs[0].permissions
> ----
> MyMappedCollection({u'read': [<__main__.Permission object at 0xa04442c>,
> <__main__.Permission object at 0xa04454c>]})
> ----
haven't looked at your example again but you'd work it out in SQL first to
figure out the query you want, then convert to the ORM. Is the issue that you
don't know what the SQL is, or just how to get the Query to produce it ?
--
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.