Created
January 28, 2018 14:20
-
-
Save Ronaldomata34/fc68104c436734c9b6ee1328c8c692b6 to your computer and use it in GitHub Desktop.
app.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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