|
|
|
|
@ -18,13 +18,13 @@ class AlemTat(object): |
|
|
|
|
|
|
|
|
|
def get_cities(self): |
|
|
|
|
cache_key = 'alemtat_cities' |
|
|
|
|
retval = cache.get(cache_key, None) |
|
|
|
|
retval = None# cache.get(cache_key, None) |
|
|
|
|
if not retval: |
|
|
|
|
url = self._build_url( |
|
|
|
|
'http://api.alemtat.kz/web/{ext}/Catalog/getCitiesByCountry?CountryLocalCode={}'.format(self.COUNTRY_CODE, ext=self.API_KEY)) |
|
|
|
|
r = requests.get(url) |
|
|
|
|
retval = r.json() |
|
|
|
|
cache.set(cache_key, retval, 60*60*24*7) |
|
|
|
|
#cache.set(cache_key, retval, 60*60*24*7) |
|
|
|
|
return retval |
|
|
|
|
|
|
|
|
|
def get_cities_tuple(self): |
|
|
|
|
@ -34,13 +34,13 @@ class AlemTat(object): |
|
|
|
|
|
|
|
|
|
def get_services(self): |
|
|
|
|
cache_key = 'alemtat_services' |
|
|
|
|
retval = cache.get(cache_key, None) |
|
|
|
|
retval = None #cache.get(cache_key, None) |
|
|
|
|
if not retval: |
|
|
|
|
url = self._build_url( |
|
|
|
|
'http://api.alemtat.kz/web/{ext}/Catalog/getServices'.format(ext=self.API_KEY)) |
|
|
|
|
r = requests.get(url) |
|
|
|
|
retval = r.json() |
|
|
|
|
cache.set(cache_key, retval, 60*60*24*7) |
|
|
|
|
#cache.set(cache_key, retval, 60*60*24*7) |
|
|
|
|
return retval |
|
|
|
|
|
|
|
|
|
def get_services_tuple(self): |
|
|
|
|
|