per page, with , order by , clip by
Results of 1 - 10 of about 75 for datetime (0.008 sec.)
タイムゾーン 14268
タイムゾーン 概要 タイムゾーンのサポートが有効な場合、Django は日時情報をデータベースには UTC で保存し、内部ではタイムゾーンを意識した(aware な) datetime オブジェクトを使用します。フォームではそれをエンドユーザーのタイムゾーンに変換して表 ... の問題と格闘している場合は、 タイムゾーンの FAQ を参照してください。 コンセプト native と aware の日時オブジェクト Python の datetime.datetime のオブジェクトには、タイムゾーン情報を保持するために使える tzinfo 属性があり、これは datetime.tzinfo のサブクラス ... のインスタンスで表されます。 この属性がセットされオフセットを示すとき、datetime オブジェクトは aware (タイムゾーンを意識した日時) となります。それ以外の場合は naive (タイムゾーンを意識しない素朴な日時) ... るか native にするかを決めることもできます。 タイムゾーンのサポートが無効になっている場合、 Django はローカル時間の naive な datetime オブジェクトを使います。多くの場合、これで十分です。このモードでは、現在時刻を取得するには、次のように書きます: import dat ...
https://man.mtool.work/django/6.1/topics/i18n/timezones.html
データベース関数 14212
データベース関数 The classes documented below provide a way for users to use functions provided by the underlying database as annotations, aggregations, or filters in Django. Functions are also expressions , so they can be used and combined ... 、明示的に正しいデータベース型にキャストされない限り、不正な型に変換される可能性があります: >>> from django.db.models import DateTimeField >>> from django.db.models.functions import Cast , Coalesce >>> from django.utils import timezone >>> now = timezone . ... now () >>> Coalesce ( "updated" , Cast ( now , DateTimeField ())) Collate class Collate ( expression , collation ) [ソース] クエリに使用する式と照合順序名 (collation name) を指定 ... するとデータベースエラーになります。 使用例: class Blog ( models . Model ): body = models . TextField () modified = models . DateTimeField ( auto_now = True ) class Comment ( models . Model ): body = models . TextField () modified = models . DateTimeField ...
https://man.mtool.work/django/6.1/ref/models/database-functions.html
フォーム フィールド 9363
フォーム フィールド class Field [ソース] Form クラスを作成時の一番重要な部分は、form のフィールド (field) の定義です。各フィールドにはカスタムの検証ロジックがあり、他にいくつかのフックもあります。 Field. clean ( value ) [ソース] Field クラス ... ed.'], 'name': ['This field is required.']} 定数の代わりに、任意の呼び出し可能オブジェクトを渡すこともできます: >>> import datetime >>> class DateForm ( forms . Form ): ... day = forms . DateField ( initial = datetime . date . today ) ... >>> print ( Dat ... DateField class DateField ( ** kwargs ) [ソース] デフォルトのウィジェット: DateInput 空の値: None 正規化後の値: Python の datetime.date オブジェクトになります。 与えられた値が datetime.date 、 datetime.datetime または特定の日付の表示形式のどれかに当ては ... まるか検証します。 エラーメッセージのキー: required 、 invalid 1 つの省略可能な引数を取ります: input_formats 文字列を有効な datetime.date オブジェクトに変換しようとする際に使用されるフォーマットのイテラブル。 input_formats 引数が指定されていない場合、デフ ...
https://man.mtool.work/django/6.1/ref/forms/fields.html
ビューを記述する 9044
ビューを記述する ビュー関数、つまり view は、Web リクエストを受け取って Web レスポンスを返すPython 関数です。 このレスポンスは、WebページのHTMLコンテンツ、リダイレクトや404エラー、またはXMLドキュメントやイメージ、その他何にでもなり得ます (本 ... プルなビュー 以下は、HTML ドキュメントとして、現在の日付と時刻を返すビューです: from django.http import HttpResponse import datetime def current_datetime ( request ): now = datetime . datetime . now () html = '<html lang="en"><body>It is now %s .</body></ ... html>' % now return HttpResponse ( html ) 1 行ずつコードを見ていきましょう: 最初に、Python の datetime ライブラリ とともに、クラス HttpResponse を django.http モジュールからインポートします。 次に、 current_datetime という関数 ... ビュー関数の名前は重要ではありません; Django が識別するために特別な方法で名前を付ける必要はありません。ここでは、 current_datetime という名前はその機能を的確に表しているので、ビュー関数を current_datetime と呼ぶことにします。 このビューは、生成されたレス ...
https://man.mtool.work/django/6.1/topics/http/views.html
ファイルストレージ API 8502
ファイルストレージ API デフォルトのストレージクラスの取得 Djangoでは、デフォルトストレージクラスにアクセスするための便利な方法を提供しています。 storages STORAGES で定義されたエイリアスを使用してストレージインスタンスを取得できる、辞書ライク ... するフラグです。デフォルトは False です。 get_created_time ( name ) [ソース] システムの ctime、つまり os.path.getctime() の datetime を返します。一部のシステム(例えば Unix)では、これは最後のメタデータ変更の時間ですが、他のシステム(例えば Windows)では、ファ ... のストレージシステムが継承または必要に応じてオーバーライドできる一連のデフォルト動作を提供します。 注釈 メソッドが naive な datetime オブジェクトを返す場合、実際に使用されるタイムゾーンは os.environ['TZ'] の現在の値になります。これは通常、Djangoの TIME_ZO ... トレージシステム内ですでに存在する場合、 True を返します。 get_accessed_time ( name ) [ソース] ファイルの最終アクセス時刻を datetime で返します。最終アクセス時刻を返すことができないストレージシステムの場合は NotImplementedError を発生させます。 USE_TZ が ...
https://man.mtool.work/django/6.1/ref/files/storage.html
Django ユーティリティ (django.utils) 8335
Django ユーティリティ ( django.utils ) このドキュメントは、 django.utils のすべての安定したモジュールを対象としています。 django.utils 内のほとんどのモジュールは内部使用を目的としていることから、 内部リリース非推奨ポリシー に従い、以下に記載 ... 義された関数は、以下の特性を共有しています: ISO 8601 日付/時刻形式の文字列(またはそれに近い代替形式)を受け付け、Python の datetime モジュールにある対応するクラスからオブジェクトを返します。 入力が適切にフォーマットされているが、有効な日付や時刻ではない場 ... で受け付けますが、Pythonがサポートしているマイクロ秒単位に切り捨てられます。 parse_date ( value ) [ソース] 文字列を解析し、 datetime.date を返します。 parse_time ( value ) [ソース] 文字列を解析し、 datetime.time を返します。 UTC オフセットはサポートされて ... いません; もし value がそれを記述している場合、結果は None です。 parse_datetime ( value ) [ソース] 文字列を解析し、 datetime.datetime を返します。 UTC オフセットに対応しています。もし value がそれを記述 ...
https://man.mtool.work/django/6.1/ref/utils.html
モデルフィールドリファレンス 8113
モデルフィールドリファレンス このドキュメントには、Django が提供するフィールドオプション field options とフィールド型 field types を含む、 Field のすべての API リファレンスが記載されています。 注釈 フィールドは django.db.models.fields に定義 ... であれば、 Choices と必要な具象データ型、例えば date を DateField で使用するようにサブクラス化できます: class MoonLandings ( datetime . date , models . Choices ): APOLLO_11 = 1969 , 7 , 20 , "Apollo 11 (Eagle)" APOLLO_12 = 1969 , 11 , 19 , "Apollo 12 (Intr ... ような、データベースに直接アクセスできる人のために、フィールドをドキュメント化するのに便利です。例えば: pub_date = models . DateTimeField ( db_comment = "Date and time when the article was published" , ) db_default Field. db_default データベースによって計 ... 算されるこのフィールドのデフォルト値。これはリテラル値でも、 Now のようなデータベース関数でも構いません: created = models . DateTimeField ( db_default = Now ()) リテラルやデータベース関数から構成する限り、より複雑な式を使用できます: month_due = models . D ...
https://man.mtool.work/django/6.1/ref/models/fields.html
配信 (syndication) フィード フレームワーク 7627
配信 (syndication) フィード フレームワーク Django には、 RSS と Atom フィードを作成するための高レベルな配信 (syndication) フィード生成フレームワークが付属しています。 任意の配信フィードを作成するには、短い Python クラスを書くだけで済みます。 ... hook that specifies how to get the pubdate for a given item. # In each case, the method/attribute should return a Python # datetime.datetime object. def item_pubdate ( self , item ): """ Takes an item, as returned by items(), and returns the item's pubda ... te. """ def item_pubdate ( self ): """ Returns the pubdate for every item in the feed. """ item_pubdate = datetime . datetime ( 2005 , 5 , 3 ) # Hard-coded pubdate. # ITEM UPDATED -- It's optional to use one of these three. This is a # h ... that specifies how to get the updateddate for a given item. # In each case, the method/attribute should return a Python # datetime.datetime object. def item_updateddate ( self , item ): """ Takes an item, as returned by items(), and returns the item's u ...
https://man.mtool.work/django/6.1/ref/contrib/syndication.html
Porting your apps from Django 0.96 to 1.0 7627
Porting your apps from Django 0.96 to 1.0 Django 1.0 breaks compatibility with 0.96 in some areas. This guide will help you port 0.96 projects and apps to 1.0. The first part of this document includes the common changes needed to run with 1 ... ield values and query arguments can both be callable objects, so instances of LazyDate can be replaced with a reference to datetime.datetime.now : Old (0.96): class Article ( models . Model ): title = models . CharField ( maxlength = 100 ) published = mo ... dels . DateField ( default = LazyDate ()) New (1.0): import datetime class Article ( models . Model ): title = models . CharField ( max_length = 100 ) published = models . DateField ( default ... = datetime . datetime . now ) DecimalField is new, and FloatField is now a proper float Old (0.96): class MyModel ( models . Model ): ...
https://man.mtool.work/django/6.1/releases/1.0-porting-guide.html
Django 1.4.9 リリースノート 7571
Django 1.4.9 リリースノート October 23, 2013 Django 1.4.9 fixes a security-related bug in the 1.4 series and one other data corruption bug. Readdressed denial-of-service via password hashers Django 1.4.8 imposes a 4096-byte limit on passwor ... d the speed of our PBKDF2 algorithm by not rehashing the key on every iteration. バグ修正 Fixed a data corruption bug with datetime_safe.datetime.combine (#21256). ...
https://man.mtool.work/django/6.1/releases/1.4.9.html
PREV 1 2 3 4 5 6 7 8 NEXT