Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k 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 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.6k users

...