Is 'dojo.views.reportaralumnos' an appropriate argument for redirect()? See
https://docs.djangoproject.com/en/1.10/topics/http/shortcuts/#redirect -
it's looking for the name of a URL or the actual callable view object (such
as you might feed to reverse() -
https://docs.djangoproject.com/en/1.10/ref/urlresolvers/#django.urls.reverse),
not the import path of a view.

On Sun, Aug 21, 2016 at 6:16 AM, Jordi Fernandez <fernandez.jo...@gmail.com>
wrote:

> hi,
>
> I have my firts application django it's fine. . But! I have a problem with
> a simple form. I  think this  is a problem the my experience of all entorn
> ( html, form action, ..)
>
> the problem is when a submit my form is a eror -> ERROR LOADING PAGE
>
> if I test my script I not received a method post. why?
>
>
>
> thank you
>
>
> *This is my template form*
>
> <form action="/crearassistenciaclasse/" method="post" >{% csrf_token %}
> {{ form.name.errors }}
> <!--
> <form action="/login/"   method="POST" >
> {% csrf_token %}
> -->
>
> {{form.as_p}}
>
> <!--
> <button type="submit" class="save btn btn-default">Save</button>
> -->
> <input type="submit" value="Crear Assistencia">
>
> </form>
>
>
> *this is my wiew*
>
> def crearasistenciaclasse(request):
>     #return HttpResponse('ok')
>
>     if request.method == "POST":
> form = CrearasistenciaclasseForm(request.POST)
> if form.is_valid():
>            Asistencia = form.save()
>            return redirect('dojo.views.reportaralumnos')
>     else:
>         user = 6
>         form = CrearasistenciaclasseForm(my_arg=user)
>
>     return render_to_response('asistencias/crearasistenciaclasse.html',
> {'form': form})
>
>
>
>
>
>
>
>
>
> this is my form
>
> class CrearasistenciaclasseForm(forms.Form):
>     alumnos = forms.ModelChoiceField(queryset=Alumno.objects.all())
>     classesobertes = forms.ModelChoiceField(queryset=Classe.objects.
> filter(estado='A'))
>     def __init__(self, *args, **kwargs):
> my_arg = kwargs.pop('my_arg')
> super(CrearasistenciaclasseForm, self).__init__(*args, **kwargs)
>
> self.fields['classesobertes'].label = "Classe"
>
> self.fields['alumnos'].initial = my_arg
>
> --
> 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+unsubscr...@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/71bb6ab8-e14a-47aa-91ad-57d4ac29e6f0%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/71bb6ab8-e14a-47aa-91ad-57d4ac29e6f0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Andromeda Yelton
Vice President/President-Elect, Library & Information Technology
Association: http://www.lita.org
http://andromedayelton.com
@ThatAndromeda <http://twitter.com/ThatAndromeda>

-- 
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+unsubscr...@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/CAFE1XCZWYdU8Z1E34AdnzKq%2B%2Bd96kKdRn4GM%3DxMDYzq56UATbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to