I have two CreateViews
client and company. I am trying to add a client from the company create page. I thought i would just be able to change the action
in the form tag to point to the client url. Nothing happens though when i click submit.
urls.py
url(r'^clients/create/$', ClientCreate.as_view(success_url="/app/clients/"), name='clients-create'),
url(r'^company/create/$', CompanyCreate.as_view(), name='company-create'),
views.py
class ClientCreate(CreateView):
model = Client
fields = [...]
class CompanyCreate(CreateView):
model = Company
fields = [...]
create-company.html
<form role="form" method="post" action="."> {% csrf_token %}
<a (Link to popup form)>+</a>
<form role="form" method="post" action="client/create/">{% csrf_token %} </form>
</form>