-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmodels.py
84 lines (62 loc) · 1.75 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
class Equipment:
"""
Tent, trailer, etc
"""
def __init__(self, category_id, subcategory_id, name):
self.category_id=category_id
self.subcategory_id = subcategory_id
self.name = name
def __repr__(self):
return self.name
class ResourceCategory:
"""
Campsite, yurt, etc
"""
def __init__(self, resource_id, name):
self.resource_id = resource_id
self.name = name
def __repr__(self):
return self.name
class Camp:
"""
A state park
"""
def __init__(self, map_id, resource_location_id, name):
self.map_id = map_id
self.resource_location_id = resource_location_id
self.name = name
def __repr__(self):
return self.name
class CampArea:
"""
section / "loop" of a park
"""
def __init__(self, map_id, name, description):
self.map_id = map_id
self.name = name
self.description = description
def __repr__(self):
return '%s: %s ' %(self.name,self.description)
class Site:
"""
Individual campsite, boat slip, etc
"""
def __init__(self, resource_id, name, description):
self.resource_id = resource_id
self.name = name
self.description = description
def __repr__(self):
if self.description:
return '%s (%s)'%(self.name,self.description)
else:
return self.name
class SiteAvailability:
"""
Can this site be reserved on a specific date
"""
def __init__(self, site, availability, allowed_equipment):
self.site = site
self.availability = availability
self.allowed_equipment = allowed_equipment
def __repr__(self):
return '%s: %s'%(self.site.name,self.availability)