cache LevelRenderData for each level completely (+ cropping)
This commit is contained in:
parent
b9c3a961af
commit
9f59b841b0
5 changed files with 223 additions and 125 deletions
|
@ -19,7 +19,7 @@ from c3nav.mapdata.utils.svg import SVGImage
|
|||
|
||||
class LevelManager(models.Manager):
|
||||
def get_queryset(self, *args, **kwargs):
|
||||
return super().get_queryset(*args, **kwargs).defer('geoms_cache')
|
||||
return super().get_queryset(*args, **kwargs).defer('render_data')
|
||||
|
||||
|
||||
class Level(SpecificLocation, models.Model):
|
||||
|
@ -31,7 +31,7 @@ class Level(SpecificLocation, models.Model):
|
|||
on_top_of = models.ForeignKey('mapdata.Level', null=True, on_delete=models.CASCADE,
|
||||
related_name='levels_on_top', verbose_name=_('on top of'))
|
||||
|
||||
geoms_cache = models.BinaryField()
|
||||
render_data = models.BinaryField(null=True)
|
||||
|
||||
objects = LevelManager()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue