-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
61 lines (51 loc) · 1.21 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from typing import List, Optional
from pydantic import BaseModel, Field
from typing import Optional
from bson import ObjectId
from pydantic.networks import AnyUrl
class User(BaseModel):
UserID: str
Name: str
Email: str
OAuthToken: str
UserType: str
class GameArea(BaseModel):
coordinates: List[List[float]]
class Location(BaseModel):
type: str
coordinates: List[float]
class Game(BaseModel):
CacheID : str
GameID: str
OrganizerID: str
GameArea: GameArea
Status: str
WinnerID: Optional[int] = None
class Config:
allow_population_by_field_name = True
json_encoders = {
ObjectId: str
}
arbitrary_types_allowed = True
class Cache(BaseModel):
CacheID: int
GameID: int
Location: Location
Hint: str
FoundByUserID: Optional[int]
class Participation(BaseModel):
ParticipationID: str
UserID: str
GameID: int
JoinedDate: str
class CacheDiscovery(BaseModel):
DiscoveryID: int
CacheID: int
UserID: int
DiscoveryDate: str
ProofImage: str
class ImageStorage(BaseModel):
ImageID: int
RelatedID: int
ImagePath: str
ImageType: str