import sys
from datetime import datetime

from django.core.management.base import NoArgsCommand

from django.contrib.auth.models import User

from workshop.reg.events import create_user, create_event

def seed_db():
    """ a method to seed the database with random data """
    
    for i in range(20):
        user = create_user('user'+str(i)+'@example.com','123456', 'User', str(i))

    for i in range(5):
        create_event("workshop"+str(i), "This is workshop"+str(i), datetime(2010, 4, i+4), datetime(2010, 4, i+6), user)
    
class Command(NoArgsCommand):
    
    def handle_noargs(self, **options):
        """ Just copied the code from seed_db.py """
        
        seed_db()
