overload127

forms

May 20th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. from django import forms
  2. from django.contrib.auth.forms import UserCreationForm, UserChangeForm
  3. from django.contrib.auth.forms import AuthenticationForm
  4. from .models import AdvUser
  5.  
  6.  
  7. class RegisterAdvUserForm(forms.ModelForm):
  8.     class Meta:
  9.         model = AdvUser
  10.         fields = ('username', 'password')
  11.  
  12.  
  13. class AdvUserForm(AuthenticationForm, forms.ModelForm):
  14.     class Meta:
  15.         model = AdvUser
  16.         fields = ['username', 'password']
Add Comment
Please, Sign In to add comment