title: Multiple models validation in the same View - Django 1.11
body: <p>I'm looking for a strategy to validate the uniqueness of the keys of four models that have relationships with each other before finally being able to save them in the database.</p>
  
  <p>In other words, I would like to check the uniqueness of the keys so that there is no inconsistency in the database when using the <code>Model.save()</code> method, and only use it when all the unique keys are really unique.</p>
  
  <p>Following the view below as an example, the fields <em>cnpj</em>, <em>address</em>, and <em>number</em> respectively in <code>LegalPerson</code>, <code>Email</code> and <code>Phone</code>, must be unique.</p>
  
  <pre><code>class StoreRegistrationView(View):
      '''
      Classe responsavel pelo cadastro de lojas
      '''
      def post(self, request):
  
          if request.method == 'POST':
              #import pdb; pdb.set_trace()
              form = StoreForm(request.POST)
  
              if form.is_valid():
  
                  lp = LegalPerson(
                      cnpj = form.cleaned_data['cnpj'],
                      corporate_name = form.cleaned_data['corporate_name'],
                      fantasy_name = form.cleaned_data['fantasy_name'],
                      state_inscription = form.cleaned_data['state_inscription'],
                      municipal_inscription = form.cleaned_data['municipal_inscription'],
                      )
  
                  lp.save()
  
                  address = Address(
                      street = form.cleaned_data['street'],
                      neighborhood = form.cleaned_data['neighborhood'],
                      number = form.cleaned_data['number'],
                      complement = form.cleaned_data['complement'],
                      city = form.cleaned_data['city'],
                      estate = form.cleaned_data['estate'],
                      country = 'Brasil',
                      cep = form.cleaned_data['cep'],
                      latitude = form.cleaned_data['latitude'],
                      longitude = form.cleaned_data['longitude'],
                      person = lp,
                      )
  
                  address.save()
  
                  email = Email(
                      address = form.cleaned_data['email'],
                      person=lp,
                      )
  
                  email.save()
  
                  phone = Phone(
                      number=form.cleaned_data['phone_number'],
                      person=lp,
                      )
  
                  phone.save()
  
                  # Mensagem de sucesso que será disponibilizada para o usuário
                  messages.success(request, 'Cadastro de loja efetuado com sucesso.')
  
                  return redirect('importar-produtos')
  
          messages.warning(request, 'Erro durante o cadastro.')
          context = {
              'store_form': StoreForm(),
                  }
  
          return render(request, 'n3oadmin/store-registration.html', context)
  </code></pre>
  
  <p>I've been researching, and found that models in django have some validating methods like <code>Model.full_clean()</code>, <code>Model.clean()</code>, and <code>Model.validate_unique()</code>.</p>