add location→types API endpoint
This commit is contained in:
parent
6bbac4a7ba
commit
40375585e1
3 changed files with 32 additions and 17 deletions
|
@ -30,6 +30,13 @@ class GeometryMixin(EditorFormMixin):
|
|||
('geometry', format_geojson(mapping(self.geometry), round=False)),
|
||||
))
|
||||
|
||||
@classmethod
|
||||
def serialize_type(cls, geomtype=True, **kwargs):
|
||||
result = super().serialize_type()
|
||||
if geomtype:
|
||||
result['geomtype'] = cls._meta.get_field('geometry').geomtype
|
||||
return result
|
||||
|
||||
def serialize(self, geometry=True, **kwargs):
|
||||
result = super().serialize(geometry=geometry, **kwargs)
|
||||
if geometry:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue