Commit b0e081f1 authored by Briana N Abraham's avatar Briana N Abraham
Browse files

clears student rooms at the end of the semester

parent 148604b9
from django.core.management.base import BaseCommand, CommandError
from accounts.models import Student
class Command(BaseCommand):
args = ""
help = "Deletes all students' rooms at the end of the semester"
def handle(self, *args, **kwargs):
count = 0
for student in Student.objects.all():
student.room = None
count += 1
self.stdout.write("Successfully Overwrote %d student room(s)" % count)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment