Commit e4326d2f authored by Daniel W Bond's avatar Daniel W Bond

added method to return 'freshman', 'sophomore', etc

parent 4ea9ec8b
......@@ -143,6 +143,21 @@ class Student(TimeStampedModel):
objects = StudentManager()
# this doesn't take into account superseniors or graduate students or negative values
# hence private method
def _get_class(self):
time_to_graduate = self.graduating_year - self.current_year
if time_to_graduate >= 4:
return "freshman"
elif time_to_graduate == 3:
return "sophomore"
elif time_to_graduate == 2:
return "junior"
elif time_to_graduate == 1:
return "freshman"
else:
return "magic"
def get_floor(self):
try:
floor = self.room.floor
......
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