passerelle-montpellier-enco.../passerelle_montpellier_enco.../views.py

49 lines
1.8 KiB
Python

# passerelle-montpellier-encombrants
# Copyright (C) 2015 Entr'ouvert
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.core.urlresolvers import reverse
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from passerelle import utils
from .models import EncombrantsManagement
from .forms import EncombrantsManagementForm, EncombrantsManagementUpdateForm
class EncombrantsManagementDetailView(DetailView):
model = EncombrantsManagement
template_name = 'passerelle_montpellier_encombrants/detail.html'
class EncombrantsManagementCreateView(CreateView):
model = EncombrantsManagement
form_class = EncombrantsManagementForm
template_name = 'passerelle/manage/service_form.html'
class EncombrantsManagementUpdateView(UpdateView):
model = EncombrantsManagement
form_class = EncombrantsManagementUpdateForm
template_name = 'passerelle/manage/service_form.html'
class EncombrantsManagementDeleteView(DeleteView):
model = EncombrantsManagement
template_name = 'passerelle/manage/service_confirm_delete.html'
def get_success_url(self):
return reverse('manage-home')