add latitude and longitude
This commit is contained in:
parent
6edc87fb1d
commit
fb302ca63e
@ -7,6 +7,8 @@ class Event(BaseModel):
|
|||||||
name: str
|
name: str
|
||||||
place: str
|
place: str
|
||||||
status: int = 0
|
status: int = 0
|
||||||
|
latitude: float = 0.0
|
||||||
|
longitude: float = 0.0
|
||||||
organizers: list[str] = []
|
organizers: list[str] = []
|
||||||
start_date: datetime | None = None
|
start_date: datetime | None = None
|
||||||
end_date: datetime | None = None
|
end_date: datetime | None = None
|
||||||
@ -30,6 +32,8 @@ class EventIn(BaseModel):
|
|||||||
organizers: list[str] = []
|
organizers: list[str] = []
|
||||||
start_date: datetime | None = None
|
start_date: datetime | None = None
|
||||||
end_date: datetime | None = None
|
end_date: datetime | None = None
|
||||||
|
latitude: float = 0.0
|
||||||
|
longitude: float = 0.0
|
||||||
|
|
||||||
class EventIDS(BaseModel):
|
class EventIDS(BaseModel):
|
||||||
ids: list[str]
|
ids: list[str]
|
||||||
|
@ -132,6 +132,8 @@ async def update_events_me(item_id: str, current_user: Annotated[users.User, Dep
|
|||||||
event.place = EventSingle.place
|
event.place = EventSingle.place
|
||||||
event.start_date = eventSingle.start_date
|
event.start_date = eventSingle.start_date
|
||||||
event.end_date = eventSingle.end_date
|
event.end_date = eventSingle.end_date
|
||||||
|
event.latitude = eventSingle.latitude
|
||||||
|
event.longitude = eventSingle.longitude
|
||||||
event.updated_at = datetime.today()
|
event.updated_at = datetime.today()
|
||||||
event_repository.save(event)
|
event_repository.save(event)
|
||||||
content = {"message": "event is updated"}
|
content = {"message": "event is updated"}
|
||||||
@ -159,6 +161,8 @@ async def update_events(authorize: Annotated[bool, Depends(permissions_checker.P
|
|||||||
event.start_date = eventSingle.start_date
|
event.start_date = eventSingle.start_date
|
||||||
event.end_date = eventSingle.end_date
|
event.end_date = eventSingle.end_date
|
||||||
event.organizers = eventSingle.organizers
|
event.organizers = eventSingle.organizers
|
||||||
|
event.latitude = eventSingle.latitude
|
||||||
|
event.longitude = eventSingle.longitude
|
||||||
event.created_at = datetime.today()
|
event.created_at = datetime.today()
|
||||||
event_repository.save(event)
|
event_repository.save(event)
|
||||||
content = {"message": "event is created"}
|
content = {"message": "event is created"}
|
||||||
@ -187,6 +191,8 @@ async def update_events_id(item_id: str, authorize: Annotated[bool, Depends(perm
|
|||||||
event.start_date = eventSingle.start_date
|
event.start_date = eventSingle.start_date
|
||||||
event.end_date = eventSingle.end_date
|
event.end_date = eventSingle.end_date
|
||||||
event.organizers = eventSingle.organizers
|
event.organizers = eventSingle.organizers
|
||||||
|
event.latitude = eventSingle.latitude
|
||||||
|
event.longitude = eventSingle.longitude
|
||||||
event.updated_at = datetime.today()
|
event.updated_at = datetime.today()
|
||||||
event_repository.save(event)
|
event_repository.save(event)
|
||||||
content = {"message": "event is updated"}
|
content = {"message": "event is updated"}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user