我正在使用Django REST框架并尝试在HTML表单上发布一个DateTimeField,我可以编写除秒之外的所有内容。
我已尝试将序列化程序更新为:
timestamp = serializers.DateTimeField(input_formats='%Y-%m-%dT%H:%M:%SZ')
但它没有用。
答案 0 :(得分:0)
以下是对input formats的引用,我认为您可以让您的示例像这样工作
def __init__(self):
wx.Frame.__init__(self, None, title="Dropdown Test", size=(400,400))
control_sizer = wx.GridBagSizer(vgap=3, hgap=10)
label1 = wx.StaticText(self, -1, label="First Dropdown:", size=(120,25))
control_sizer.Add(label1, (0,0), (1,1), flag=wx.LEFT | wx.TOP | wx.EXPAND, border=10)
label2 = wx.StaticText(self, -1, label="Second Dropdown:", size=(120,25))
control_sizer.Add(label2, (1,0), (1,1), flag=wx.LEFT | wx.TOP | wx.EXPAND, border=10)
self.choice1 = wx.Choice(self, -1, choices=["thing 1","thing 2","thing 3","thing 4"], size=(120,25))
self.choice1.SetSelection(0)
control_sizer.Add(self.choice1, (0,1), (1,1), flag=wx.RIGHT | wx.EXPAND, border=10)
self.choice2 = wx.Choice(self, -1, choices=["stuff 1","stuff 2","stuff 3","stuff 4"], size=(120,25))
control_sizer.Add(self.choice2, (1,1), (1,1), flag=wx.RIGHT | wx.EXPAND, border=10)
self.choice2.SetSelection(1)
self.SetSizerAndFit(control_sizer)