Skip to content

Commit

Permalink
Modified views and urls
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniDiazTech committed May 25, 2021
1 parent 881b514 commit 918ee14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/photoapp/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
PhotoDeleteView
)

appname = 'photo'
app_name = 'photo'

urlpatterns = [
path('', PhotoListView.as_view(), name='list'),
Expand Down
6 changes: 6 additions & 0 deletions config/photoapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ class PhotoDetailView(DetailView):


class PhotoCreateView(LoginRequiredMixin, CreateView):

template_name = 'photoapp/create.html'

model = Photo

Expand Down Expand Up @@ -86,6 +88,8 @@ def test_func(self):
raise HttpResponseNotAllowed('Sorry you are not allowed here')

class PhotoUpdateView(UserIsSubmitter, UpdateView):

template_name = 'photoapp/update.html'

model = Photo

Expand All @@ -95,6 +99,8 @@ class PhotoUpdateView(UserIsSubmitter, UpdateView):

class PhotoDeleteView(UserIsSubmitter, DeleteView):

template_name = 'photoapp/delete.html'

model = Photo

success_url = reverse_lazy('photo:list')

0 comments on commit 918ee14

Please sign in to comment.