Exemplo n.º 1
0
 def get_current_user(cls, keys_only=False):
     current_user = users.get_current_user()
     if current_user:
         return cache.memoize_result(
             '%s.get_current_user(%s,%s)' %
             (cls.__name__, current_user.user_id(), keys_only),
             cls.get_by_user_id,
             current_user.user_id(),
             keys_only=keys_only)
     else:
         return None
Exemplo n.º 2
0
 def get_current_user(cls,keys_only=False):
     current_user = users.get_current_user()
     if current_user:
         return cache.memoize_result('%s.get_current_user(%s,%s)'%(cls.__name__,current_user.user_id(),keys_only),cls.get_by_user_id,current_user.user_id(),keys_only=keys_only)   
     else:
         return None
Exemplo n.º 3
0
 def get_by_user_id(cls,user_id,keys_only=False):
     return cache.memoize_result('%s.get_by_user_id(%s,%s)'%(cls.__name__,user_id,keys_only),cls.all(keys_only=keys_only).filter('all_user_ids =',user_id).get)
Exemplo n.º 4
0
 def get_by_user_id(cls, user_id, keys_only=False):
     return cache.memoize_result(
         '%s.get_by_user_id(%s,%s)' % (cls.__name__, user_id, keys_only),
         cls.all(keys_only=keys_only).filter('all_user_ids =', user_id).get)