<reponame>enesebastian/djangoapp<filename>polls/forms.py
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.forms import TextInput

from .models import CustomUser, Imprumut


class SignUpForm(UserCreationForm):
    full_name = forms.CharField(max_length=100, help_text='Obligatoriu.', widget=forms.TextInput(attrs={'autocomplete': 'off'}))

    class Meta:
        model = CustomUser
        fields = UserCreationForm.Meta.fields + ('full_name', 'age','phone_number','address')
        widgets = {
            'name': TextInput(attrs={'autocomplete': 'off'}),
        }

class ImprumutForm(forms.ModelForm):
    class Meta:

        model = Imprumut
        fields = ('username', 'suma', 'perioada', 'luni', 'bifa',)

from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.forms import TextInput

from .models import CustomUser, Imprumut


class SignUpForm(UserCreationForm):
    full_name = forms.CharField(max_length=100, help_text='Obligatoriu.', widget=forms.TextInput(attrs={'autocomplete': 'off'}))

    class Meta:
        model = CustomUser
        fields = UserCreationForm.Meta.fields + ('full_name', 'age','phone_number','address')
        widgets = {
            'name': TextInput(attrs={'autocomplete': 'off'}),
        }

class ImprumutForm(forms.ModelForm):
    class Meta:

        model = Imprumut
        fields = ('username', 'suma', 'perioada', 'luni', 'bifa',)