mercredi 15 juin 2016

Use my own form template to send data to django database

I have this form:

<form method="POST" action="{{ url }}"> <i>
                {% csrf_token %}

                <div class="formwrapper">
                    <div class="summary_table">
                        <div class="page-header clearfix desc_line">
                            <h4 class="title">Sending</h4>
                        </div>
                        <div class="form-group">
                            <div class="container-fluid">
                                <div class="col-md-11">
                                        <label for="chart_ids">Chart ID's</label>
                                        <div class="field">
                                            <select id="chart_ids" multiple data-role="tagsinput" class="form-control">
                                                <option value="3419">3419</option>
                                                <option value="3420">3420</option>
                                            </select>
                                        </div>
                                        <label for="recipients">Recipient Email's</label>
                                        <div class="field">
                                            <select id="recipients" multiple data-role="tagsinput" class="form-control" >
                                                <option value="office@rupeal.com">office@rupeal.com</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                             </div>
                        </div>
                    </div>
                    <div class=" clearfix desc_line summary_table">
                        <div class=" clearfix desc_line">
                            <br>
                            <div class="bs-example myModal">
                                <button type="submit" class="btn btn-info btn-lg">Save</button>
                            </div>
                        </div>
                    </div>
                </form> <!-- end of form-->

I want to use that code to send data and save it do django database without having to create a forms.py and use {{ form.as_p }}

How can i do that? I really dont like the form that generates

Aucun commentaire:

Enregistrer un commentaire