我是django频道的新手,我坚持如何更改此特定绑定类中日期时间字段的格式。
类InfoBinding(WebsocketBinding):
model =Info
stream = "stream"
fields = ["time_stamp"]
@classmethod
def group_names(cls, *args, **kwargs):
return ["binding.values"]
def has_permission(self, user, action, pk):
# print(self.time_stamp)
return True
答案 0 :(得分:0)
您必须在has_permission()中修改DatetimeField。