user = Table('users', metadata,
Column('id', Integer, primary_key=True),
Column('account_name', String(64)))
address = Table('mail', metadata,
Column('id', Integer, primary_key=True),
Column('user_id', Integer, ForeignKey('users.id')),
Column('email', String(64)))
metadata.create_all()
class User(object):
__sa_instrument_class__ = SetListener
class Address(object):
__sa_instrument_class__ = SetListener
add_map = mapper(Address, address)
user_map = mapper(User, user, properties={
'emails': relation(add_map, lazy=True, uselist=True)
})
Is there any way to find out what is already loaded 'emails' ?
I get events with appending to emails. Is there any way to get
events when sqlalchemy load data into sqlalchemy ?
What I am trying to do is cause some initialization to happen on data that
get loaded into relation without causing the lazy relations to be loaded. I
am using append event to known when a relation is added. I need to do the
initialization after the object is created.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---