@@ -27,12 +27,13 @@ class EgsimDbModel(DjangoDbModel):
2727 _meta : Options # https://docs.djangoproject.com/en/stable/ref/models/options/
2828
2929 name = TextField (null = False , unique = True , help_text = "Unique name" )
30- hidden = BooleanField (default = False , null = False ,
31- help_text = "Hide this item, i.e. make it publicly "
32- "unavailable to the whole API. This field "
33- "is intended to hide/show items quickly from "
34- "the admin panel without executing management "
35- "scrips" )
30+ hidden = BooleanField (
31+ default = False ,
32+ null = False ,
33+ help_text = "Hide this item, i.e. make it publicly unavailable to the whole API. "
34+ "This field is intended to hide/show items quickly without re-creating "
35+ "the DB data"
36+ )
3637
3738 class Meta :
3839 abstract = True
@@ -70,23 +71,29 @@ class Gsim(EgsimDbModel):
7071 is populated with valid OpenQuake models only (`passing valid.gsim` or not
7172 deprecated)
7273 """
73- imts = TextField (null = False ,
74- help_text = 'The intensity measure types '
75- 'defined for the model, space separated '
76- '(e.g.: "PGA SA")' )
77- min_sa_period = FloatField (null = True ,
78- help_text = 'The minimum SA period supported '
79- 'by the model, or None (no lower limit)' )
80- max_sa_period = FloatField (null = True ,
81- help_text = 'The maximum SA period supported '
82- 'by the model, or None (no upper limit)' )
74+ imts = TextField (
75+ null = False ,
76+ help_text = 'The intensity measure types defined for the model, '
77+ 'space separated (e.g.: "PGA SA")'
78+ )
79+ min_sa_period = FloatField (
80+ null = True ,
81+ help_text = 'The minimum SA period supported by the model, or None (no lower limit)'
82+ )
83+ max_sa_period = FloatField (
84+ null = True ,
85+ help_text = 'The maximum SA period supported by the model, or None (no upper limit)'
86+ )
8387
8488 unverified = BooleanField (default = False , help_text = "not independently verified" )
85- experimental = BooleanField (default = False , help_text = "experimental: may "
86- "change in future versions" )
87- adapted = BooleanField (default = False , help_text = "not intended for general use: "
88- "the behaviour may not be "
89- "as expected" )
89+ experimental = BooleanField (
90+ default = False ,
91+ help_text = "experimental: may change in future versions"
92+ )
93+ adapted = BooleanField (
94+ default = False ,
95+ help_text = "not intended for general use: the behaviour may not be as expected"
96+ )
9097 # Note: `superseded_by` is not used (we do not save deprecated Gsims)
9198
9299
@@ -98,8 +105,11 @@ class Reference(DjangoDbModel):
98105 display_name = TextField (default = None , null = True )
99106 url = URLField (default = None , null = True )
100107 license = TextField (default = None , null = True )
101- citation = TextField (default = None , null = True ,
102- help_text = "Bibliographic citation, as text" )
108+ citation = TextField (
109+ default = None ,
110+ null = True ,
111+ help_text = "Bibliographic citation, as text"
112+ )
103113 doi = TextField (default = None , null = True )
104114
105115 class Meta :
@@ -109,9 +119,12 @@ class Meta:
109119class MediaFile (EgsimDbModel ):
110120 """Abstract class handling any data file in the MEDIA directory of eGSIM"""
111121 # for safety, do not store full file paths in the db (see `filepath` for details):
112- filepath = TextField (unique = True , null = False ,
113- help_text = "the file absolute path (usually within the "
114- "MEDIA_ROOT path defined in Django settings)" )
122+ filepath = TextField (
123+ unique = True ,
124+ null = False ,
125+ help_text = "the file absolute path (usually within the MEDIA_ROOT path "
126+ "defined in Django settings)"
127+ )
115128
116129 def read_from_filepath (self , ** kwargs ) -> Any :
117130 raise NotImplementedError ()
0 commit comments