Answer the question
In order to leave comments, you need to log in
What is the best way to store data temporarily?
It is necessary to implement the following functionality: when registering, the user first enters a login and password (User model), and then fills out a questionnaire (Profile model). At the same time, if the questionnaire is not filled out (for example, the user sent the username and password, but did not fill out the questionnaire and closed the tab), then the account should not be created.
from django.db import models
from django.contrib.auth.models import User
from django import forms
from django.conf import settings
class Profile(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL)
firstName = models.CharField("Имя", max_length=10)
lastName = models.CharField("Фамилия", max_length=20)
fatherName = models.CharField("Отчество", max_length=20)
phoneNum = models.CharField("Номер телефона", max_length=12, default='')
age = models.PositiveSmallIntegerField("Возраст", blank=True)
reg_num = models.IntegerField("Регистрационный номер", default=0)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question