import django.forms as forms
from django.forms import ModelForm
from app.models import Profile


class SignupForm(forms.Form):
    first_name = forms.CharField(max_length=30, label='First Name',
                                 widget=forms.TextInput(attrs={'placeholder': 'First Name'}))
    last_name = forms.CharField(max_length=30, label='Last Name',
                                widget=forms.TextInput(attrs={'placeholder': 'Last Name'}))

    def signup(self, request, user):
        user.first_name = self.cleaned_data['first_name']
        user.last_name = self.cleaned_data['last_name']
        user.save()


class ProfilePicForm(ModelForm):
    class Meta:
        model = Profile
        fields = ('profile_picture',)


