Conor,

Thanks for your help!

On Tue, Oct 20, 2009 at 16:27, Conor <conor.edward.da...@gmail.com> wrote:

>
> You can tell SQLAlchemy that the database will cascade deletes on its
> own (add passive_deletes=True to the relation arguments, see
> http://www.sqlalchemy.org/docs/05/mappers.html#using-passive-deletes for
> more info). However, I was under the impression that even with
> passive_deletes disabled, SQLAlchemy would know to delete child objects
> before parent objects, so it should have worked anyway.
>
>


It turns out passive_deletes=True did help. Though a bit weird. I get the
same ConcurrentModificationError when I added i to Community mapper, like
this:

    mapper(Community, communities_tbl, properties={
        'members':relation(CommunityMember, backref='community',
            passive_deletes=True,
            cascade="all, delete, delete-orphan"),
        'feeds':relation(CommunityFeed, backref='community',
            passive_deletes=True,
            cascade="all, delete, delete-orphan"),
    })

Yet, when just out of desperation I added it to CommunityFeed mapper it
started working. The mapper did have cascade spec though:

    mapper(CommunityFeed, community_feeds_tbl, properties={
        'user':relation(User, backref='feeds'),
        'entries':relation(PlanetEntry, backref='feed',
            passive_deletes=True,
            cascade="all, delete, delete-orphan"),
        })


-- 
Max.Ischenko // developers.ua // vse-sto.com.ua
Follow me on Twitter, twitter.com/maxua

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to