def wrapper(self, *args, **kwargs): counter = Counter.all().get() if counter is None: counter = Counter() counter.put() if not users.is_current_user_admin(): counter.count += 1 counter.put() return handler_method(self, *args, **kwargs)
def getCounter(): counter = Counter.all().get() if counter is None: return 0 return counter.count