I have the following validator:

    @sa_orm.validates('variant_names', include_removes=True)
    def validate_unique_identifying(self, key, name_dict,
                                    is_remove):
        if is_remove:
            raise ValueError("DOn't")
        else:
            if name_dict.is_primary_identifying_flag is None:
                name_dict.is_primary_identifying_flag = False
            return name_dict


When deleting, I get the raised ValueError, but the deletion occured anyway.
Is this the expected behaviour? Or there is some other settings that can 
prevent the deletion?

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/a51745a0-3a49-4613-bd17-35920bfd5fe9n%40googlegroups.com.

Reply via email to