Commit 3e89df59 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

renamed templates to align with class-based view names

parent 14456629
{% extends 'layouts/base.html' %}
{% block title %} GMU RoomList • {% 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">Lorem Ipsum</p>
</div>
</div>
</div>
{% endblock %}
from django.conf.urls import patterns, include, url
from housing import views
from django.contrib import admin
admin.autodiscover()
from housing.views import ListBuildings, DetailBuilding, ListRooms, DetailRoom, DetailStudent
from housing.models import Building, Room, Student
urlpatterns = patterns('',
url(r'^buildings/$', views.buildings, name='buildings'),
url(r'^building/(?P<buildingName>[a-zA-Z]+)$', views.building, name='building'),
url(r'^student/(?P<slug>[\w-]+)/$',
DetailStudent.as_view(
model=Student,
context_object_name='student',
template_name='detailStudent.html'),
name='detailStudent'),
url(r'^buildings/$',
ListBuildings.as_view(
model=Building,
#paginate_by='10',
queryset=Building.objects.all(),
context_object_name='buildings',
template_name='listBuildings.html'),
name='listBuildings'),
url(r'^buildings/(?P<slug>[\w-]+)/$',
DetailBuilding.as_view(
model=Building,
context_object_name='building',
template_name='detailBuilding.html'),
name='detailBuilding'),
)
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.template import RequestContext, loader
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import authenticate, logout
from braces.views import LoginRequiredMixin
from django.views.generic import DetailView, ListView, CreateView, UpdateView, DeleteView
from housing.models import Building, Room, Student
from braces.views import LoginRequiredMixin
# a list of neighborhoods and their buildings
class ListBuildings(LoginRequiredMixin, ListView):
model = Building
......
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