Rename orm module to om

This commit is contained in:
Andrew Brookins 2021-10-19 15:06:57 -07:00
parent 62240723ca
commit 2bd71ff087
7 changed files with 11 additions and 15 deletions

View file

@ -1,5 +1,5 @@
import click
from redis_developer.om.migrations.migrator import Migrator
from redis_developer.model.migrations.migrator import Migrator
@click.command()

View file

@ -7,7 +7,7 @@ from typing import Optional
from redis import ResponseError
from redis_developer.connections import get_redis_connection
from redis_developer.om.model import model_registry
from redis_developer.model.model import model_registry
redis = get_redis_connection()
log = logging.getLogger(__name__)

View file

@ -1,7 +1,7 @@
import abc
from typing import Optional
from redis_developer.om.model import JsonModel, HashModel
from redis_developer.model.model import JsonModel, HashModel
class BaseJsonModel(JsonModel, abc.ABC):

View file

@ -1,7 +1,7 @@
from collections import Sequence
from typing import Any, Dict, Mapping, Union, List
from redis_developer.om.model import Expression
from redis_developer.model.model import Expression
class LogicalOperatorForListOfExpressions(Expression):

View file

@ -2,7 +2,7 @@ import pytest
from redis import Redis
from redis_developer.connections import get_redis_connection
from redis_developer.orm.migrations.migrator import Migrator
from redis_developer.model.migrations.migrator import Migrator
@pytest.fixture(scope="module", autouse=True)

View file

@ -8,11 +8,11 @@ import pytest
import redis
from pydantic import ValidationError
from redis_developer.orm import (
from redis_developer.model import (
HashModel,
Field,
)
from redis_developer.orm.model import RedisModelError, QueryNotSupportedError, NotFoundError
from redis_developer.model.model import RedisModelError, QueryNotSupportedError, NotFoundError
r = redis.Redis()
today = datetime.date.today()

View file

@ -8,12 +8,13 @@ import pytest
import redis
from pydantic import ValidationError
from redis_developer.orm import (
from redis_developer.model import (
EmbeddedJsonModel,
JsonModel,
Field,
)
from redis_developer.orm.migrations.migrator import Migrator
from redis_developer.orm.model import QueryNotSupportedError, NotFoundError, RedisModelError
from redis_developer.model.migrations.migrator import Migrator
from redis_developer.model.model import QueryNotSupportedError, NotFoundError, RedisModelError
r = redis.Redis()
today = datetime.date.today()
@ -24,11 +25,6 @@ class BaseJsonModel(JsonModel, abc.ABC):
global_key_prefix = "redis-developer"
class EmbeddedJsonModel(BaseJsonModel, abc.ABC):
class Meta:
embedded = True
class Note(EmbeddedJsonModel):
# TODO: This was going to be a full-text search example, but
# we can't index embedded documents for full-text search in