Commit 269eb1bd authored by David Haynes's avatar David Haynes 🙆
Browse files

No longer need floor attribute

parent f39e6e52
...@@ -15,7 +15,7 @@ from randomslugfield import RandomSlugField ...@@ -15,7 +15,7 @@ from randomslugfield import RandomSlugField
from multiselectfield import MultiSelectField from multiselectfield import MultiSelectField
from allauth.socialaccount.models import SocialAccount from allauth.socialaccount.models import SocialAccount
# imports from your apps # imports from your apps
from housing.models import Room, Floor from housing.models import Room
class Major(TimeStampedModel): class Major(TimeStampedModel):
...@@ -132,7 +132,6 @@ class Student(TimeStampedModel): ...@@ -132,7 +132,6 @@ class Student(TimeStampedModel):
room = models.ForeignKey(Room, null=True, blank=True) room = models.ForeignKey(Room, null=True, blank=True)
major = models.ForeignKey('Major', null=True, blank=True) major = models.ForeignKey('Major', null=True, blank=True)
floor = models.ForeignKey(Floor, null=True, blank=True)
times_changed_room = models.PositiveIntegerField(default=0) times_changed_room = models.PositiveIntegerField(default=0)
......
...@@ -25,7 +25,7 @@ class LandingPage(LoginRequiredMixin, TemplateView): ...@@ -25,7 +25,7 @@ class LandingPage(LoginRequiredMixin, TemplateView):
# Create Dictionaries to store Students that meet criteria # Create Dictionaries to store Students that meet criteria
context["roomies"] = Student.objects.filter(room=me.room).exclude(user__username=me) context["roomies"] = Student.objects.filter(room=me.room).exclude(user__username=me)
context["floories"] = Student.objects.filter(floor=me.get_floor()).exclude(user__username=me).exclude(room=me.room).order_by('room') context["floories"] = Student.objects.filter(room__floor=me.get_floor()).exclude(user__username=me).exclude(room=me.room).order_by('room')
context["majormates"] = Student.objects.filter(major=me.major).exclude(user__username=me).order_by('?')[:8] context["majormates"] = Student.objects.filter(major=me.major).exclude(user__username=me).order_by('?')[:8]
# Hack to Correctly Display Building plus Floor # Hack to Correctly Display Building plus 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