Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #FORMS.py
- class FormCadastroConta(form.ModelForm):
- username = forms.CharField(label='Login',widget=forms.TextInput())
- email = forms.EmailField(label='E-mail do Adm.',widget=forms.TextInput())
- password = forms.CharField(label='Senha',widget=forms.PasswordInput())
- password_check = forms.CharField(label='Confirmação de Senha',widget=forms.PasswordInput())
- class Meta:
- model = CadastroConta
- models.PY
- class CadastroConta(models.Model):
- user = models.ForeignKey(User, unique=True)
- class CadastroLoja(models.Model):
- conta = models.OneToOneField(CadastroConta,primary_key=True)
- nome = models.CharField('Nome da loja',max_length=30)
- segmento = models.CharField(max_length=20)
Add Comment
Please, Sign In to add comment