Commit 5eafbe0a authored by Daniel W Bond's avatar Daniel W Bond
Browse files

Clas object is now graduating_year integer

parent a0879342
# standard library imports
import hashlib
from datetime import date
# core django imports
from django.db import models
from model_utils.models import TimeStampedModel
......@@ -11,7 +12,7 @@ from autoslug import AutoSlugField
from multiselectfield import MultiSelectField
from allauth.socialaccount.models import SocialAccount
# imports from your apps
from housing.models import Room, Class
from housing.models import Room
class Major(TimeStampedModel):
......@@ -122,9 +123,11 @@ class Student(TimeStampedModel):
privacy = models.CharField(max_length=100, choices=PRIVACY_CHOICES, default=FLOOR)
room = models.ForeignKey(Room, null=True, blank=True)
clas = models.ForeignKey(Class, null=True, blank=True)
major = models.ForeignKey('Major', null=True, blank=True)
current_year =
graduating_year = models.IntegerField(default=current_year, blank=True)
# from when first logged in through peoplefinder, stored for later
original_major = models.CharField(max_length=50, blank=True)
# core django imports
from django.contrib import admin
# imports from your apps
from .models import Class, Building, Floor, Room
from .models import Building, Floor, Room
......@@ -116,28 +116,3 @@ class Room(TimeStampedModel):
# def __str__(self): # __unicode__ on Python 2
# return self.street
class Class(TimeStampedModel):
grad_year = models.PositiveIntegerField(null=True, blank=True)
(FRESHMAN, 'Freshman'),
(SOPHOMORE, 'Sophomore'),
(JUNIOR, 'Junior'),
(SENIOR, 'Senior'),
(OTHER, 'Other'),
year_in_school = models.CharField(max_length=2,
class Meta:
verbose_name_plural = 'classes'
def __str__(self): # __unicode__ on Python 2
return str(self.grad_year)
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