2015-02-06 5 views
0

큰 설문 조사를 여러 행에 저장하는 방법에 대한 아이디어를 찾고 있습니다 (MySQL). 어떤 도움이라도 대단히 감사하겠습니다. 파이썬과 장고 프로그래밍에 비교적 익숙하다.하나의 양식 공유 데이터를 여러 행으로 분할했습니다.

형태 :

<form method="post"> 

<label for="InputOD1" class="col-sm-2 control-label">Order Number</label> 
<input type="text" id="InputOD1" name="InputOD1" placeholder="Order Number"> 

<label for="InputSA1" class="col-sm-2 control-label">Shipping Address</label> 
<input type="text" id="InputSA1" name="InputSA1" placeholder="Shipping Address"> 



<label for="InputFN1" class="col-sm-2 control-label">First Name</label> 
<input type="text" id="InputFN1" name="InputFN1" placeholder="Last Name"> 

<label for="InputLN1" class="col-sm-2 control-label">Last Name</label> 
<input type="text" id="InputLN1" name="InputLN1" placeholder="Last Name"> 

<label for="InputGR1" class="col-sm-2 control-label">Gender</label> 
<input type="text" id="InputGR1" name="InputGR1" placeholder="Gender> 



<label for="InputFN2" class="col-sm-2 control-label">First Name</label> 
<input type="text" id="InputFN2" name="InputFN2" placeholder="Last Name"> 

<label for="InputLN1" class="col-sm-2 control-label">Last Name</label> 
<input type="text" id="InputLN2" name="InputLN2" placeholder="Last Name"> 

<label for="InputGR1" class="col-sm-2 control-label">Gender</label> 
<input type="text" id="InputGR2" name="InputGR2" placeholder="Gender> 

<button type="submit" class="btn btn-default">Submit</button> 

</form> 

예상 데이터베이스 결과 : 당신이 django formsets를 사용해야합니다이 작업을 위해

Order Number, Shipping Address, First Name 1, Last Name 1, Gender 1 
Order Number, Shipping Address, First Name 2, Last Name 2, Gender 2 
.... 
Order Number, Shipping Address, First Name 5, Last Name 5, Gender 5 

답변

관련 문제