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
269eb1bd
Commit
269eb1bd
authored
Nov 11, 2015
by
David Haynes
🙆
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No longer need floor attribute
parent
f39e6e52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
roomlist/accounts/models.py
roomlist/accounts/models.py
+1
-2
roomlist/settings/views.py
roomlist/settings/views.py
+1
-1
No files found.
roomlist/accounts/models.py
View file @
269eb1bd
...
...
@@ -15,7 +15,7 @@ from randomslugfield import RandomSlugField
from
multiselectfield
import
MultiSelectField
from
allauth.socialaccount.models
import
SocialAccount
# imports from your apps
from
housing.models
import
Room
,
Floor
from
housing.models
import
Room
class
Major
(
TimeStampedModel
):
...
...
@@ -132,7 +132,6 @@ class Student(TimeStampedModel):
room
=
models
.
ForeignKey
(
Room
,
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
)
...
...
roomlist/settings/views.py
View file @
269eb1bd
...
...
@@ -25,7 +25,7 @@ class LandingPage(LoginRequiredMixin, TemplateView):
# Create Dictionaries to store Students that meet criteria
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
]
# Hack to Correctly Display Building plus Floor
...
...
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