I'm using python code to verify the fields. I'm doing it on a View. But with javascript maybe I can solve this issue where i don't need to reload the page. But if i do that, can i do things like check the database to see if it already contains some value? Or store something on request.session for later?
On Thursday, November 2, 2017 at 6:43:18 PM UTC-3, James Schneider wrote: > > > > On Thu, Nov 2, 2017 at 12:57 PM, fábio andrews rocha marques < > [email protected] <javascript:>> wrote: > >> To use django forms is to use the django Form class and it's components >> on a view? How will this solve the issue? If i use the components, don't i >> have to re-render the page when a user makes an error on the form? >> >> > Are you submitting and rendering the information entirely via JavaScript? > That would be the only case where you may get errant messages on the same > page where the user submitted the form. You'll need to examine your JS > workflow, as that is not a Django issue. > > You'll integrate the form usage within your view. The Django tutorial > covers this using both function-based views and class-based views. You > should do this even when submitting the information via AJAX/JS, but the > page doesn't necessarily need to be redirected because your JS will handle > re-rendering the page properly. I'd recommend the Django Rest Framework > package in that case. > > -James > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/f089a104-ed0e-4ae0-9567-668e4422fb57%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

