from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm
from django import forms

from .models import *


class RegistrationForm(UserCreationForm):
    username = forms.CharField(label='Логин')
    password1 = forms.CharField(label='Придумайте пароль', widget=forms.PasswordInput())
    password2 = forms.CharField(label='Придумайте пароль', widget=forms.PasswordInput())

    class Meta:
        model = get_user_model()
        fields = ('username', 'name', 'surname', 'avatar', 'password1', 'password2')

        labels = {
            'name': 'Имя',
            'surname': 'Фамилия',
            'avatar': 'Аватарка'
        }

class ProfileForm(forms.ModelForm):
    class Meta:
        fields = ('username', 'name', 'surname', 'avatar', 'password')