Comment 4 for bug 29663

Revision history for this message
Julian Edwards (julian-edwards) wrote :

The way this sort of problem is fixed now is to use storm_validator on the model's property declaration.

e.g. from IArchive:

{{{
    name = StringCol(
        dbName='name', notNull=True, storm_validator=_validate_archive_name)
}}}

_validate_archive_name() is a method that does this:

{{{
    def _validate_archive_name(self, attr, value):
        if not self._SO_creating:
            assert self.is_copy, "Only COPY archives can be renamed."
        assert valid_name(value), "Invalid name given to unproxied object."
        return value
}}}