Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
roomlist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
roomlist
Commits
5e7fac32
Commit
5e7fac32
authored
Feb 18, 2015
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
retrieve foreignkey fields
parent
d4e4ec59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
roomlist/accounts/models.py
roomlist/accounts/models.py
+8
-5
No files found.
roomlist/accounts/models.py
View file @
5e7fac32
...
...
@@ -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"
)
...
...
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