# Path: blog/models.py
# class Comment(models.Model):
#     created = models.DateTimeField(auto_now_add=True)
#     name = models.CharField(max_length=60)
#     email = models.EmailField(max_length=35, null=True)
#     body = models.TextField()
#     post = models.ForeignKey(Post)
# 
#     class meta:
#         ordering = ['-created']
# 
#     def __unicode__(self):
#         return unicode("%s: %s" % (self.post, self.body[:60]))
# 
# class Feedback(models.Model):
#     created = models.DateTimeField(auto_now_add=True)
#     name = models.CharField(max_length=75)
#     email = models.EmailField(max_length=75)
#     feedback = models.TextField()
# 
#     class meta:
#         ordering = ['-created']
# 
#     def __unicode__(self):
#         return unicode("%s: %s" % (self.email, self.feedback[:60]))


from django.forms import ModelForm
from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from .models import Comment, Feedback




class CommentForm(ModelForm):
    class Meta:
        model = Comment
        exclude = ["post"]


class CommentsForm(forms.Form):
    name = forms.CharField(widget=forms.TextInput(
        attrs={'size': '48',
               'class': 'form-control'}))
    # A CharField that checks that the value is a valid email address.
    email = forms.EmailField(widget=forms.TextInput(
        attrs={'size': '48',
               'class': 'form-control'}))
    Body = forms.CharField(widget=forms.Textarea(
        attrs={'cols': 50, 'rows': 5,
               'class': 'form-control'}))


class FeedbackForm(ModelForm):
    class Meta:

# Path: blog/models.py
# class Comment(models.Model):
#     created = models.DateTimeField(auto_now_add=True)
#     name = models.CharField(max_length=60)
#     email = models.EmailField(max_length=35, null=True)
#     body = models.TextField()
#     post = models.ForeignKey(Post)
# 
#     class meta:
#         ordering = ['-created']
# 
#     def __unicode__(self):
#         return unicode("%s: %s" % (self.post, self.body[:60]))
# 
# class Feedback(models.Model):
#     created = models.DateTimeField(auto_now_add=True)
#     name = models.CharField(max_length=75)
#     email = models.EmailField(max_length=75)
#     feedback = models.TextField()
# 
#     class meta:
#         ordering = ['-created']
# 
#     def __unicode__(self):
#         return unicode("%s: %s" % (self.email, self.feedback[:60]))


# Path: blog/forms.py
from django.forms import ModelForm
from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from .models import Comment, Feedback





class CommentForm(ModelForm):
    class Meta:
        model = Comment
        exclude = ["post"]


class CommentsForm(forms.Form):
    name = forms.CharField(widget=forms.TextInput(
        attrs={'size': '48',
               'class': 'form-control'}))
    # A CharField that checks that the value is a valid email address.
    email = forms.EmailField(widget=forms.TextInput(
        attrs={'size': '48',
               'class': 'form-control'}))
    Body = forms.CharField(widget=forms.Textarea(
        attrs={'cols': 50, 'rows': 5,
               'class': 'form-control'}))


class FeedbackForm(ModelForm):
    class Meta:

        model = Feedback