From 616606fa81a075a7caa0d4def2f189f78b2b093f Mon Sep 17 00:00:00 2001 From: Benni Baermann Date: Tue, 29 Sep 2020 12:16:10 +0200 Subject: [PATCH] added datepicker from admin --- input/forms.py | 7 ++++++- input/templates/input/project.html | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/input/forms.py b/input/forms.py index 69ffb37..7105931 100644 --- a/input/forms.py +++ b/input/forms.py @@ -1,8 +1,13 @@ from django.db import models -from django.forms import ModelForm +from django.forms import ModelForm, DateField +from django.contrib.admin.widgets import AdminDateWidget + from .models import Project class ProjectForm(ModelForm): + + start = DateField(widget=AdminDateWidget) + class Meta: model = Project fields = '__all__' diff --git a/input/templates/input/project.html b/input/templates/input/project.html index e751efb..d63ec79 100644 --- a/input/templates/input/project.html +++ b/input/templates/input/project.html @@ -1,3 +1,15 @@ +{% load static %} + + + + + + +{{ form.media }} + + + +
{% csrf_token %} {{ form }}