utils/logger_tools.py
def _save_attachments (instance_pk, media_files):
    """A function to save the media files associated with this Instance
    using a celery task."""

    try:
        inst = Instance.objects.get(pk=instance_pk)
        for f in media_files:
            attach, created = Attachment.objects.get_or_create(instance=inst,
                                             media_file=f,
                                             mimetype=f.content_type)
    except Instance.DoesNotExist:
        pass
A function to save the media files associated with this Instance
    using a celery task.
A function to save the media files associated with this Instance
using a celery task.
A function to save the media files associated with this Instance using a celery task .
def _save_attachments (instance_pk, media_files):
    try:
        inst = Instance.objects.get(pk=instance_pk)
        for f in media_files:
            attach, created = Attachment.objects.get_or_create(instance=inst,
                                             media_file=f,
                                             mimetype=f.content_type)
    except Instance.DoesNotExist:
        pass
def _save_attachments ( instance_pk , media_files ) : try : inst = Instance . objects . get ( pk = instance_pk ) for f in media_files : attach , created = Attachment . objects . get_or_create ( instance = inst , media_file = f , mimetype = f . content_type ) except Instance . DoesNotExist : pass
A function to save the media files associated with this Instance
using a celery task.
A function to save the media files associated with this Instance using a celery task .
"""A function to save the media files associated with this Instance
    using a celery task."""
instance_pk
media_files