# _*_ coding:utf-8 _*_
__author__ = "WDdeBWT"
__date__ = "2017/7/19 11:37"

from django import forms
from captcha.fields import CaptchaField

from .models import UserProfile


class LoginForm(forms.Form):
    username = forms.CharField(required=True)
    password = forms.CharField(required=True, min_length=5)
<<<<<<< HEAD
    captcha = CaptchaField(error_messages={"invalid": u"验证码错误"})


class LoginFormNoCaptcha(forms.Form):
    username = forms.CharField(required=True)
    password = forms.CharField(required=True, min_length=5)
=======
>>>>>>> github/master


class RegisterForm(forms.Form):
    email = forms.EmailField(required=True)
    password = forms.CharField(required=True, min_length=5)
    captcha = CaptchaField(error_messages={"invalid": u"验证码错误"})


class UploadImageForm(forms.ModelForm):
    class Meta:
        model = UserProfile
        fields = ['image']


class ForgetPswForm(forms.Form):
    email = forms.EmailField(required=True)
    captcha = CaptchaField(error_messages={"invalid": u"验证码错误"})


class ModifyPswForm(forms.Form):
    password1 = forms.CharField(required=True, min_length=5)
    password2 = forms.CharField(required=True, min_length=5)


class UserInfoForm(forms.ModelForm):
    class Meta:
        model = UserProfile
        fields = ['nick_name', 'gender', 'address', 'mobile', ]


class UserBirthdayInfoForm(forms.Form):
    birthday = forms.DateField()


class MessageSendForm(forms.Form):
    email = forms.EmailField(required=True)
    message = forms.CharField()

