Commit 0432f8ca authored by Briana N Abraham's avatar Briana N Abraham
Browse files

Created command... still trying to figuere out how to add to admin page

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