# Path: signup/models.py
# def create_or_update_signup( email, questions ):
#     # check if user is already added to the current sequence
#     sequence = sequence_model.get_current_sequence_number()
#     if db.UserSignup.objects.filter(email__iexact=email, sequence=sequence).exists():
#         return update_signup(email, questions)
#     else:
#         return create_signup(email, questions)
# 
# Path: signup/models.py
# def add_user_to_global_list( email, sequence ):
#     """ add user to email list that gets all emails """
#     signup_db = db.UserSignup.objects.get(
#         email__iexact=email, date_deleted__isnull=True, sequence=sequence
#     )
#     if signup_db.sequence:
#         list_name = sequence_model.sequence_list_name(signup_db.sequence)
#         mailgun_api.add_list_member(list_name, email)
# 
# Path: sequence/models.py
# def sequence_list_name( sequence_number ):
# def sequence_campaign( sequence_number ):
# def sequence2dict( sequence_db ):
# def create_sequence( start_date, signup_close_date ):
# def get_all_sequences( ):
# def get_current_sequence( ):
# def get_current_sequence_number( ):
# 
# Path: signup/db.py
# class UserSignup(models.Model):


from django.core.management.base import BaseCommand, CommandError
from signup.models import create_or_update_signup
from signup.models import add_user_to_global_list
from sequence import models as sequence_model
from signup import db
import datetime
        import requests



class Command(BaseCommand):
    args = '<data url>'
    help = 'Imports the specified signup data'

    def handle(self, *args, **options):

# Path: signup/models.py
# def create_or_update_signup( email, questions ):
#     # check if user is already added to the current sequence
#     sequence = sequence_model.get_current_sequence_number()
#     if db.UserSignup.objects.filter(email__iexact=email, sequence=sequence).exists():
#         return update_signup(email, questions)
#     else:
#         return create_signup(email, questions)
# 
# Path: signup/models.py
# def add_user_to_global_list( email, sequence ):
#     """ add user to email list that gets all emails """
#     signup_db = db.UserSignup.objects.get(
#         email__iexact=email, date_deleted__isnull=True, sequence=sequence
#     )
#     if signup_db.sequence:
#         list_name = sequence_model.sequence_list_name(signup_db.sequence)
#         mailgun_api.add_list_member(list_name, email)
# 
# Path: sequence/models.py
# def sequence_list_name( sequence_number ):
# def sequence_campaign( sequence_number ):
# def sequence2dict( sequence_db ):
# def create_sequence( start_date, signup_close_date ):
# def get_all_sequences( ):
# def get_current_sequence( ):
# def get_current_sequence_number( ):
# 
# Path: signup/db.py
# class UserSignup(models.Model):


# Path: signup/management/commands/import_signup.py
from django.core.management.base import BaseCommand, CommandError
from signup.models import create_or_update_signup
from signup.models import add_user_to_global_list
from sequence import models as sequence_model
from signup import db
import datetime
        import requests




class Command(BaseCommand):
    args = '<data url>'
    help = 'Imports the specified signup data'

    def handle(self, *args, **options):

        resp = requests.get(args[0])