My view:
class ModEmailDeleteView(DetailView):
model = EmailModel
template_name = "email_delete.html"
success_url = reverse_lazy('moderator_profile', request.user.id)
Here I want to check if the user of particular filed is request user then only he can delete. Like
if obj.user == request.user
then only he can delete or throw 404
Also what if I have multiple primary key in the url?? and want different validations using those primary keys
You can do it like this: