i'm not sure how much this would help u, but 0.4 has better support for
your-own-collection-containers. see
http://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_relation_collections
e.g. subclass some list and u can do the callback at append() or whatever.
Dave Harrison wrote:
> Hi all,
>
> I have a situation where I want to declare a relation between two
> tables, but I want to be able to run a callback whenever I append to
> that relation. Here's an example
>
> class Kennel:
> def callback(self, o):
> print "callback", o
>
> mapper = Mapper(
> Kennel,
> kennelTable,
> properties = {
> "dogs" : relation(
> Dog, cascade="all, delete-orphan"
> ),
> }
> )
>
> So whenever I use mykennel.dogs.append(fred) I want to be able to tell
> the relation to call callback() so that I can do some checking on the
> object that is being appended.
>
> Is this possible ??
>
> Cheers
> Dave
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---