'Returns a list of triples suitable to be attached to an email.'

def get_attachments(self):

    try:
        num = int(self.attachment_formset.data['attachment-TOTAL_FORMS'])
    except (ValueError, TypeError):
        return []
    else:
        files = []
        for i in xrange(num):
            attachment_name = ('attachment-%d-attachment' % i)
            attachment = self.request.FILES.get(attachment_name)
            if attachment:
                attachment.open()
                files.append((attachment.name, attachment.read(), attachment.content_type))
        return files
