from django import  forms
from .models import Amministratore

class FormAmministratoreEditId(forms.Form):
  def __init__(self,*args,amministratore=[],**kwargs):
    super().__init__(*args, **kwargs)
    self.fields['scelta'] = forms.ChoiceField(required=True,choices=self.c(amministratore))

  def c(self,amministratore):
    choices = []
    for u in amministratore:
      choices.append((u.id,u.id),)

    print('choices',choices)
    return choices

class FormAmministratore(forms.Form):
  def __init__(self,*args,**kwargs):
    forms.Form.__init__(self,*args,**kwargs)
    self.fields['login'] = forms.CharField(required=True)
    self.fields['nome'] = forms.CharField(required=True)
    self.fields['mail'] = forms.CharField(required=False)
    self.fields['pin'] = forms.CharField(required=True)
    self.fields['uuid'] = forms.CharField(required=False)

