Hi,
I have a Subscriber and an Address table. Subscriber can have many
Addresses
mapper(Subscriber, subscriber_table, properties={
'addresses' : relation(Address, collection_class=Addresses,
backref='customer')})
>From the a Subscriber object, I want to inspect all loaded objects in
any collections, but do it quietly - without causing any more to load.
class MyBase(object):
@reconstructor
def __my_init__(self):
self.rules = []
def get_all_rules_on_all_loaded_related_objects(self):
for collection in (p for p in object_mapper
(self).iterate_properties if type(p) is RelationProperty):
# How to access this collection without causing it to
load?
# I want to look at the 'rules' property on all loaded
objects
Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---