# coding=utf-8
from django import forms
from django.contrib.auth.models import User as UserAuth

from .models import UserProfile


class UserProfileForm(forms.ModelForm):
    class Meta:
        model = UserProfile
        exclude = ['fk_user', 'unbannedDate', 'fk_state', 'bannedDate', 'quantityBanned',]
        widgets = {
            'mm_city': forms.CheckboxSelectMultiple(),
            'mm_service': forms.CheckboxSelectMultiple(),
        }

        labels = {
            'fk_userType': 'Tipo de usuario',
            'phone': 'Teléfono',
            'mm_city': 'Ciudades en las que trabaja',
            'mm_service': 'Tipos de servicios que realiza',
        }

    def __init__(self, *args, **kwargs):
        super(self.__class__, self).__init__(*args, **kwargs)
        self.fields['mm_city'].required = False
        self.fields['mm_service'].required = False


class AuthProfileForm(forms.ModelForm):
    class Meta:
        model = UserAuth
        fields = ['first_name', 'last_name', 'email',]

