# Path: example/example/main/forms.py
# class FeedbackForm(forms.Form, AjaxForm):
#     RATING_CHOICES = (
#         ('good', 'good'),
#         ('bad', 'bad'),
#     )
#     email = forms.EmailField()
#     rating = forms.ChoiceField(choices=RATING_CHOICES)
#     message = forms.CharField(widget=forms.Textarea())
# 
#     def send(self):
#         print 'Send!'
# 
# class FileForm(forms.Form, AjaxForm):
#     message = forms.CharField(widget=forms.Textarea())
#     file = forms.FileField()
# 
#     def send(self):
#         file = self.cleaned_data['file']
#         print 'Send: %s, size: %s' % (file, file.size)


from django.template.response import TemplateResponse
from .forms import FeedbackForm, FileForm


def index(request):
    return TemplateResponse(request, 'main/index.html')


def hello(request):
    return TemplateResponse(request, 'main/hello.html')


def test_batch(request):
    return TemplateResponse(request, 'main/test_batch.html')


def js_api(request):
    return TemplateResponse(request, 'main/js_api.html')


def form(request):
    context = {
        'form': FeedbackForm()
    }
    return TemplateResponse(request, 'main/form.html', context)


def upload_form(request):

# Path: example/example/main/forms.py
# class FeedbackForm(forms.Form, AjaxForm):
#     RATING_CHOICES = (
#         ('good', 'good'),
#         ('bad', 'bad'),
#     )
#     email = forms.EmailField()
#     rating = forms.ChoiceField(choices=RATING_CHOICES)
#     message = forms.CharField(widget=forms.Textarea())
# 
#     def send(self):
#         print 'Send!'
# 
# class FileForm(forms.Form, AjaxForm):
#     message = forms.CharField(widget=forms.Textarea())
#     file = forms.FileField()
# 
#     def send(self):
#         file = self.cleaned_data['file']
#         print 'Send: %s, size: %s' % (file, file.size)


# Path: example/example/main/views.py
from django.template.response import TemplateResponse
from .forms import FeedbackForm, FileForm



def index(request):
    return TemplateResponse(request, 'main/index.html')


def hello(request):
    return TemplateResponse(request, 'main/hello.html')


def test_batch(request):
    return TemplateResponse(request, 'main/test_batch.html')


def js_api(request):
    return TemplateResponse(request, 'main/js_api.html')


def form(request):
    context = {
        'form': FeedbackForm()
    }
    return TemplateResponse(request, 'main/form.html', context)


def upload_form(request):

    context = {