forms.py Здесь, в forms.py, я написал форму отлично, но не могу найти проблему
from bootstrap_datepicker_plus import DatePickerInput,DateTimePickerInput
class SchedulAuctionForm(forms.ModelForm):
# auction_start_date=forms.DateTimeField(widget=DateTimePickerInput())
# auction_end_date = forms.DateTimeField(widget=DateTimePickerInput())
class Meta():
fields=('auction_start_date','auction_end_date')
model = models.CurrentAuction
widgets = {
'auction_start_date': DateTimePickerInput(),
'auction_end_date': DateTimePickerInput(),
}
views.py
class AuctionScheduling(UpdateView):
model = models.CurrentAuction
template_name = 'auctions/admin/auction_scheduler.html'
form_class = forms.SchedulAuctionForm
success_url = reverse_lazy('home')
def form_valid(self, form):
prop = get_object_or_404(models.PropertyReg,pk=self.kwargs.get('pk'))
prop = form.cleaned_data['something']
prop.save()
return super().form_valid(form)
auction_scheduler. html
{%extends 'auctions/admin/admin_base.html'%}
{%load static%}
{%load bootstrap4%}
{% bootstrap_css %}
{% bootstrap_javascript jquery='full' %}
{% include "bootstrap_datepicker_plus/input.html" %}
{%block heading%}
<br/>
<br/>
<br/>
<center><h1 id="scroll">Auction Schedule</h1></center>
<br/>
{%endblock%}
{%block content%}
{{ form.media }}
<br/>
<div class="container">
<form method="post">
{%csrf_token%}
{%bootstrap_form form%}
<input type="submit" value="Schedule This" class="btn btn-danger">
</form>
</div>
<br/>
{%endblock%}
введите описание изображения здесь Как видно на изображении, средство выбора не отображается на все