【问题标题】:Django adding hour and minute from formDjango从表单中添加小时和分钟
【发布时间】:2020-08-26 08:51:41
【问题描述】:

可以从管理仪表板添加小时、分钟和秒,但现在我想将其添加到我的模板中。

models.py:

class Document(models.Model):
    date = models.DateTimeField()

forms.py:

class CreateDocumentForm(ModelForm):
...
    class Meta:
        model = ComplaintDocument
        fields = '__all__'
        widgets = {
            'date': DateTimeInput(attrs={'type': 'date'}),
        }

【问题讨论】:

    标签: python django django-models django-views django-templates


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2018-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多