allow commune edit (#8626)
This commit is contained in:
parent
944094c4b8
commit
aba220d7b6
|
@ -9,6 +9,7 @@
|
|||
{% block appbar %}
|
||||
<h2>{{ commune }}</h2>
|
||||
<a rel="popup" href="{% url 'montpellier-encombrants-commune-streets-edit-view' pk=commune.pk %}">{% trans 'Edit streets' %}</a>
|
||||
<a rel="popup" href="{% url 'montpellier-encombrants-commune-edit' pk=commune.pk %}">{% trans 'Edit' %}</a>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
|
|
@ -46,6 +46,8 @@ management_urlpatterns = patterns('',
|
|||
name='montpellier-encombrants-commune-listing'),
|
||||
url(r'^communes/add$', CommuneCreateView.as_view(),
|
||||
name='montpellier-encombrants-commune-add'),
|
||||
url(r'^communes/(?P<pk>[\w,-]+)/edit$', CommuneUpdateView.as_view(),
|
||||
name='montpellier-encombrants-commune-edit'),
|
||||
url(r'^communes/(?P<pk>[\w,-]+)$', CommuneView.as_view(),
|
||||
name='montpellier-encombrants-commune-view'),
|
||||
url(r'^communes/(?P<pk>[\w,-]+)/streets$', StreetEditView.as_view(),
|
||||
|
|
|
@ -113,6 +113,12 @@ class CommuneView(DetailView):
|
|||
return context
|
||||
|
||||
|
||||
class CommuneUpdateView(UpdateView):
|
||||
model = Commune
|
||||
template_name = 'passerelle/manage/service_form.html'
|
||||
success_url = reverse_lazy('montpellier-encombrants-commune-listing')
|
||||
|
||||
|
||||
class CommuneDeleteView(DeleteView):
|
||||
model = Commune
|
||||
template_name = 'passerelle/manage/service_confirm_delete.html'
|
||||
|
|
Loading…
Reference in New Issue