0

Some kind of user don't have phone number, some kind of user have. For example, shopping user have phone_numer, admin don't have. So I add one ShoppingPorfile(OneToOne relation to user) for shopping user, because I don't want to let phone_numer's null=True. But if do like this, I have to combine two form(UserForm + ProfileForm) to complete register:

if all(user_form, profile_form): 
    user = user_form.save()
    profile = profile_form.save(user=user)

Does it ok? or you have more better advice.

kotepillar
  • 114
  • 7

0 Answers0