views.py 1.12 KB
Newer Older
1 2
from django.views.generic import DetailView, ListView, CreateView, UpdateView, DeleteView

3 4
from housing.models import Building, Room
from accounts.models import Student
5

6 7
from braces.views import LoginRequiredMixin

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 = '/'

28
# update a student
29 30 31 32 33 34
#class UpdateStudent(LoginRequiredMixin, UpdateView):
#    model = Student
#    form_class = '/'
#    success_url = '/' # change the success url to something more interesting

#    login_url = '/'
35 36

# update a room
37 38 39 40
#class updateroom(loginrequiredmixin, updateview):
#    model = room
#    form_class =
#    success_url = '/' # change the success url to something more interesting
41

42
#    login_url = '/'