【发布时间】:2016-11-19 13:36:18
【问题描述】:
Django 不支持其表单的日期选择器,我没有找到任何适合我的解决方案。
如果有人知道一些简单的解决方案,我将非常感激。
谢谢。
forms.py
class meta:
model = Student
fields = ["classfk","name","birth_date"]
views.py
class CreateNewStudent(CreateView):
fields = ("classfk","name", "birth_date")
model = Student
success_url = '/class/'
template_name = "temp/newstudent.html"
newstudent.html
<html>
<body>
<head>
</head>
<form action="" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit"/>
</form>
</body>
</html>
【问题讨论】:
-
PS:我对 Django 表单一无所知,但我能够找到它。这是出现在 Google 搜索中的第一个链接
-
这个链接的这个答案不能解决问题
-
没有解决问题是什么意思?您会遇到一些错误/异常/意外行为吗?我什至不知道你尝试了什么。请与问题一起提及所有必要的信息。只有这样来自 SO 的人才能帮助您:)
-
我只是编辑我的答案。你可以检查一下
标签: python django django-forms