@@ -13,13 +13,12 @@ class SourceLogicTree(models.Model):
13
13
def __str__ (self ):
14
14
return self .version
15
15
16
-
17
16
class SourceLogicTreeComponent (models .Model ):
18
17
tag = models .CharField (max_length = 50 )
19
18
notes = models .TextField (null = True , blank = True )
20
19
inversion_toshi_id = models .CharField (max_length = 50 , null = False )
21
20
background_toshi_id = models .CharField (max_length = 50 , null = True )
22
- tectonic_region = models .CharField (choices = TECTONIC_REGIONS .choices , null = False , max_length = 10 )
21
+ tectonic_region = models .CharField (choices = TECTONIC_REGIONS .choices , null = False , max_length = 10 )
23
22
group = models .CharField (choices = SLT_GROUP .choices , null = False , max_length = 10 )
24
23
25
24
def __str__ (self ):
@@ -43,6 +42,7 @@ class GMCMLogicTree(models.Model):
43
42
def __str__ (self ):
44
43
return self .version
45
44
45
+
46
46
class SeismicHazardModel (models .Model ):
47
47
version = models .CharField (max_length = 30 )
48
48
notes = models .TextField (null = True , blank = True )
@@ -55,3 +55,34 @@ class SeismicHazardModel(models.Model):
55
55
def __str__ (self ):
56
56
return self .version
57
57
58
+ class LocationList (models .Model ):
59
+ list_id = models .CharField (max_length = 10 )
60
+ notes = models .TextField (null = True , blank = True )
61
+ length = models .SmallIntegerField ()
62
+
63
+ def __str__ (self ):
64
+ return self .list_id
65
+
66
+
67
+ class HazardSolution (models .Model ):
68
+ solution_id = models .CharField (max_length = 50 , null = False )
69
+ created = models .DateTimeField (auto_now = False , auto_now_add = False )
70
+ vs30 = models .SmallIntegerField ()
71
+ notes = models .TextField (null = True , blank = True )
72
+ location_lists = models .ManyToManyField (
73
+ LocationList , related_name = 'hazard_solutions' )
74
+ slt_components = models .ManyToManyField (
75
+ SourceLogicTreeWeightedComponent ,
76
+ related_name = 'hazard_solutions' )
77
+
78
+
79
+ # class OpenquakeHazardTask(models.Model):
80
+ # general_task_id = models.CharField(max_length=50, null=False)
81
+ # date = models.DateField(auto_now=False, auto_now_add=False)
82
+ # config_info = models.TextField(null=True, blank=True)
83
+ # notes = models.TextField(null=True, blank=True)
84
+ # part_of = models.ForeignKey(
85
+ # SeismicHazardModel, related_name='hazard_tasks',null=True, blank=True, on_delete=models.SET_NULL)
86
+
87
+ # def __str__(self):
88
+ # return self.general_task_id
0 commit comments