Guest User

Untitled

a guest
Feb 21st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. #FORMS.py
  2. class FormCadastroConta(form.ModelForm):
  3.     username = forms.CharField(label='Login',widget=forms.TextInput())
  4.     email = forms.EmailField(label='E-mail do Adm.',widget=forms.TextInput())
  5.     password = forms.CharField(label='Senha',widget=forms.PasswordInput())
  6.     password_check = forms.CharField(label='Confirmação de Senha',widget=forms.PasswordInput())
  7.     class Meta:
  8.         model = CadastroConta
  9.  
  10. models.PY
  11.  
  12. class CadastroConta(models.Model):
  13.     user = models.ForeignKey(User, unique=True)
  14.  
  15. class CadastroLoja(models.Model):
  16.     conta = models.OneToOneField(CadastroConta,primary_key=True)
  17.     nome = models.CharField('Nome da loja',max_length=30)
  18.     segmento = models.CharField(max_length=20)
Add Comment
Please, Sign In to add comment