tileserver should not depend on django
This commit is contained in:
parent
7754643c4b
commit
f1d5b0ffad
3 changed files with 10 additions and 11 deletions
|
@ -26,7 +26,7 @@ from c3nav.mapdata.models.geometry.space import (POI, Area, Column, CrossDescrip
|
|||
from c3nav.mapdata.models.level import Level
|
||||
from c3nav.mapdata.models.locations import (Location, LocationGroupCategory, LocationRedirect, LocationSlug,
|
||||
SpecificLocation)
|
||||
from c3nav.mapdata.utils.cache import increment_cache_key
|
||||
from c3nav.mapdata.utils.cache.stats import increment_cache_key
|
||||
from c3nav.mapdata.utils.locations import (get_location_by_id_for_request, get_location_by_slug_for_request,
|
||||
searchable_locations_for_request, visible_locations_for_request)
|
||||
from c3nav.mapdata.utils.models import get_submodels
|
||||
|
|
11
src/c3nav/mapdata/utils/cache/__init__.py
vendored
11
src/c3nav/mapdata/utils/cache/__init__.py
vendored
|
@ -1,13 +1,4 @@
|
|||
from django.core.cache import cache
|
||||
|
||||
from c3nav.mapdata.utils.cache.accessrestrictions import AccessRestrictionAffected # noqa
|
||||
from c3nav.mapdata.utils.cache.indexed import GeometryIndexed # noqa
|
||||
from c3nav.mapdata.utils.cache.maphistory import MapHistory # noqa
|
||||
from c3nav.mapdata.utils.cache.accessrestrictions import AccessRestrictionAffected # noqa
|
||||
from c3nav.mapdata.utils.cache.package import CachePackage # noqa
|
||||
|
||||
|
||||
def increment_cache_key(cache_key):
|
||||
try:
|
||||
cache.incr(cache_key)
|
||||
except ValueError:
|
||||
cache.set(cache_key, 0, None)
|
||||
|
|
8
src/c3nav/mapdata/utils/cache/stats.py
vendored
Normal file
8
src/c3nav/mapdata/utils/cache/stats.py
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
from django.core.cache import cache
|
||||
|
||||
|
||||
def increment_cache_key(cache_key):
|
||||
try:
|
||||
cache.incr(cache_key)
|
||||
except ValueError:
|
||||
cache.set(cache_key, 0, None)
|
Loading…
Add table
Add a link
Reference in a new issue