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
5e7fac32
Commit
5e7fac32
authored
Feb 18, 2015
by
Daniel W Bond
Browse files
retrieve foreignkey fields
parent
d4e4ec59
Changes
1
Hide whitespace changes
Inline
Side-by-side
roomlist/accounts/models.py
View file @
5e7fac32
...
@@ -36,11 +36,6 @@ class StudentManager(models.Manager):
...
@@ -36,11 +36,6 @@ class StudentManager(models.Manager):
def
students
(
self
):
def
students
(
self
):
return
self
.
get_query_set
().
students
()
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
# when a student is not on a floor, but in a building
def
building_students
(
self
):
def
building_students
(
self
):
building
=
self
.
get_query_set
().
building
()
building
=
self
.
get_query_set
().
building
()
...
@@ -83,6 +78,14 @@ class Student(TimeStampedModel):
...
@@ -83,6 +78,14 @@ class Student(TimeStampedModel):
objects
=
StudentManager
()
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
):
def
profile_image_url
(
self
):
fb_uid
=
SocialAccount
.
objects
.
filter
(
user
=
self
.
user
.
id
,
provider
=
'facebook'
)
fb_uid
=
SocialAccount
.
objects
.
filter
(
user
=
self
.
user
.
id
,
provider
=
'facebook'
)
print
(
"profile_image"
)
print
(
"profile_image"
)
...
...
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