Tuesday, August 30, 2016

Re: simple form, beginner

sorry a error es undefined and other is error loading page  (jquery)

El dimarts, 30 agost de 2016 17:44:00 UTC+2, Jordi Fernandez va escriure:

<form action="." method="post" enctype="multipart/form-data"> {% csrf_token %}



<form action="" method="post" enctype="multipart/form-data"> {% csrf_token %}


the two instrucctions not working, my view not received nothing  post i want a form with the same view.

remember I am Beginner!

thank you


def crearasistenciaclasse(request):
    user = 6
    form = CrearasistenciaclasseForm(my_arg=user)
    if request.method == 'POST' :
       return HttpResponse('ok')
       form = CrearasistenciaclasseForm(request.POST)
       if form.is_valid():
           crearasistenciaclasse = Crearasistenciaclasse (alumno=form_cleaned_data[alumnos],
                                                          classe=form_cleaned_data[classesobertes])
           crearasistenciaclasse.save()
           return redirect('dojo.views.reportaralumnos')
    else:
           #assert False, locals()
           user = 6
           form = CrearasistenciaclasseForm(my_arg=user)
           
          
    return render_to_response('asistencias/crearasistenciaclasse.html', {'form': form},
                                 context_instance=RequestContext(request))





--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fc3437d7-8254-46b1-8c6a-6760041ec030%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment