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

retrieve foreignkey fields

parent d4e4ec59
......@@ -36,11 +36,6 @@ class StudentManager(models.Manager):
def students(self):
return self.get_query_set().students()
def floor_building(self):
floor = self.get_query_set().floor()
building = self.get_query_set().building()
return floor + list(set(building) - set(floor))
# when a student is not on a floor, but in a building
def building_students(self):
building = self.get_query_set().building()
......@@ -83,6 +78,14 @@ class Student(TimeStampedModel):
objects = StudentManager()
def get_floor(self):
floor = self.room.floor
return floor
def get_building(self):
building = self.room.floor.building
return building
def profile_image_url(self):
fb_uid = SocialAccount.objects.filter(user=self.user.id, provider='facebook')
print("profile_image")
......
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