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):