per page, with , order by , clip by
Results of 1 - 10 of about 38 for shortcuts (0.007 sec.)
Djangoにはじめて貢献する 16462
Djangoにはじめて貢献する はじめに コミュニティに少し貢献してみませんか? たとえばあなたは、Django のバグを見つけて修正してほしいと思っていたり、ちょっとした機能を追加したいと考えているかもしれません(ただし、新機能の提案は 新機能の提案方法 に ... 」に取り組みます。以下はその架空の詳細です。 チケット #99999 -- トーストを焼くようにする Django は、 toast を返す関数 django.shortcuts.make_toast() を提供しなければなりません。 これよりこの機能と関連するテストを実装します。 ブランチを作る 変更を加える前に、 ... オンでの例題に移りましょう。 チケット #99999 に対するテストの実装 このチケットを解決するために、 make_toast() 関数に django.shortcuts モジュールに追加します。まずはこの関数を使うためのテストを書いて、関数の出力が正しいことを確認しましょう。 Djangoの tests/ ... rtcuts/ フォルダへ移動して test_make_toast.py というファイルを新たに作ります。以下のコードを追加してください。 from django.shortcuts import make_toast from django.test import SimpleTestCase class MakeToastTests ( SimpleTestCase ): def test_make_toast ( se ...
https://man.mtool.work/django/6.1/intro/contributing.html
Django のショートカット関数 10582
Django のショートカット関数 django.shortcuts パッケージは、MVC の複数のレベルにまたがるヘルパー関数とクラスを集めたものです。言い換えれば、これらの関数やクラスは、便宜上、控えめな結合を取り入れます。 render() render ( request , template_nam ... マイズ例 次の例では、テンプレート myapp/index.html をMIMEタイプ application/xhtml+xml でレンダリングしてみます。 from django.shortcuts import render def my_view ( request ): # View code here... return render ( request , "myapp/index.html" , { "foo" : "bar" ... ブジェクトを渡すことで、そのオブジェクトの get_absolute_url() メソッドが呼び出され、リダイレクト URL を返します: from django.shortcuts import redirect def my_view ( request ): ... obj = MyModel . objects . get ( ... ) return redirect ( obj ) ビューの名前と、 ... elf ): return reverse ( "article-detail" , args = [ self . pk ]) views.py from django.http import JsonResponse from django.shortcuts import get_object_or_404 , resolve_url from .models import Article def article_api_view ( request , pk ): """Return metada ...
https://man.mtool.work/django/6.1/topics/http/shortcuts.html
"sites" フレームワーク 8711
"sites" フレームワーク Django にはオプションで "sites" フレームワークが付属しています。これは、オブジェクトや機能を特定の Web サイトに関連付けるためのフックで、 Django で動くサイトのドメイン名や "冗長な" 名前を保持する場所です。 1 つの Djan ... は、リクエストされたストーリーが 現在のサイトにあるかどうかをチェックします。以下のようになります: from django.contrib.sites.shortcuts import get_current_site def article_detail ( request , article_id ): try : a = Article . objects . get ( id = article_id , ... y change. The cleaner way of accomplishing the same thing is to check the current site's domain: from django.contrib.sites.shortcuts import get_current_site def my_view ( request ): current_site = get_current_site ( request ) if current_site . domain == " ... 使用して「ありがとうございます」通知を抽象化できます。 以下は、フォームハンドリングビューの例です: from django.contrib.sites.shortcuts import get_current_site from django.core.mail import send_mail def register_for_newsletter ( request ): # Check form value ...
https://man.mtool.work/django/6.1/ref/contrib/sites.html
Django の機能廃止のタイムライン 8349
Django の機能廃止のタイムライン このドキュメントは、 非推奨化ポリシー に従って、Django の様々なパーツが互換性を伴わない方法で変更または削除されるタイミングについて概説しています。各項目についての詳細は、多くの場合 2 つ前のバージョンのリリー ... release notes for more details on these changes. The django.db.backends.postgresql_psycopg2 module will be removed. django.shortcuts.render_to_response() will be removed. The DEFAULT_CONTENT_TYPE setting will be removed. HttpRequest.xreadlines() will be r ... ontext and Template respectively. The current_app parameter for the following function and classes will be removed: django.shortcuts.render() django.template.Context() django.template.RequestContext() django.template.response.TemplateResponse() The dictio ... nary and context_instance parameters for the following functions will be removed: django.shortcuts.render() django.shortcuts.render_to_response() django.template.loader.render_to_string() The dirs parameter for the follow ...
https://man.mtool.work/django/6.1/internals/deprecation.html
はじめての Django アプリ作成、その 3 8349
はじめての Django アプリ作成、その 3 このチュートリアルは チュートリアルその 2 の続きです。ここでは、引続き Web 投票アプリケーションの開発を例にして、公開用のインタフェース、ビュー(view) の作成を焦点に解説します。 困ったときは: このチュート ... ango はこのためのショートカットを提供します。これを使って index() ビューを書き換えてみましょう: polls/views.py from django.shortcuts import render from .models import Question def index ( request ): latest_question_list = Question . objects . order_by ( " ... された投票の質問文を表示するものです。ビューは次のようになります: polls/views.py from django.http import Http404 from django.shortcuts import render from .models import Question # ... def detail ( request , question_id ): try : question = Question . objects ... のショートカットを提供しています。ショートカットを使って、 detail() ビューを書き換えてみましょう: polls/views.py from django.shortcuts import get_object_or_404 , render from .models import Question # ... def detail ( request , question_id ): question = get_ ...
https://man.mtool.work/django/6.1/intro/tutorial03.html
Django 1.7 リリースノート 8349
Django 1.7 リリースノート September 2, 2014 Django 1.7 へようこそ! このリリースノートでは、 バージョン 1.7 の新機能 と、Django 1.6 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した ... , or prefetching the same relation multiple times with different querysets. See prefetch_related() for more details. Admin shortcuts support time zones The "today" and "now" shortcuts next to date and time input widgets in the admin are now operating in t ... or tuple to override TEMPLATE_DIRS : django.template.loader.get_template() django.template.loader.select_template() django.shortcuts.render() django.shortcuts.render_to_response() The time filter now accepts timezone-related format specifiers 'e' , 'O' , ... deprecated: RequestSite now lives in django.contrib.sites.requests . get_current_site() now lives in django.contrib.sites.shortcuts . declared_fieldsets attribute on ModelAdmin ModelAdmin.declared_fieldsets has been deprecated. Despite being a private AP ...
https://man.mtool.work/django/6.1/releases/1.7.html
Django 1.8 リリースノート 8349
Django 1.8 リリースノート April 1, 2015 Django 1.8 へようこそ! このリリースノートでは、 バージョン 1.8 の新機能 と、Django 1.7 以前からアップグレードする際に注意すべき、 後方互換性のない変更 について説明します。 非推奨サイクルが終了した機能 ... customizing the suffix on a per-field basis — previously it wasn't possible to override a form's label_suffix while using shortcuts such as {{ form.as_p }} in templates. SelectDateWidget now accepts an empty_label argument, which will override the top li ... llowing functions and classes will no longer accept a current_app parameter to set an URL namespace in Django 1.10: django.shortcuts.render() django.template.Context() django.template.RequestContext() django.template.response.TemplateResponse() Set reques ... ctions The following functions will no longer accept the dictionary and context_instance parameters in Django 1.10: django.shortcuts.render() django.shortcuts.render_to_response() django.template.loader.render_to_string() Use the context parameter instead ...
https://man.mtool.work/django/6.1/releases/1.8.html
Pythonモジュール索引 8239
Pythonモジュール索引 a | c | d | f | h | m | s | t | u | v a django.apps c django.conf django.conf.urls django.conf.urls.i18n django.contrib django.contrib.admin Django's admin site. django.contrib.admindocs Django's admin documentation gen ... ale Middleware to enable language selection based on the request. django.middleware.security Security middleware. s django.shortcuts Convenience shortcuts that span multiple levels of Django's MVC stack. t django.tasks Django's built-in background Task sy ...
https://man.mtool.work/django/6.1/py-modindex.html
はじめての Django アプリ作成、その 4 8113
はじめての Django アプリ作成、その 4 このチュートリアルは チュートリアルその 3 の続きです。ここでは、引き続きWeb投票アプリケーションの開発を例にして、簡単なフォー ム処理とコードの縮小化を中心に解説します。 困ったときは: このチュートリアルの ... さい: polls/views.py from django.db.models import F from django.http import HttpResponse , HttpResponseRedirect from django.shortcuts import get_object_or_404 , render from django.urls import reverse from .models import Choice , Question # ... def vote ( r ... 投票すると、 vote() ビューは質問の結果ページにリダイレクトします。このビューを書いてみましょう。 polls/views.py from django.shortcuts import get_object_or_404 , render def results ( request , question_id ): question = get_object_or_404 ( Question , pk = qu ... 次のように変更します: polls/views.py from django.db.models import F from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 , render from django.urls import reverse from django.views import generic from .models import Cho ...
https://man.mtool.work/django/6.1/intro/tutorial04.html
Django 1.10 リリースノート 8113
Django 1.10 リリースノート 2016年8月1日 Django 1.10 へようこそ! このリリースノートでは、 バージョン 1.10 の新機能 と、Django 1.9 以前からアップグレードする際に注意が必要な 後方互換性が失われた変更点 について説明します。私たちは、非推奨の期間 ... of Context and Template respectively. The current_app parameter for the following function and classes is removed: django.shortcuts.render() django.template.Context() django.template.RequestContext() django.template.response.TemplateResponse() The dictio ... nary and context_instance parameters for the following functions are removed: django.shortcuts.render() django.shortcuts.render_to_response() django.template.loader.render_to_string() The dirs parameter for the follow ... ing functions is removed: django.template.loader.get_template() django.template.loader.select_template() django.shortcuts.render() django.shortcuts.render_to_response() Session verification is enabled regardless of whether or not 'django.contri ...
https://man.mtool.work/django/6.1/releases/1.10.html
PREV 1 2 3 4 NEXT