#49 Calculation implementation

* implements update routine for Geometry model
* reorganizes fields of Parcel and District
* adds tests
* simplifies usage of ParcelWFSFetcher
This commit is contained in:
2022-01-04 15:59:53 +01:00
parent b5cf18ac7d
commit 632fb0f48a
5 changed files with 95 additions and 35 deletions
+24 -16
View File
@@ -22,28 +22,30 @@ class Parcel(UuidModel):
To avoid conflicts due to german Umlaute, the field names are shortened and vocals are dropped.
"""
geometries = models.ManyToManyField("konova.Geometry", related_name="parcels", null=True, blank=True)
geometries = models.ManyToManyField("konova.Geometry", related_name="parcels", blank=True)
district = models.ForeignKey("konova.District", on_delete=models.SET_NULL, null=True, blank=True, related_name="parcels")
flrstck_nnr = models.CharField(
max_length=1000,
help_text="Flurstücksnenner"
help_text="Flurstücksnenner",
null=True,
blank=True,
)
flrstck_zhlr = models.CharField(
max_length=1000,
help_text="Flurstückszähler"
help_text="Flurstückszähler",
null=True,
blank=True,
)
flr = models.CharField(
max_length=1000,
help_text="Flur"
)
gmrkng = models.CharField(
max_length=1000,
help_text="Gemarkung"
help_text="Flur",
null=True,
blank=True,
)
updated_on = models.DateTimeField(auto_now_add=True)
def __str__(self):
return f"{self.gmrkng} | {self.flr} | {self.flrstck_nnr} | {self.flrstck_zhlr}"
return f"{self.flr} | {self.flrstck_nnr} | {self.flrstck_zhlr}"
class District(UuidModel):
@@ -54,18 +56,24 @@ class District(UuidModel):
District.
"""
gmrkng = models.CharField(
max_length=1000,
help_text="Gemarkung",
null=True,
blank=True,
)
gmnd = models.CharField(
max_length=1000,
help_text="Gemeinde"
)
vg = models.CharField(
max_length=1000,
help_text="Verbandsgemeinde",
help_text="Gemeinde",
null=True,
blank=True,
)
krs = models.CharField(
max_length=1000,
help_text="Kreis"
help_text="Kreis",
null=True,
blank=True,
)
def __str__(self):
return f"{self.krs} | {self.vg} | {self.gmnd}"
return f"{self.gmrkng} | {self.gmnd} | {self.krs}"