feat: attr options and selects editing
This commit is contained in:
27
services/attr_option.py
Normal file
27
services/attr_option.py
Normal file
@ -0,0 +1,27 @@
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from models import AttributeOption
|
||||
from repositories import AttrOptionRepository
|
||||
from schemas.attr_option import (
|
||||
AttrOptionSchema,
|
||||
CreateAttrOptionRequest,
|
||||
UpdateAttrOptionRequest,
|
||||
)
|
||||
from services.mixins import ServiceCrudMixin
|
||||
|
||||
|
||||
class AttrOptionService(
|
||||
ServiceCrudMixin[
|
||||
AttributeOption,
|
||||
AttrOptionSchema,
|
||||
CreateAttrOptionRequest,
|
||||
UpdateAttrOptionRequest,
|
||||
]
|
||||
):
|
||||
schema_class = AttrOptionSchema
|
||||
entity_deleted_msg = "Опция успешно удалена"
|
||||
entity_updated_msg = "Опция успешно обновлена"
|
||||
entity_created_msg = "Опция успешно создана"
|
||||
|
||||
def __init__(self, session: AsyncSession):
|
||||
self.repository = AttrOptionRepository(session)
|
||||
Reference in New Issue
Block a user