no need to explicitly serialize the grid
This commit is contained in:
parent
05890de06a
commit
07a3c5ffa9
3 changed files with 3 additions and 11 deletions
|
@ -50,7 +50,7 @@ def map_settings(request):
|
|||
return MapSettingsSchema(
|
||||
initial_bounds=initial_bounds,
|
||||
initial_level=settings.INITIAL_LEVEL or None,
|
||||
grid=grid.serialize().model_dump() if grid else None,
|
||||
grid=grid if grid else None,
|
||||
tile_server=settings.TILE_CACHE_SERVER,
|
||||
)
|
||||
|
||||
|
|
|
@ -50,14 +50,6 @@ class Grid(AbstractGrid):
|
|||
else:
|
||||
raise ValueError('column coordinates are not ordered')
|
||||
|
||||
def serialize(self) -> GridSchema:
|
||||
return GridSchema(
|
||||
rows=self.rows,
|
||||
cols=self.cols,
|
||||
invert_x=self.invert_y,
|
||||
invert_y=self.invert_y,
|
||||
)
|
||||
|
||||
def get_square_for_point(self, x, y):
|
||||
x = bisect.bisect(self.cols, x)
|
||||
if x <= 0 or x >= len(self.cols):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue