Files
api-bashgah/apps/appsetting/selector.py
T
2026-06-15 10:57:28 +03:30

14 lines
271 B
Python

from apps.appsetting.models import City
from django.core.cache import cache
def get_city_list():
city = cache.get('city')
if city is None:
city = City.objects.all()
# 75 hour cache
cache.set('city', city, 60 * 60 * 72)
return city