'Creates a M2M relationship between the given document and attachment
using some metadata of the given revision (the latest most likely) and
either as an original or as a non-originally uploaded file.'

def create_attachment(self, document, attachment, revision, is_original):

    if (not self.dry_run):
        (relation, created) = DocumentAttachment.objects.update_or_create(file_id=attachment.pk, document_id=document.pk, defaults={'attached_by': revision.creator, 'name': revision.filename, 'is_original': is_original, 'is_linked': True})
    self.attached.append(attachment.pk)
