On Mar 29, 6:15 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
> you want the delete to fail if there *are* users associated or if there are 
> *not* ?    for the "raise an error if users exist", the most efficient and 
> generic way is to ensure the foreign key on UserGroup is not nullable and 
> "delete" cascade isn't used.    if you wanted to dig an assertion into the 
> mapper you could use a before_delete() extension.  

As you guessed, the case I was anticipating was "raise an error if
users exist".  I'll look into setting a non-nullable column. Thanks a
bunch for the help.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@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