を使用して新しいオブジェクトを保存しています
new_document = form.save(commit=False)
new_document.object_id = int(self.kwargs['pk'])
new_document.content_type = ContentType.objects.get_for_model(self.target_model)
# Set the document category
new_document.category = self.get_document_category()
new_document.save()
ここで知りたいのは、オブジェクトを保存した後、オブジェクトの主キーやその他の属性を取得するにはどうすればよいかということです。