擅长:python、mysql、java
<p>你也可以这样做</p>
<pre><code> <form method='POST'>
{{form1.as_p}}
<button type="submit" name="btnform1">Save Changes</button>
</form>
<form method='POST'>
{{form2.as_p}}
<button type="submit" name="btnform2">Save Changes</button>
</form>
</code></pre>
<p><em><strong>代码</p>
<pre><code>if request.method=='POST' and 'btnform1' in request.POST:
do something...
if request.method=='POST' and 'btnform2' in request.POST:
do something...
</code></pre>