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
edc2e08b
Commit
edc2e08b
authored
Mar 26, 2015
by
Daniel W Bond
Browse files
floor now optional field for student
parent
e35b7f8c
Changes
1
Show whitespace changes
Inline
Side-by-side
roomlist/accounts/models.py
View file @
edc2e08b
...
...
@@ -88,7 +88,7 @@ class Student(TimeStampedModel):
privacy
=
models
.
CharField
(
max_length
=
100
,
choices
=
PRIVACY_CHOICES
,
default
=
FLOOR
)
room
=
models
.
ForeignKey
(
Room
)
room
=
models
.
ForeignKey
(
Room
,
null
=
True
,
blank
=
True
)
clas
=
models
.
ForeignKey
(
Class
)
major
=
models
.
ForeignKey
(
'Major'
)
...
...
@@ -99,12 +99,18 @@ class Student(TimeStampedModel):
objects
=
StudentManager
()
def
get_floor
(
self
):
try
:
floor
=
self
.
room
.
floor
return
floor
except
AttributeError
:
return
None
def
get_building
(
self
):
try
:
building
=
self
.
room
.
floor
.
building
return
building
except
AttributeError
:
return
None
def
profile_image_url
(
self
):
fb_uid
=
SocialAccount
.
objects
.
filter
(
user
=
self
.
user
.
id
,
provider
=
'facebook'
)
...
...
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