'Given an attachment revision instance and a request create a
TrashedAttachment instance to record it being deleted.
Then return the new trash item.'

def trash(self, username=None):

    trashed_attachment = TrashedAttachment(file=self.file, trashed_by=(username or 'unknown'), was_current=(self.attachment and self.attachment.current_revision and (self.attachment.current_revision.pk == self.pk)))
    trashed_attachment.save()
    return trashed_attachment
