2021-09-16 02:41:45 +02:00
|
|
|
import abc
|
|
|
|
from typing import Optional
|
|
|
|
|
2021-10-20 22:01:46 +02:00
|
|
|
from redis_developer.model.model import HashModel, JsonModel
|
2021-09-16 02:41:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
class BaseJsonModel(JsonModel, abc.ABC):
|
|
|
|
class Meta:
|
|
|
|
global_key_prefix = "redis-developer"
|
|
|
|
|
|
|
|
|
|
|
|
class BaseHashModel(HashModel, abc.ABC):
|
|
|
|
class Meta:
|
|
|
|
global_key_prefix = "redis-developer"
|
|
|
|
|
|
|
|
|
|
|
|
# class AddressJson(BaseJsonModel):
|
|
|
|
# address_line_1: str
|
|
|
|
# address_line_2: Optional[str]
|
|
|
|
# city: str
|
|
|
|
# country: str
|
|
|
|
# postal_code: str
|
2021-10-20 22:01:46 +02:00
|
|
|
#
|
|
|
|
|
2021-09-16 02:41:45 +02:00
|
|
|
|
|
|
|
class AddressHash(BaseHashModel):
|
|
|
|
address_line_1: str
|
|
|
|
address_line_2: Optional[str]
|
|
|
|
city: str
|
|
|
|
country: str
|
|
|
|
postal_code: str
|