1
Well, I have a very pertinent question. I am with an editing class of Django, and when I edit the user, I need it to call from the detail class of the same (Detailview), the two classes are working, but when I call the url that sends to Detailview, it gives error, which is obvious, since Detail view needs user id via GET. However, how to pass this user id via get to the Updateview class, since it uses success_url? follows the code of the classes said:
Updateview:
class UpdateUserView(LoginRequiredMixin, IsMaintainer ,UpdateView):
model = User
context_object_name = 'u'
template_name = 'update-user.html'
fields = ['name', 'email', 'nivel']
success_url = reverse_lazy('accounts:detail')
Detailview:
class DetailUserView(LoginRequiredMixin, IsMaintainer ,DetailView):
model = User
context_object_name = 'u'
template_name = 'profile.html'