Django: How to populate form data in template
问题 So I am trying to have "two forms" in single class based view. My view is: class ListAndCreate(CreateView): model = xmpp_buddy_groups form_class = xmpp_buddy_groups_form second_form_class = sip_extension_form template_name = "xmpp/index.html" success_url = reverse_lazy('xmpp:index') def get_context_data(self, **kwargs): context = super(ListAndCreate, self).get_context_data(**kwargs) context['object_list'] = self.model.objects.all() extension = SipExtension.objects.values_list('sip_extension',