久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      1. <legend id='sF0n1'><style id='sF0n1'><dir id='sF0n1'><q id='sF0n1'></q></dir></style></legend>

      2. <i id='sF0n1'><tr id='sF0n1'><dt id='sF0n1'><q id='sF0n1'><span id='sF0n1'><b id='sF0n1'><form id='sF0n1'><ins id='sF0n1'></ins><ul id='sF0n1'></ul><sub id='sF0n1'></sub></form><legend id='sF0n1'></legend><bdo id='sF0n1'><pre id='sF0n1'><center id='sF0n1'></center></pre></bdo></b><th id='sF0n1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='sF0n1'><tfoot id='sF0n1'></tfoot><dl id='sF0n1'><fieldset id='sF0n1'></fieldset></dl></div>
        <tfoot id='sF0n1'></tfoot>
          <bdo id='sF0n1'></bdo><ul id='sF0n1'></ul>
      3. <small id='sF0n1'></small><noframes id='sF0n1'>

        如何從模型中在 django 中設置 DateField 格式?

        How can I set a DateField format in django from the model?(如何從模型中在 django 中設置 DateField 格式?)
        <i id='xSRju'><tr id='xSRju'><dt id='xSRju'><q id='xSRju'><span id='xSRju'><b id='xSRju'><form id='xSRju'><ins id='xSRju'></ins><ul id='xSRju'></ul><sub id='xSRju'></sub></form><legend id='xSRju'></legend><bdo id='xSRju'><pre id='xSRju'><center id='xSRju'></center></pre></bdo></b><th id='xSRju'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xSRju'><tfoot id='xSRju'></tfoot><dl id='xSRju'><fieldset id='xSRju'></fieldset></dl></div>

            <tbody id='xSRju'></tbody>
        1. <small id='xSRju'></small><noframes id='xSRju'>

              <bdo id='xSRju'></bdo><ul id='xSRju'></ul>

            • <legend id='xSRju'><style id='xSRju'><dir id='xSRju'><q id='xSRju'></q></dir></style></legend>
              • <tfoot id='xSRju'></tfoot>
                  本文介紹了如何從模型中在 django 中設置 DateField 格式?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在創建一個 django 應用程序,但我遇到了下一個問題:當我想設置日期時會顯示此錯誤:

                  I am creating a django application and I have the next problem: this error is shown when I want to set a date:

                  ValidationError [u"'12/06/2012' value has an invalid date format. It must be in YYYY-MM-DD format."]
                  

                  對于這個模型:

                  class ModelA(models.Model):
                  
                      date1 = models.DateField(null=True)
                      date2 = models.DateField(null=True)
                  

                  如何將 DateField 格式設置為 %m/%d/%Y.

                  How can I set the DateField format to be %m/%d/%Y.

                  選項input_formats"無法識別.

                  謝謝!

                  推薦答案

                  正如@bruno 在他的回答中提到的, input_formats 是一個表單字段,但是它可以用來控制保存的日期格式來自模型.

                  As @bruno as mentioned in his answer, input_formats is a forms field, however it can be used to control the date format saved from the model.

                  settings.py 中設置 DATE_INPUT_FORMATS 如下:

                  In settings.py set DATE_INPUT_FORMATS as below:

                  DATE_INPUT_FORMATS = ['%d-%m-%Y']
                  

                  在您的表單中,您可以執行以下操作:

                  And in your form you could do something like below:

                  class ClientDetailsForm(ModelForm):
                      date_of_birth = DateField(input_formats=settings.DATE_INPUT_FORMATS)
                      class Meta:
                         model = ModelA
                  

                  這篇關于如何從模型中在 django 中設置 DateField 格式?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)

                      <tbody id='lTHgf'></tbody>
                    <legend id='lTHgf'><style id='lTHgf'><dir id='lTHgf'><q id='lTHgf'></q></dir></style></legend>

                          • <bdo id='lTHgf'></bdo><ul id='lTHgf'></ul>
                            <tfoot id='lTHgf'></tfoot>
                          • <i id='lTHgf'><tr id='lTHgf'><dt id='lTHgf'><q id='lTHgf'><span id='lTHgf'><b id='lTHgf'><form id='lTHgf'><ins id='lTHgf'></ins><ul id='lTHgf'></ul><sub id='lTHgf'></sub></form><legend id='lTHgf'></legend><bdo id='lTHgf'><pre id='lTHgf'><center id='lTHgf'></center></pre></bdo></b><th id='lTHgf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='lTHgf'><tfoot id='lTHgf'></tfoot><dl id='lTHgf'><fieldset id='lTHgf'></fieldset></dl></div>

                            <small id='lTHgf'></small><noframes id='lTHgf'>

                            主站蜘蛛池模板: 午夜影院官网 | 国产精品久久二区 | 久久久精品一区二区三区四季av | 成人精品一区 | 欧美综合一区二区三区 | 欧美日韩国产一区二区三区 | 欧美一级免费看 | 国产91av视频在线观看 | 最新免费黄色网址 | 天天插天天搞 | 怡红院怡春院一级毛片 | 91免费入口 | 国产成人精品久久久 | 久久久久国产一区二区三区 | 国产成人综合在线 | 99国内精品久久久久久久 | 三级在线视频 | 国产欧美综合在线 | 97超碰成人| 久久久久国产一级毛片高清网站 | 亚洲欧洲视频 | 黑人巨大精品欧美一区二区免费 | 国产福利精品一区 | 天天操天天插 | 成人在线一区二区三区 | 婷婷桃色网 | 国产精品久久久久一区二区三区 | 污片在线观看 | 久久人 | 亚洲日产精品 | 理论片87福利理论电影 | 黄色一级片aaa | 久久手机在线视频 | 国产电影精品久久 | 久久久男人的天堂 | 一级片在线观看视频 | 久久久www成人免费无遮挡大片 | 亚洲精品二区 | 欧美精品被 | 在线观看国产三级 | 中文字幕视频在线观看 |