Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
b0e081f1
Commit
b0e081f1
authored
Oct 21, 2015
by
Briana N Abraham
Browse files
clears student rooms at the end of the semester
parent
148604b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
roomlist/accounts/management/commands/clear_rooms.py
0 → 100644
View file @
b0e081f1
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment