2018-11-12 18:20:46 +03:00
|
|
|
"""
|
|
|
|
This file contains sample models to use in tests
|
|
|
|
"""
|
|
|
|
from django.db import models
|
2019-10-04 15:54:47 +03:00
|
|
|
from django.db.models.manager import BaseManager
|
2019-10-04 15:58:24 +03:00
|
|
|
from django_pg_returning import UpdateReturningModel
|
2018-11-12 18:20:46 +03:00
|
|
|
|
2019-10-04 15:54:47 +03:00
|
|
|
from django_clickhouse.models import ClickHouseSyncModel, ClickHouseSyncQuerySet
|
2018-11-15 11:02:05 +03:00
|
|
|
|
|
|
|
|
2019-10-04 15:54:47 +03:00
|
|
|
class TestQuerySet(ClickHouseSyncQuerySet):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class TestManager(BaseManager.from_queryset(TestQuerySet)):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class TestModel(UpdateReturningModel, ClickHouseSyncModel):
|
|
|
|
objects = TestManager()
|
|
|
|
|
2018-11-15 11:02:05 +03:00
|
|
|
value = models.IntegerField()
|
|
|
|
created_date = models.DateField()
|
2019-01-14 10:45:46 +03:00
|
|
|
created = models.DateTimeField()
|
2019-01-09 13:14:53 +03:00
|
|
|
|
|
|
|
|
2019-10-04 15:54:47 +03:00
|
|
|
class SecondaryTestModel(UpdateReturningModel, ClickHouseSyncModel):
|
|
|
|
objects = TestManager()
|
|
|
|
|
2019-01-09 13:14:53 +03:00
|
|
|
value = models.IntegerField()
|
|
|
|
created_date = models.DateField()
|
2019-01-14 10:45:46 +03:00
|
|
|
created = models.DateTimeField()
|