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
4d7b7340
Commit
4d7b7340
authored
Feb 09, 2015
by
Daniel W Bond
Browse files
floor views and modified filters
parent
9c7f2759
Changes
2
Hide whitespace changes
Inline
Side-by-side
roomlist/housing/templates/detailFloor.html
0 → 100644
View file @
4d7b7340
{% extends 'layouts/base.html' %}
{% block title %} SRCT RoomList
•
{{ floor.building.name }} {{ floor.number }}{% endblock %}
{% block content %}
<div
class=
"page-header"
id=
"banner"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
<h1><strong>
GMU
</strong>
ROOMLIST
</h1>
<p
class=
"lead"
>
{{ floor.building.name }}{{ floor.number }}
</p>
</div>
</div>
</div>
{% for room in rooms %}
{{ room.number }}
{% endfor %}
{% endblock %}
roomlist/housing/views.py
View file @
4d7b7340
...
...
@@ -25,32 +25,33 @@ class DetailBuilding(LoginRequiredMixin, DetailView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
DetailBuilding
,
self
).
get_context_data
(
**
kwargs
)
context
[
'
room_list
'
]
=
R
oo
m
.
objects
.
filter
(
building__name
=
''
+
self
.
get_object
().
name
)
.
order_by
(
'number'
)
context
[
'
floors
'
]
=
Fl
oo
r
.
objects
.
filter
(
building__name
=
''
+
self
.
get_object
().
name
_
.
order_by
(
'
-
number'
)
return
context
login_url
=
'/'
# this lists the rooms on the floor
class
ListRooms
(
LoginRequiredMixin
,
ListView
):
model
=
Room
class
DetailFloor
(
LoginRequiredMixin
,
DetailView
):
model
=
Floor
context_object_name
=
'floor'
template_name
=
detail_floor
.
html
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
DetailFloor
,
self
):
context
[
'rooms'
]
=
Room
.
objects
.
filter
(
floor
=
self
.
get_object
()).
order_by
(
'-number'
)
return
context
login_url
=
'/'
# this lists students in a room
class
DetailRoom
(
LoginRequiredMixin
,
ListView
):
model
=
Room
login_url
=
'/'
# update a student
#class UpdateStudent(LoginRequiredMixin, UpdateView):
# model = Student
# form_class = '/'
# success_url = '/' # change the success url to something more interesting
# login_url = '/'
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
DetailRoom
,
self
):
# context['students'] =
return
context
# update a room
#class updateroom(loginrequiredmixin, updateview):
# model = room
# form_class =
# success_url = '/' # change the success url to something more interesting
login_url
=
'/'
#
login_url = '/'
#
deleted 'updateroom' view-- that will be handled on the user's page
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