mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-28 20:13:45 +03:00
Added tests on
This commit is contained in:
parent
0dbfa8fff1
commit
084c218d2a
|
@ -51,7 +51,7 @@ class ClickHouseSyncUpdateReturningQuerySetMixin(UpdateReturningMixin):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
class ClickHouseSyncBulkUpdateManagerMixin(BulkUpdateManagerMixin):
|
class ClickHouseSyncBulkUpdateQuerySetMixin(BulkUpdateManagerMixin):
|
||||||
"""
|
"""
|
||||||
This mixin adopts methods of django-pg-bulk-update library
|
This mixin adopts methods of django-pg-bulk-update library
|
||||||
"""
|
"""
|
||||||
|
@ -110,17 +110,17 @@ if not getattr(UpdateReturningMixin, 'fake', False):
|
||||||
qs_bases.append(ClickHouseSyncUpdateReturningQuerySetMixin)
|
qs_bases.append(ClickHouseSyncUpdateReturningQuerySetMixin)
|
||||||
|
|
||||||
if not getattr(BulkUpdateManagerMixin, 'fake', False):
|
if not getattr(BulkUpdateManagerMixin, 'fake', False):
|
||||||
qs_bases.append(ClickHouseSyncBulkUpdateManagerMixin)
|
qs_bases.append(ClickHouseSyncBulkUpdateQuerySetMixin)
|
||||||
|
|
||||||
ClickHouseSyncModelQuerySet = type('ClickHouseSyncModelQuerySet', tuple(qs_bases), {})
|
ClickHouseSyncQuerySet = type('ClickHouseSyncModelQuerySet', tuple(qs_bases), {})
|
||||||
|
|
||||||
|
|
||||||
class ClickHouseSyncModelMixin:
|
class ClickHouseSyncManagerMixin:
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
return ClickHouseSyncModelQuerySet(model=self.model, using=self._db)
|
return ClickHouseSyncQuerySet(model=self.model, using=self._db)
|
||||||
|
|
||||||
|
|
||||||
class ClickHouseSyncModelManager(ClickHouseSyncModelMixin, DjangoManager):
|
class ClickHouseSyncManager(ClickHouseSyncManagerMixin, DjangoManager):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ class ClickHouseSyncModel(DjangoModel):
|
||||||
Base model for syncing data. Each django model synced with data must inherit this
|
Base model for syncing data. Each django model synced with data must inherit this
|
||||||
"""
|
"""
|
||||||
_clickhouse_sync_models = []
|
_clickhouse_sync_models = []
|
||||||
objects = ClickHouseSyncModelManager()
|
objects = ClickHouseSyncManager()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user