Rename in category table: model_type to geom_type

This commit is contained in:
phil 2023-12-26 18:42:40 +05:30
parent b772e1bd80
commit c0c308a657
5 changed files with 16 additions and 15 deletions

View file

@ -60,7 +60,7 @@ class CategoryBase(BaseModel):
status: str = Field(min_length=1, max_length=1)
custom: bool | None
auto_import: bool = True
model_type: str = Field(max_length=50,
geom_type: str = Field(max_length=50,
foreign_key='category_model_type.name',
default='Point')
long_name: str | None = Field(max_length=50)
@ -108,7 +108,7 @@ class CategoryBase(BaseModel):
@computed_field
@property
def mapbox_type(self) -> str:
return self.mapbox_type_custom or mapbox_type_mapping[self.model_type]
return self.mapbox_type_custom or mapbox_type_mapping[self.geom_type]
class Category(CategoryBase, table=True):

View file

@ -140,7 +140,7 @@ class SurveyModel(BaseSurveyModel):
Base mixin class for defining final (reprojected) survey data, with a status
"""
metadata: ClassVar[MetaData] = survey
status: str = Field(sa_type=String(1))
status: ClassVar[str] = Field(sa_type=String(1))
get_gdf_with_related: ClassVar[bool] = False
@ -334,10 +334,10 @@ class GeoModel(Model):
Style for the model, used in the map, etc
"""
status: ClassVar[str] = 'E'
"""
Status (ISO layers definition) of the layer. E -> Existing.
"""
# status: ClassVar[str] = 'E'
# """
# Status (ISO layers definition) of the layer. E -> Existing.
# """
_join_with: ClassVar[dict[str, Any]] = {
}
@ -751,6 +751,7 @@ class GeoModel(Model):
return Path(conf.attachments['base_dir'])/cls.get_attachment_dir()
class LiveGeoModel(GeoModel):
status: ClassVar[str] = 'E'
store: ClassVar[str]
group: ClassVar[str] ='Live'
custom: ClassVar[bool] = True

View file

@ -28,7 +28,7 @@ class Store(BaseModel):
minor_group_1: str
minor_group_2: str
#model: GeoModel
model_type: str
geom_type: str
name: str
#name_letter: str
#name_number: int