python - Date picker for django app using bootstrap4 -
this view , template django app. views written using django class based view.
view.py
class createdgthreephase(createview): model = dgthreephase fields = ['site','name','make','capacity','commissiondate',] def get_context_data(self, **kwargs): context = super(createdgthreephase, self).get_context_data(**kwargs) context['list_objects'] = dgthreephase.objects.all()[:10] return context class updatedgthreephase(updateview): model = dgthreephase fields = ['site','name','make','capacity','commissiondate',] class deletedgthreephase(deleteview): model = dgthreephase template_name = 'sidebar_menu/delete_menu.html' def get_context_data(self, **kwargs): context = super(deletedgthreephase, self).get_context_data(**kwargs) context['model_name'] = context['object'].__class__.__name__ return context template-> dgthreephase_form.html
{% extends 'common/base.html' %} {% load crispy_forms_tags %} {%block body %} <div class="col-md-12"> <div class="row"> <div class="col-md-8"> <h4>dg 3 phase management</h4> <div class="tro-form"> <form method="post" ng-non-bindable> {% csrf_token %} {{form | crispy}} <input type="submit" value="save" class="btn btn-success" /> {% if request.resolver_match.url_name == 'dgthree_phase_update' %} or <a href="{% url 'sites:dgthree_phase_create' %}">cancel</a> <a href="{% url 'sites:dgthree_phase_delete' pk=object.id %}" class="btn btn-danger pull-right">delete</a> {% endif %} </form> </div> </div> <div class="col-md-4"> <h4>dg 3 phase list</h4> <div class="tro-form"> <input type="text" class="form-class" style="padding: 4px 4px 4px 10px;" placeholder="search..." id="id_search_menu"/> <div class="list-group" style="padding-top: 5px" id="menu_list_id"> {% list in list_objects %} <a href="{% url 'sites:dgthree_phase_update' pk=list.id %}" class="list-group-item list-group-item-action"> {{list.name}} </a> {% endfor %} </div> </div> </div> </div> </div> {% endblock%} how can add date picker commissiondate field using bootstrap4? commisiondate date field , how can using bootstrap
Comments
Post a Comment