Commit 11739410 authored by Jason D Yeomans's avatar Jason D Yeomans
Browse files

Fixed detailBuilding to show rooms

parent b9411e34
...@@ -13,6 +13,13 @@ class ListBuildings(LoginRequiredMixin, ListView): ...@@ -13,6 +13,13 @@ class ListBuildings(LoginRequiredMixin, ListView):
# building floors, other information # building floors, other information
class DetailBuilding(LoginRequiredMixin, DetailView): class DetailBuilding(LoginRequiredMixin, DetailView):
model = Building model = Building
context_object_name = 'building_detail'
template_name='detailBuilding.html'
def get_context_data(self, **kwargs):
context = super(DetailBuilding, self).get_context_data(**kwargs)
context['room_list'] = Room.objects.filter(building__name=''+self.get_object().name).order_by('number')
return context
login_url = '/' login_url = '/'
# this lists the rooms on the floor # this lists the rooms on the floor
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment