views.py 756 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
# 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 = '/'

27 28 29 30 31
# update a student

# update a room

# update a building