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
269eb1bd
Commit
269eb1bd
authored
Nov 11, 2015
by
David Haynes
🙆
Browse files
No longer need floor attribute
parent
f39e6e52
Changes
2
Hide whitespace changes
Inline
Side-by-side
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