mirror of
https://github.com/carrotquest/django-clickhouse.git
synced 2024-11-25 02:23:45 +03:00
33 lines
805 B
Python
33 lines
805 B
Python
"""
|
|
This file contains sample models to use in tests
|
|
"""
|
|
from django.db import models
|
|
from django.db.models.manager import BaseManager
|
|
from django_pg_returning import UpdateReturningModel
|
|
|
|
from django_clickhouse.models import ClickHouseSyncModel, ClickHouseSyncQuerySet
|
|
|
|
|
|
class TestQuerySet(ClickHouseSyncQuerySet):
|
|
pass
|
|
|
|
|
|
class TestManager(BaseManager.from_queryset(TestQuerySet)):
|
|
pass
|
|
|
|
|
|
class TestModel(UpdateReturningModel, ClickHouseSyncModel):
|
|
objects = TestManager()
|
|
|
|
value = models.IntegerField()
|
|
created_date = models.DateField()
|
|
created = models.DateTimeField()
|
|
|
|
|
|
class SecondaryTestModel(UpdateReturningModel, ClickHouseSyncModel):
|
|
objects = TestManager()
|
|
|
|
value = models.IntegerField()
|
|
created_date = models.DateField()
|
|
created = models.DateTimeField()
|