quiz/management/commands/seed_db.py
author nishanth
Thu, 22 Apr 2010 12:17:21 +0530
changeset 50 0842b3439c3e
parent 29 ea1c0110e989
permissions -rw-r--r--
implemented extra filter on string patterns. now string patterns will not be split like other pattersns

import sys
from datetime import datetime

from django.core.management.base import NoArgsCommand

from offline.event.models import Event
from offline.quiz.models import QuestionBank

def seed_db():
    ev = Event()
    ev.title = "Some Workshop"
    ev.start_date = datetime.now()
    ev.stop_date = datetime.now()
    ev.quiz_status = '11'
    ev.save()
    
class Command(NoArgsCommand):
    
    def handle_noargs(self, **options):
        """ Just copied the code from seed_db.py """
        
        seed_db()