Sanjay schrieb:
>>> I am using dynamic_loader, .i.e. user.orgs is a query object and not a
>>> list:
>>> orgs = dynamic_loader('Org', secondary=foo_table)
>>> Curious to get some suggestions in this case.
>> That works as well, you can append to that object as if it was a list
>> (since it's not a normal Query object but an "AppenderQuery" object).
>
> However, I had to make the session dirty for this too.
Should not be necessary - it works for me without any dirty hacks.
In a quickstarted project I changed Permission.groups to
groups = dynamic_loader(Group, secondary=group_permission_table)
and then the following just worked:
@expose()
def insert_a_record(self):
p = DBSession.query(Permission).get(1)
g = DBSession.query(Group).get(1)
p.groups.append(g)
return "Successful!"
Tested with SA 0.5.4 and zope.sa 0.4.
-- Christoph
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---