Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

django - How to send data present in html table rows to back end

I'm trying to make a simple library management app using Django. I don't know how to send data present in HTML table rows to the backend for storing into the database

I know I can use JSON but I think there is a more sophisticated way ...

This is the code please help I appreciate that...

{% extends 'home.html' %}

{% block b %}
<div class="container">
    

<table class="table">
  <thead>
    <tr>
      <th scope="col">book_name</th>
      <th scope="col">writer_name</th>
      <th scope="col">category</th>
      <th scope="col">Sub_category</th>
      <th scope="col">price</th>
      <th scope="col">quntity</th>
      
    </tr>
  </thead>
  <tbody id="table">
    <tr>
      <th scope="row">1</th>
      <td>Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
      <td>123</td>
      <td>1w3</td>
    </tr>

  </tbody>
</table>
    <input type="button" class="btn btn-primary" value="store"/>
</div>


<hr />
<div class="container">
  {{ form}}  
  <input type="button" class="btn btn-primary" value="orderd" id="orderd" />

</div>


question from:https://stackoverflow.com/questions/65831673/how-to-send-data-present-in-html-table-rows-to-back-end

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...