コード例 #1
0
ファイル: test_indexes.py プロジェクト: funkybob/django
 def test_deconstruction(self):
     index = GinIndex(
         fields=['title'],
         name='test_title_gin',
         fastupdate=True,
         gin_pending_list_limit=128,
     )
     path, args, kwargs = index.deconstruct()
     self.assertEqual(path, 'django.contrib.postgres.indexes.GinIndex')
     self.assertEqual(args, ())
     self.assertEqual(kwargs, {
         'fields': ['title'],
         'name': 'test_title_gin',
         'fastupdate': True,
         'gin_pending_list_limit': 128,
     })
コード例 #2
0
ファイル: test_indexes.py プロジェクト: funkybob/django
 def test_partial_gin_index_with_tablespace(self):
     with register_lookup(CharField, Length):
         index_name = 'char_field_gin_partial_idx'
         index = GinIndex(
             fields=['field'],
             name=index_name,
             condition=Q(field__length=40),
             db_tablespace='pg_default',
         )
         with connection.schema_editor() as editor:
             editor.add_index(CharFieldModel, index)
             self.assertIn('TABLESPACE "pg_default" ', str(index.create_sql(CharFieldModel, editor)))
         constraints = self.get_constraints(CharFieldModel._meta.db_table)
         self.assertEqual(constraints[index_name]['type'], 'gin')
         with connection.schema_editor() as editor:
             editor.remove_index(CharFieldModel, index)
         self.assertNotIn(index_name, self.get_constraints(CharFieldModel._meta.db_table))
コード例 #3
0
ファイル: test_indexes.py プロジェクト: darkryder/django
 def test_name_auto_generation(self):
     index = GinIndex(fields=['field'])
     index.set_name_with_model(IntegerArrayModel)
     self.assertEqual(index.name, 'postgres_te_field_def2f8_gin')
コード例 #4
0
 class Meta:
     db_table = 'product'
     verbose_name = _('product')
     ordering = ['order']
     # https://www.postgresql.org/docs/10/gin-intro.html
     indexes = [GinIndex(fields=["ts"])]
コード例 #5
0
 class Meta(BaseOrderedConstantModel.Meta):
     indexes = [
         GinIndex(fields=['contexts']),
     ]
     ordering = ('lft', )
コード例 #6
0
 class Meta:
     ordering = ['order', 'pk']
     indexes = (GinIndex(fields=["search_vector"]), )
コード例 #7
0
ファイル: models.py プロジェクト: Yelinz/caluma
 class Meta:
     # a question may only be answerd once per document
     unique_together = ("document", "question")
     indexes = [models.Index(fields=["date"]), GinIndex(fields=["meta", "value"])]
コード例 #8
0
 class Meta(object):
     indexes = [GinIndex(fields=["search_vector"])]
コード例 #9
0
ファイル: models.py プロジェクト: rdmurphy/nyt-fec
 class Meta:
     indexes = [
         models.Index(fields=['fec_id']),
         models.Index(fields=['committee_name']),
         GinIndex(fields=['name_search']),
     ]
コード例 #10
0
 class Meta:
     indexes = [GinIndex(fields=['arguments'])]
     unique_together = (('ethereum_tx', 'log_index'), )
コード例 #11
0
 class Meta:
     ordering = ['-date']
     indexes = [GinIndex(fields=['title'])]
コード例 #12
0
ファイル: models.py プロジェクト: IgorChaikin/django-cinema
 class Meta:
     verbose_name = "Фильм"
     verbose_name_plural = "Фильмы"
     indexes = [GinIndex(fields=['title'])]
コード例 #13
0
 def test_repr(self):
     index = GinIndex(fields=['title'])
     self.assertEqual(repr(index), "<GinIndex: fields='title'>")
コード例 #14
0
 class Meta:
     indexes = [GinIndex(fields=['name'])]
コード例 #15
0
ファイル: models.py プロジェクト: artursaliyev/sputnic_new
 class Meta:
     ordering = ['date_get']
     indexes = [GinIndex(fields=['search_vector'])]
コード例 #16
0
 class Meta:
     ordering = ["-published_at"]
     indexes = [GinIndex(fields=["full_text_search"])]
コード例 #17
0
ファイル: models.py プロジェクト: rossnomann/dvhb-hybrid
 class Meta:
     abstract = True
     indexes = [GinIndex(fields=['oauth_info'])]
コード例 #18
0
ファイル: models.py プロジェクト: czosel/caluma
 class Meta:
     indexes = [
         GinIndex(fields=["addressed_groups"]),
         GinIndex(fields=["assigned_users"]),
     ]
コード例 #19
0
ファイル: models.py プロジェクト: rdmurphy/nyt-fec
 class Meta(Transaction.Meta):
     indexes = Transaction.Meta.indexes[:] #this is a deep copy to prevent the base model's fields from being overwritten
     indexes.extend([GinIndex(fields=['name_search']), GinIndex(fields=['purpose_search']), GinIndex(fields=['candidate_search'])])
コード例 #20
0
ファイル: models.py プロジェクト: horosin/mcod-backend
 class Meta:
     verbose_name = _("Tag")
     verbose_name_plural = _("Tags")
     db_table = 'tag'
     default_manager_name = "objects"
     indexes = [GinIndex(fields=["i18n"]), ]
コード例 #21
0
ファイル: bill.py プロジェクト: showerst/openstates-core
 class Meta:
     db_table = "opencivicdata_searchablebill"
     indexes = [GinIndex(name="search_index", fields=["search_vector"])]
コード例 #22
0
    class Meta:
        """Meta options for model."""

        indexes = [GinIndex(fields=['search_vector'])]
コード例 #23
0
ファイル: models.py プロジェクト: Yelinz/caluma
 class Meta:
     indexes = [GinIndex(fields=["meta"])]
コード例 #24
0
 class Meta:
     indexes = [
         GinIndex(fields=['search_vector']),
         models.Index(fields=['НомЛиц'])
     ]
コード例 #25
0
 class Meta(BaseConstantModel.Meta):
     indexes = [
         GinIndex(fields=['tags']),
     ]
コード例 #26
0
ファイル: test_indexes.py プロジェクト: jebcat1982/django-1
 def test_eq(self):
     index = GinIndex(fields=['title'])
     same_index = GinIndex(fields=['title'])
     another_index = GinIndex(fields=['author'])
     self.assertEqual(index, same_index)
     self.assertNotEqual(index, another_index)
コード例 #27
0
 class Meta:
     ordering = ['name']
     verbose_name_plural = 'BBSes'
     indexes = [
         GinIndex(fields=['search_document']),
     ]
コード例 #28
0
ファイル: test_indexes.py プロジェクト: jebcat1982/django-1
 def test_name_auto_generation(self):
     index = GinIndex(fields=['field'])
     index.set_name_with_model(IntegerArrayModel)
     self.assertEqual(index.name, 'postgres_te_field_def2f8_gin')
コード例 #29
0
ファイル: models.py プロジェクト: yahyrparedes/otorongo.club
 class Meta:
     unique_together = ['first_names', 'last_names']
     indexes = [GinIndex(fields=['full_search'], name='full_search_idx')]
コード例 #30
0
ファイル: test_indexes.py プロジェクト: jebcat1982/django-1
 def test_deconstruct_no_args(self):
     index = GinIndex(fields=['title'], name='test_title_gin')
     path, args, kwargs = index.deconstruct()
     self.assertEqual(path, 'django.contrib.postgres.indexes.GinIndex')
     self.assertEqual(args, ())
     self.assertEqual(kwargs, {'fields': ['title'], 'name': 'test_title_gin'})
コード例 #31
0
ファイル: test_indexes.py プロジェクト: darkryder/django
 def test_deconstruction(self):
     index = GinIndex(fields=['title'], name='test_title_gin')
     path, args, kwargs = index.deconstruct()
     self.assertEqual(path, 'django.contrib.postgres.indexes.GinIndex')
     self.assertEqual(args, ())
     self.assertEqual(kwargs, {'fields': ['title'], 'name': 'test_title_gin'})
コード例 #32
0
 class Meta:
     indexes = [GinIndex(fields=['search_vector'])]
コード例 #33
0
ファイル: models.py プロジェクト: frranck/demozoo
 class Meta:
     verbose_name_plural = "Parties"
     ordering = ("name", )
     indexes = [
         GinIndex(fields=['search_document']),
     ]
コード例 #34
0
ファイル: models.py プロジェクト: LK4268/Inboxen
 class Meta:
     indexes = [GinIndex(fields=["search_tsv"])]