Compare commits

..

No commits in common. "f8805aa60b26bcfa22a7cdc923b69c9184b5e472" and "9574ce5aebeedfbb5c29183d10a93f55fb841d39" have entirely different histories.

2 changed files with 19 additions and 4 deletions

View File

@ -6,6 +6,9 @@ class Event(BaseModel):
id: ObjectIdField = None
name: str
place: str
zip_code: str
city: str
country: str
description: str
imgUrl: str | None = None
status: int = 0
@ -24,6 +27,9 @@ class EventOut(BaseModel):
id: ObjectIdField = None
name: str
place: str
zip_code: str
city: str
country: str
description: str
imgUrl: str | None = None
status: int = 0
@ -34,6 +40,9 @@ class EventOut(BaseModel):
class EventIn(BaseModel):
name: str
place: str
zip_code: str
city: str
country: str
description: str
imgUrl: str | None = None
status: int = 0

View File

@ -36,7 +36,7 @@ async def read_events(authorize: Annotated[bool, Depends(permissions_checker.Per
for event_index in event_repository.find_by(object_search, limit=limit, skip=skip):
event = events.EventOut(id=event_index.id, tags=event_index.tags, imgUrl=event_index.imgUrl, name=event_index.name, description=event_index.description, place=event_index.place, status=event_index.status, start_date=event_index.start_date, end_date=event_index.end_date)
event = events.EventOut(id=event_index.id, tags=event_index.tags, imgUrl=event_index.imgUrl, name=event_index.name, description=event_index.description, place=event_index.place, zip_code=event_index.zip_code, city=event_index.city, country=event_index.country, status=event_index.status, start_date=event_index.start_date, end_date=event_index.end_date)
listEvents.append(event)
return listEvents
@ -110,7 +110,7 @@ async def search_events(authorize: Annotated[bool, Depends(permissions_checker.P
}
for event_index in event_repository.find_by(object_search, limit=limit, skip=skip):
event = events.EventOut(id=event_index.id, tags=event_index.tags, imgUrl=event_index.imgUrl, name=event_index.name, description=event_index.description, place=event_index.place, status=event_index.status, start_date=event_index.start_date, end_date=event_index.end_date)
event = events.EventOut(id=event_index.id, tags=event_index.tags, imgUrl=event_index.imgUrl, name=event_index.name, description=event_index.description, place=event_index.place, zip_code=event_index.zip_code, city=event_index.city, country=event_index.country, status=event_index.status, start_date=event_index.start_date, end_date=event_index.end_date)
listEvents.append(event)
return listEvents
@ -121,7 +121,7 @@ async def read_users_me(current_user: Annotated[users.User, Depends(users_token.
listOrganizers = []
for event_index in event_repository.find_by({"organizers":{"$eq": current_user.username}}, limit=limit, skip=skip):
event = events.EventOut(id=event_index.id, name=event_index.name, tags=event_index.tags, imgUrl=event_index.imgUrl, description=event_index.description, place=event_index.place, status=event_index.status, start_date=event_index.start_date, end_date=event_index.end_date)
event = events.EventOut(id=event_index.id, name=event_index.name, tags=event_index.tags, imgUrl=event_index.imgUrl, description=event_index.description, place=event_index.place, zip_code=event_index.zip_code, city=event_index.city, country=event_index.country, status=event_index.status, start_date=event_index.start_date, end_date=event_index.end_date)
listOrganizers.append(event)
content = {"organizers":listOrganizers}
@ -206,6 +206,9 @@ async def update_events_me(item_id: str, current_user: Annotated[users.User, Dep
event.name = eventSingle.name
event.description = eventSingle.description
event.place = eventSingle.place
event.zip_code = eventSingle.zip_code
event.city = eventSingle.city
event.country = eventSingle.country
event.start_date = eventSingle.start_date
event.tags = eventSingle.tags
event.end_date = eventSingle.end_date
@ -235,7 +238,7 @@ async def update_events(authorize: Annotated[bool, Depends(permissions_checker.P
)
event = events.Event(name=eventSingle.name, description=eventSingle.description, place=eventSingle.place)
event = events.Event(name=eventSingle.name, description=eventSingle.description, place=eventSingle.place, zip_code=eventSingle.zip_code, city=eventSingle.city, country=eventSingle.country)
event.start_date = eventSingle.start_date
event.end_date = eventSingle.end_date
event.organizers = eventSingle.organizers
@ -270,6 +273,9 @@ async def update_events_id(item_id: str, authorize: Annotated[bool, Depends(perm
event.name = eventSingle.name
event.place = eventSingle.place
event.description = eventSingle.description
event.zip_code = eventSingle.zip_code
event.city = eventSingle.city
event.country = eventSingle.country
event.start_date = eventSingle.start_date
event.end_date = eventSingle.end_date
event.organizers = eventSingle.organizers