from django import forms
from django.http import HttpResponseRedirect
from mezzanine.pages.page_processors import processor_for
from .models import Author

This is processor.py file: Now i save this in /myproject/proccessor.py. My 
question can be simple but i am confuse that now where i have to define 
this to access this form. (in url.py file using views or in template or is 
there any other way too!)

*class AuthorForm(forms.Form):*
*    name = forms.CharField()*
*    email = forms.EmailField()*

*@processor_for(Author)*
*def author_form(request, page):*
*    form = AuthorForm()*
*    if request.method == "POST":*
*        form = AuthorForm(request.POST)*
*        if form.is_valid():*
*            # Form processing goes here.*
*            redirect = request.path + "?submitted=true"*
*            return HttpResponseRedirect(redirect)*
*    return {"form": form}*

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to