title: Django, How to get object instance(id) before creating it in form_valid function of generics view?
body: <p>When i creating Post model object i need to get it ID instantly and create a second model User_permission , how in this case can i pass to post variable the ID data of newly created post</p>
  
  <pre><code>  class CreatePostView(LoginRequiredMixin, CreateView):
          model = Post
          form_class = PostForm
  
          def form_valid(self, form): 
                  obj = User_permission.objects.create(post=post)
                  obj.save()
              return super().form_valid(form)
  </code></pre>