Refactoring

This commit is contained in:
M1ha 2018-12-13 10:52:38 +05:00
parent 7e502ee8a8
commit 71e839167a
2 changed files with 4 additions and 1 deletions

View File

@ -56,6 +56,9 @@ class ClickHouseModel(with_metaclass(ClickHouseModelMeta, InfiModel)):
sync_database_alias = None
sync_lock_timeout = None
# This attribute is initialized in metaclass, as it must get model class as a parameter
objects = None # type: QuerySet
@classmethod
def objects_in(cls, database): # type: (Database) -> QuerySet
return QuerySet(cls, database)

View File

@ -13,7 +13,7 @@ class QuerySet(InfiQuerySet):
Basic QuerySet to use
"""
def __init__(self, model_cls, database=None): # type: (InfiModel, Optional[Database]) -> None
def __init__(self, model_cls, database=None): # type: (Type[InfiModel], Optional[Database]) -> None
super(QuerySet, self).__init__(model_cls, database)
self._db_alias = None