335
335
def setDeleted(self, removed_by, removal_comment=None):
336
336
"""Set to DELETED status."""
337
self.status = PackagePublishingStatus.DELETED
338
self.datesuperseded = UTC_NOW
339
self.removed_by = removed_by
340
self.removal_comment = removal_comment
337
getUtility(IPublishingSet).setMultipleDeleted(
338
self.__class__, [self.id], removed_by, removal_comment)
342
340
def requestObsolescence(self):
343
341
"""See `IArchivePublisher`."""
1966
1964
if len(ids) == 0:
1969
table = publication_class.__name__
1970
permitted_tables = [
1971
'BinaryPackagePublishingHistory',
1972
'SourcePackagePublishingHistory',
1967
permitted_classes = [
1968
BinaryPackagePublishingHistory,
1969
SourcePackagePublishingHistory,
1974
assert table in permitted_tables, "Deleting wrong type."
1977
deleted=PackagePublishingStatus.DELETED, now=UTC_NOW,
1978
removal_comment=removal_comment, removed_by=removed_by)
1980
IMasterStore(publication_class).execute("\n".join([
1981
"UPDATE %s" % table,
1984
status = %(deleted)s,
1985
datesuperseded = %(now)s,
1986
removed_by = %(removed_by)s,
1987
removal_comment = %(removal_comment)s
1989
"WHERE id IN %s" % sqlvalues(ids),
1971
assert publication_class in permitted_classes, "Deleting wrong type."
1973
affected_pubs = IMasterStore(publication_class).find(
1974
publication_class, publication_class.id.is_in(ids))
1976
status=PackagePublishingStatus.DELETED,
1977
datesuperseded=UTC_NOW,
1978
removed_byID=removed_by.id,
1979
removal_comment=removal_comment)
1992
1981
def requestDeletion(self, sources, removed_by, removal_comment=None):
1993
1982
"""See `IPublishingSet`."""