WIP: feat: CRUD ListEvent #14

Draft
ivan.dev wants to merge 7 commits from VORKOUT-14 into master
3 changed files with 10 additions and 7 deletions
Showing only changes of commit 0bff556b10 - Show all commits

View File

@ -56,10 +56,11 @@ async def get_listevents_page_by_creator_id(connection: AsyncConnection, creator
# Здесь предполагается, что all_list_event_adapter.validate_python корректно обрабатывает данные
validated_list_event = all_list_event_adapter.validate_python(events_data)
return AllListEventResponse(list_event=validated_list_event, amount_count=total_count, amount_pages=total_pages)
return AllListEventResponse(list_event=validated_list_event, amount_count=total_count, amount_pages=total_pages, current_page=page,
limit = limit)
async def get_listevents_page(connection: AsyncConnection, page, limit) -> Optional[ListEvent]:
async def get_listevents_page(connection: AsyncConnection, page, limit) -> Optional[AllListEventResponse]:
"""
Получает список ползовелей заданных значениями page, limit.
"""
@ -94,7 +95,8 @@ async def get_listevents_page(connection: AsyncConnection, page, limit) -> Optio
# Здесь предполагается, что all_list_event_adapter.validate_python корректно обрабатывает данные
validated_list_event = all_list_event_adapter.validate_python(events_data)
return AllListEventResponse(list_event=validated_list_event, amount_count=total_count, amount_pages=total_pages)
return AllListEventResponse(list_event=validated_list_event, amount_count=total_count, amount_pages=total_pages,current_page=page,
limit = limit)
async def get_listevents_by_name(connection: AsyncConnection, name: str) -> Optional[ListEvent]:
"""
@ -142,7 +144,7 @@ async def get_listevents_by_id(connection: AsyncConnection, id: int) -> Optional
return ListEvent.model_validate(listevents_data)
ivan.dev marked this conversation as resolved
Review

Тоже returning type не соответствует

Тоже returning type не соответствует
async def update_listevents_by_id(connection: AsyncConnection, update_values, listevents) -> Optional[ListEvent]:
async def update_listevents_by_id(connection: AsyncConnection, update_values, listevents):
"""
Вносит изменеия в нужное поле таблицы account_table.
ivan.dev marked this conversation as resolved
Review

Тоже из другого метода описание

Тоже из другого метода описание
"""

View File

@ -108,8 +108,8 @@ async def create_list_events(
if listevents_validation is None:
await create_listevents(connection, listevents, user_validation.id)
user_new = await get_listevents_by_name(connection, listevents.name)
return user_new
listevents_new = await get_listevents_by_name(connection, listevents.name)
return listevents_new
else:
raise HTTPException(

View File

@ -32,6 +32,7 @@ class AllListEventResponse(Base):
list_event: List[AllListEvent]
amount_count: int
amount_pages: int
current_page: int
limit: int
all_list_event_adapter = TypeAdapter(List[AllListEvent])