#! /usr/bin/env python3
# -*- coding: utf-8 -*-

# tar command:
# tar czvf mugshots.tar.gz -T mugshot_files.txt
# where the txt is generated by this script

import django
django.setup()

from django.conf import settings
from djforms.scholars.models import Presentation
from djtools.fields import TODAY


YEAR = int(TODAY.year)
presentations = Presentation.objects.filter(date_updated__year=YEAR)

# list for failed uploads
#bunk = [ ]
#if s.mugshot in bunk:
#    print s.first_name, s.last_name

for prez in presentations:
    for presenter in prez.presenters.all():
        if presenter.mugshot:
            print(presenter.mugshot)

