+ import os.path
+ from django.conf import settings
+ if attachments is None:
+ attachments = {}
+ for attachment in self.attachment_set.all():
+ full_name = os.path.join(settings.MEDIA_ROOT, '%s.%s' % (attachment.file.name, attachment.ext))
+ f = IOFile.from_filename(full_name)
+ attachments[attachment.slug] = f
+ infile = IOFile.from_filename(self.xml_file.path, attachments=attachments)