Example #1
0
 def get(self):
   #get the whole team's caches
   from cache import CacheLocation, Cache, TYPE_LOCAL_FD, TYPE_EXTERN_FD
   from team import get_team_for_team_leader
   from user_sn import confirm
   from cache import TYPE_LOCAL_FD
   u = confirm(self)
   team = get_team_for_team_leader(u)
   locations = CacheLocation.all().filter("team_responsible =",team).filter("type =",TYPE_LOCAL_FD).fetch(limit=1000)
   locations += CacheLocation.all().filter("team_responsible =",team).filter("type =",TYPE_EXTERN_FD).fetch(limit=1000)
   for location in locations:
       if location.type == TYPE_LOCAL_FD:
           r = "INTERN"
       elif location.type == TYPE_EXTERN_FD:
           r = "EXTERN"
       logging.info("Writing info for location %s" % location)
       self.response.out.write(r+";"+location.description+";")
       self.response.out.write("/cache/img?cache=%s" % location.key() + ";")
       self.response.out.write(location.key())
       self.response.out.write(";")
       caches = Cache.all().filter("permanent_location =",location)
       for cache in caches:
           self.response.out.write(print_cache_info(cache))
           self.response.out.write(",")
       self.response.out.write("\n")