Skip to content

Instantly share code, notes, and snippets.

@Ronaldomata34
Created January 28, 2018 14:20
Show Gist options
  • Save Ronaldomata34/fc68104c436734c9b6ee1328c8c692b6 to your computer and use it in GitHub Desktop.
Save Ronaldomata34/fc68104c436734c9b6ee1328c8c692b6 to your computer and use it in GitHub Desktop.
app.py
class DistributorDelete(DeleteView):
model= Distributor
success_url = reverse_lazy('index')
def get_queryset(self):
query = Distributor.objects.get(pk=distributorid)
query.delete()
return HttpResponse("Deleted!") and the url is url(r'^(?P<pk>[a-z0-9]+)/delete/$', sales.views.DeleteView.as_view(), name='distributordelete'), but its give me a error
Exception Type: ImproperlyConfigured
Exception Value:
DeleteView is missing a QuerySet. Define DeleteView.model, DeleteView.queryset, or override DeleteView.get_queryset().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment