per page, with , order by , clip by
Results of 1 - 10 of about 40 for timezone (0.007 sec.)
タイムゾーン 15649
タイムゾーン 概要 タイムゾーンのサポートが有効な場合、Django は日時情報をデータベースには UTC で保存し、内部ではタイムゾーンを意識した(aware な) datetime オブジェクトを使用します。フォームではそれをエンドユーザーのタイムゾーンに変換して表 ... ime オブジェクトを作成した場合も、aware となります。このモードでは、上の例は以下のようになります: from django.utils import timezone now = timezone . now () 警告 認識された datetime オブジェクトを扱うことは、必ずしも直感的ではありません。例えば、標準の da ... ださい。 注釈 Python の datetime.time オブジェクトは、 tzinfo 属性を持ちます。また PostgreSQL には、これに相当する time with time zone タイプがあります。ただし、PostgreSQL のドキュメントにあるとおり、このタイプは "不確かな有用性に導く特性を示しています"。 ... は timedelta 計算を通じて他の日時から作成されます。唯一アプリケーションのコード内でよく作成される datetime は現在の時刻で、 timezone.now() は自動的に適切な処理を行います。 デフォルトタイムゾーンとカレントタイムゾーン デフォルトタイムゾーン は、 TIME_ZONE ...
https://man.mtool.work/django/6.1/topics/i18n/timezones.html
Django ユーティリティ (django.utils) 10391
Django ユーティリティ ( django.utils ) このドキュメントは、 django.utils のすべての安定したモジュールを対象としています。 django.utils 内のほとんどのモジュールは内部使用を目的としていることから、 内部リリース非推奨ポリシー に従い、以下に記載 ... e.datetime を返します。 UTC オフセットに対応しています。もし value がそれを記述している場合、結果の tzinfo 属性は datetime.timezone インスタンスになります。 parse_duration ( value ) [ソース] 文字列を解析し、 datetime.timedelta を返します。 データは、 "DD ... 合は、 allow_unicode=True を渡します。例えば: >>> slugify ( "你好 World" , allow_unicode = True ) '你好-world' django.utils.timezone get_fixed_timezone ( offset ) [ソース] UTCからの固定オフセットを持つタイムゾーンを表す tzinfo インスタンスを返します。 off ... datetime.timedelta または整数の分数です。UTCより東のタイムゾーンには正の値を、西には負の値を使用してください。 get_default_timezone () [ソース] デフォルトのタイムゾーン を表す tzinfo インスタンスを返します。 get_default_timezone_name () [ソース] デフォル ...
https://man.mtool.work/django/6.1/ref/utils.html
はじめての Django アプリ作成、その 5 10110
はじめての Django アプリ作成、その 5 このチュートリアルは チュートリアル 4 の続きです。Web 投票アプリケーションが完成したので、今度は自動テストを作ってみましょう。 困ったときは: このチュートリアルの実行に問題がある場合は、FAQ の Getting Hel ... 確認してください。 /  $ python manage.py shell ...\> py manage.py shell >>> import datetime >>> from django.utils import timezone >>> # create a Question instance with pub_date 30 days in the future >>> future_question = Question ( pub_date = timezone ... ファイルに次のコードを書きます。 polls/tests.py import datetime from django.test import TestCase from django.utils import timezone from .models import Question class QuestionModelTests ( TestCase ): def test_was_published_recently_with_future_question ( ... self ): """ was_published_recently() returns False for questions whose pub_date is in the future. """ time = timezone . now () + datetime . timedelta ( days = 30 ) future_question = Question ( pub_date = time ) self . assertIs ( future_ques ...
https://man.mtool.work/django/6.1/intro/tutorial05.html
索引 9454
索引 記号 | _ | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | ア | イ | ク | コ | シ | ス | テ | ハ | ヒ | フ | メ | モ | ロ | 具 | 国 | 環 | 翻 | 表 | 言 | 長 記号 -- dbshell コマン ... delAdmin の属性) actions_on_top (ModelAdmin の属性) actions_selection_counter (ModelAdmin の属性) activate() (django.utils.timezone モジュール) (django.utils.translation モジュール) acycle_key() (backends.base.SessionBase のメソッド) add template filter ... (Field のメソッド) dbshell django-admin command dbshell コマンドラインオプション -- --database deactivate() (django.utils.timezone モジュール) (django.utils.translation モジュール) deactivate_all() (django.utils.translation モジュール) DEBUG setting deb ... o.utils.log module django.utils.module_loading module django.utils.safestring module django.utils.text module django.utils.timezone module django.utils.translation module django.views module django.views.decorators.cache module django.views.decorators.ca ...
https://man.mtool.work/django/6.1/genindex.html
ジェネリック表示ビュー (Generic display view) 8986
ジェネリック表示ビュー (Generic display view) 以下の2つのクラスベースのジェネリックビューは、データを表示 (display) するために設計されています。多くのプロジェクトで、これらは最もよく使われるビューです。 DetailView class django.views.generic ... ect() get_context_object_name() get_context_data() get() render_to_response() 例 myapp/views.py : from django.utils import timezone from django.views.generic.detail import DetailView from articles.models import Article class ArticleDetailView ( DetailVie ... Article def get_context_data ( self , ** kwargs ): context = super () . get_context_data ( ** kwargs ) context [ "now" ] = timezone . now () return context 例 myapp/urls.py : from django.urls import path from article.views import ArticleDetailView urlpat ... yset() get_context_object_name() get_context_data() get() render_to_response() Example views.py : from django.utils import timezone from django.views.generic.list import ListView from articles.models import Article class ArticleListView ( ListView ): mod ...
https://man.mtool.work/django/6.1/ref/class-based-views/generic-display.html
はじめての Django アプリ作成、その 2 8893
はじめての Django アプリ作成、その 2 このチュートリアルは チュートリアルその 1 の続きです。ここでは、データベースをセットアップして、最初のモデルを作成し、そして Django が自動的に生成してくれる管理サイトについて、簡単なイントロダクションをし ... # No questions are in the system yet. >>> Question . objects . all () <QuerySet []> # Create a new Question. # Support for time zones is enabled in the default settings file, so # Django expects a datetime with tzinfo for pub_date. Use timezone.now() # i ... nstead of datetime.datetime.now() and it will do the right thing. >>> from django.utils import timezone >>> q = Question ( question_text = "What's new?" , pub_date = timezone . now ()) # Save the object into the database. You ... にクラスメソッドを追加してみましょう: polls/models.py import datetime from django.db import models from django.utils import timezone class Question ( models . Model ): # ... def was_published_recently ( self ): return self . pub_date >= timezone . now () ...
https://man.mtool.work/django/6.1/intro/tutorial02.html
Django 4.0 リリースノート 8799
Django 4.0 リリースノート 2021年12月7日 Django 4.0 へようこそ! このリリースノートでは、 バージョン 4.0 の新機能 と、Django 3.2 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。また、 一部の機能を非推奨 とし ... 強く推奨 します。 The Django 3.2.x series is the last to support Python 3.6 and 3.7. Django 4.0 の新機能 zoneinfo default timezone implementation The Python standard library's zoneinfo is now the default timezone implementation in Django. This is the ne ... xt step in the migration from using pytz to using zoneinfo . Django 3.2 allowed the use of non- pytz time zones. Django 4.0 makes zoneinfo the default implementation. Support for pytz is now deprecated and will be removed in Django ... alongside Django if you are using Python 3.8. The move to zoneinfo should be largely transparent. Selection of the current timezone, conversion of datetime instances to the current timezone in forms and templates, as well as operations on aware datetimes ...
https://man.mtool.work/django/6.1/releases/4.0.html
データベース関数 8425
データベース関数 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 ... ngo.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 ... nt . objects . filter ( start_datetime__year = Extract ( "end_datetime" , "year" )) . count () 1 Extract() uses the active timezone When USE_TZ is True , Django saves values in UTC (or the connection's configured timezone). Since tzinfo defaults to TIME_ ... example demonstrates what happens when "Europe/Berlin" is active and how to adjust for this: >>> from django.utils import timezone >>> from datetime import UTC , datetime >>> from django.db.models.functions import ExtractHour >>> start = datetime ( 2015 ...
https://man.mtool.work/django/6.1/ref/models/database-functions.html
Django 1.4 リリースノート 8425
Django 1.4 リリースノート March 23, 2012 Django 1.4 へようこそ! These release notes cover the new features , as well as some backwards incompatible changes you'll want to be aware of when upgrading from Django 1.3 or older versions. We've a ... e've begun the deprecation process for some features . オーバービュー The biggest new feature in Django 1.4 is support for time zones when handling date/times. When enabled, this Django will store date/times in UTC, use timezone-aware objects internally, ... and translate them to users' local timezones for display. If you're upgrading an existing project to Django 1.4, switching to the timezone aware mode may take some ca ... mode disallows some rather sloppy behavior that used to be accepted. We encourage anyone who's upgrading to check out the timezone migration guide and the timezone FAQ for useful pointers. Other notable new features in Django 1.4 include: A number of OR ...
https://man.mtool.work/django/6.1/releases/1.4.html
Django 3.1 リリースノート 8050
Django 3.1 リリースノート August 4, 2020 Django 3.1 へようこそ! このリリースノートでは、 バージョン 3.1 の新機能 と、Django 3.0 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能 ... する for details. django.forms.DateTimeField now accepts dates in a subset of ISO 8601 datetime formats, including optional timezone, e.g. 2019-10-10T06:47 , 2019-10-10T06:47:23+04:00 , or 2019-10-10T06:47:23Z . The timezone will always be retained if pro ... vided, with timezone-aware datetimes being returned even when USE_TZ is False . Additionally, DateTimeField now uses DATE_INPUT_FORMATS in addi ... hlib.Path instead of os.path for building filesystem paths. The TIME_ZONE setting is now allowed on databases that support time zones. Backwards incompatible changes in 3.1 データベースバックエンド API このセクションでは、サードパーティのデータベースバッ ...
https://man.mtool.work/django/6.1/releases/3.1.html
PREV 1 2 3 4 NEXT