def _deserialize(self, value, attr, data, **kwargs): exists = False if "notice" in inspector.get_table_names(): exists = (db_session.query(Notice).filter( Notice.id == value).one_or_none() is not None) if exists: raise self.make_error("notice_id_exists", input=value) return super()._deserialize(value, attr, data, **kwargs)
def _deserialize(self, value, attr, data, **kwargs): exists = False if "release" in inspector.get_table_names(): exists = (db_session.query(Release).filter( Release.codename == value).one_or_none() is not None) if exists: raise self.make_error("release_codename_exists", input=value) return super()._deserialize(value, attr, data, **kwargs)
def _deserialize(self, value, attr, data, **kwargs): exists = False if "package" in inspector.get_table_names(): exists = (db_session.query( Package.name).filter_by(name=value).one_or_none() is not None) if not exists: raise self.make_error("unrecognised_package_name", input=value) return super()._deserialize(value, attr, data, **kwargs)