[Answered ]-In Django, how can i pass data from a DetailsView class from a form in a UpdateView?

1👍

Replace your updateView with this then add the get_success_url function.

class Actualizer(LoginRequiredMixin, Update View):
    model = Tarea
    form_class = TareaForm
    template_name = 'templates_app/app_1/crea_actualiza_tarea.html'

    def get_object(self, **kwargs):
        id__ = self.kwargs.get('pk') 
        return get_object_or_404(self.model, id=id__) 

    def form_valid(self, form):
        return super().form_valid(form) 
👤Victor

Leave a comment