from django import forms
from users.models import Tshirt, Diet, Location


class SignUpForm(forms.Form):

    user_name = forms.CharField(label='User Name')
    password = forms.CharField(label='Password', widget=forms.PasswordInput)
    first_name = forms.CharField(label='First Name')
    last_name = forms.CharField(label='Last Name')
    email = forms.EmailField(label='Email Address')
    tshirt = forms.ModelChoiceField(label='T-Shirt Size',
            queryset=Tshirt.objects.all())
    diet = forms.ModelChoiceField(label='Dietary Preference',
            queryset=Diet.objects.all())
    location = forms.ModelChoiceField(label='Location',
            queryset=Location.objects.all())
    description = forms.CharField(label='Describe Yourself',
            widget=forms.Textarea, required=False)
    notify_by_email = forms.BooleanField(
            label="Email me when there's a new post", required=False)


class SignInForm(forms.Form):

    user_name = forms.CharField(label='User Name')
    password = forms.CharField(label='Password', widget=forms.PasswordInput)
    next = forms.CharField(label='Next URL', widget=forms.HiddenInput)


class UserProfileForm(forms.Form):

    first_name = forms.CharField(label='First Name')
    last_name = forms.CharField(label='Last Name')
    email = forms.EmailField(label='Email Address')
    tshirt = forms.ModelChoiceField(label='T-Shirt Size',
            queryset=Tshirt.objects.all())
    diet = forms.ModelChoiceField(label='Dietary Preference',
            queryset=Diet.objects.all())
    location = forms.ModelChoiceField(label='Location',
            queryset=Location.objects.all())
    description = forms.CharField(label='Describe Yourself',
            widget=forms.Textarea, required=False)
    notify_by_email = forms.BooleanField(
            label="Email me when there's a new post", required=False)
    password = forms.CharField(label='Password',
            widget=forms.PasswordInput, required=False)

@@ -113,36 +113,36 @@
 er_name = forms.
-Char
+Slug
 Field(label='Use
@@ -140,32 +140,229 @@
 abel='User Name'
+,%0A            error_messages=%7B'required': 'Please enter a user name.',%0A                            'invalid': 'Please enter a user name containing only letters, numbers, underscores, and hyphens.'%7D
 )%0A    password =
@@ -1156,36 +1156,36 @@
 er_name = forms.
-Char
+Slug
 Field(label='Use
@@ -1187,24 +1187,221 @@
 ='User Name'
+,%0A            error_messages=%7B'required': 'Please enter a user name.',%0A                            'invalid': 'Please enter a user name containing only letters, numbers, underscores, and hyphens.'%7D
 )%0A    passwo

make user name fields SlugFields