per page, with , order by , clip by
Results of 1 - 3 of about 3 for TestModel (0.007 sec.)
PostgreSQL 固有の集計関数 11775
PostgreSQL 固有の集計関数 これらの機能は、 django.contrib.postgres.aggregates モジュールから利用可能です。これらについての詳細は、 PostgreSQLドキュメント に記載されています。 注釈 すべての関数はデフォルトのエイリアスを持たないので、明示的に ... -|--------|--------| | foo | 1 | 13 | | bar | 2 | (null) | | test | 3 | 13 | 汎用的な集計関数の例をいくつか紹介します: >>> TestModel . objects . aggregate ( result = StringAgg ( "field1" , delimiter = ";" )) {'result': 'foo;bar;test'} >>> TestModel . obje ... cts . aggregate ( result = ArrayAgg ( "field2" )) {'result': [1, 2, 3]} >>> TestModel . objects . aggregate ( result = ArrayAgg ( "field1" )) {'result': ['foo', 'bar', 'test']} 次の例では、統計的集計関数の使い ... 方を示します。基礎となる数学については説明しません (たとえば、 wikipedia で読むことができます): >>> TestModel . objects . aggregate ( count = RegrCount ( y = "field3" , x = "field2" )) {'count': 2} >>> TestModel . objects . aggregat ...
https://man.mtool.work/django/6.1/ref/contrib/postgres/aggregates.html
テストツール 8798
テストツール Django は、テストを書くのに便利なツールをいくつか提供しています。 There are community-maintained solutions! Django has a vibrant ecosystem. There are testing and fixtures solutions highlighted on the Community Ecosystem page. T ... solate_apps class MyModelTests ( SimpleTestCase ): @isolate_apps ( "app_label" ) def test_model_definition ( self ): class TestModel ( models . Model ): pass ... あるいは、次のようにします。 with isolate_apps ( "app_label" ): class TestModel ( models . Mo ... 使用する際に attr_name パラメータを使用して属性として取得できます。 @isolate_apps ( "app_label" , attr_name = "apps" ) class TestModelDefinition ( SimpleTestCase ): def test_model_definition ( self ): class TestModel ( models . Model ): pass self . assertIs ... ( self . apps . get_model ( "app_label" , "TestModel" ), TestModel ) あるいは、 kwarg_name パラメータを使ってメソッドデコレータとして使用する際に、 テストメソッドの引数として指 ...
https://man.mtool.work/django/6.1/topics/testing/tools.html
Unit tests 7310
Unit tests Django comes with a test suite of its own, in the tests directory of the code base. It's our policy to make sure all tests pass at all times. We appreciate any and all contributions to the test suite! The Django tests all use the ... ator: from django.db import models from django.test import SimpleTestCase from django.test.utils import isolate_apps class TestModelDefinition ( SimpleTestCase ): @isolate_apps ( "app_label" ) def test_model_definition ( self ): class TestModel ( models . ... ts.py from django.db import models from django.test import SimpleTestCase from django.test.utils import isolate_apps class TestModelDefinition ( SimpleTestCase ): @isolate_apps ( "app_label" , "other_app_label" ) def test_model_definition ( self ): # This ... model automatically receives app_label='app_label' class TestModel ( models . Model ): pass class OtherAppModel ( models . Model ): class Meta : app_label = "other_app_label" ... ...
https://man.mtool.work/django/6.1/internals/contributing/writing-code/unit-tests...
PREV 1 NEXT