I Want To Save The Data In My Database Depending On The Catgory Of Data Chosen by User Like I Have 4 Lisitings Like APparetements, Food And Life, Car And Travelling if User Selects Appartements Then Area, location Fields Are Showed An getiing Data An

55 views
Skip to first unread message

Hamza Bilal

unread,
Aug 20, 2023, 12:29:57 PM8/20/23
to Django users
{% extends 'home.html' %}
{% load static %}
{% block content %}

<div class="page-heading">
    <div class="container">
      <div class="row">
        <div class="col-lg-8">
          <div class="top-text header-text">
            <h6>Add Plots In Your Listing</h6>
            <h2>If You Want To Buy The Plot Then Add It In Your Listing</h2>
          </div>
        </div>
      </div>
    </div>
</div>

<div class="contact-page">
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
          <div class="inner-content">
            <div class="row">
             
              <div class="col-lg-6 align-self-center">
                <form id="contact" action="" method="POST" enctype="multipart/form-data">
                  <div class="row">
                    {% csrf_token %}
                    <div class="col-lg-12">
                        <label for="">Listing Type</label>
                        {{ form.listing_type }}
                            <label for="" >Area</label>
                            {{ form.area }}
                            <label for="">Location</label>
                            {{ form.location }}

                            <label for="">Price</label>
                            {{ form.price }}
                            <label for="">Title</label>
                            {{ form.title }}
                            <label for="">Upload An Image</label>
                            {{ form.image }}
                    </div>
                   
                    <div class="col-lg-12">
                      <fieldset>
                        <button type="submit" id="form-submit" class="main-button "><i class="fa fa-paper-plane"></i>Add Your Listing!</button>
                      </fieldset>
                    </div>
                  </div>
                </form>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
</div>

   
   
   
   
   

{% endblock content %}

ivan harold

unread,
Aug 23, 2023, 11:38:36 AM8/23/23
to Django users
You should prepare a different form that will submit the post to a specific table or database. you have to specify where the table or database the post will go.
Reply all
Reply to author
Forward
0 new messages