views.py 878 Bytes
Newer Older
1 2 3
from django.views.generic import DetailView, ListView, CreateView, UpdateView, DeleteView

from housing.models import Building, Room, Student
4

5 6
from braces.views import LoginRequiredMixin

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
# a list of neighborhoods and their buildings
class ListBuildings(LoginRequiredMixin, ListView):
    model = Building
    login_url = '/'

# building floors, other information
class DetailBuilding(LoginRequiredMixin, DetailView):
    model = Building
    login_url = '/'

# this lists the rooms on the floor
class ListRooms(LoginRequiredMixin, ListView):
    model = Room
    login_url = '/'

# this lists students in a room
class DetailRoom(LoginRequiredMixin, ListView):
    model = Room
    login_url = '/'

# details about the student
Jason D Yeomans's avatar
Jason D Yeomans committed
28
class DetailStudent(LoginRequiredMixin, DetailView):
29 30
    model = Student
    login_url = '/'
31

32 33 34 35 36
# update a student

# update a room

# update a building