feedback/management/commands/ch_ip.py
changeset 53 8cc852e205aa
equal deleted inserted replaced
52:adab2d07981a 53:8cc852e205aa
       
     1 from django.core.management.base import NoArgsCommand
       
     2 
       
     3 from offline.quiz.models import Quiz
       
     4 
       
     5 def seed_db():
       
     6    """ set ip of all the previous quizzes to null.
       
     7    """
       
     8 
       
     9    for q in Quiz.objects.all():
       
    10        q.user_ip = ""
       
    11        q.save()
       
    12 
       
    13 
       
    14 class Command(NoArgsCommand):
       
    15     
       
    16     def handle_noargs(self, **options):
       
    17         """ Just copied the code from seed_db.py """
       
    18         
       
    19         seed_db()