Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DeleteAlbumView(views.DeleteView):
- queryset = Album.objects.all()
- template_name = 'albums/album-delete.html'
- success_url = reverse_lazy('index')
- form_class = modelform_factory(Album, fields=('name', 'artist_name', 'genre', 'description', 'image_url', 'price'))
- def get_form_kwargs(self):
- kwargs = super().get_form_kwargs()
- kwargs["instance"] = self.object
- return kwargs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement