Пример #1
0
# clear memcache
from google.appengine.api import memcache
from bookcache import *
from wtmb import AppUser, Book
import logging

try:
    memcache.flush_all()
    print "flush all"

    for user in AppUser.all():
        for key in CacheBookIdsOwned.get(user.key()):
            CachedBook.reset(key)
    print "cache cleared."

except DeadlineExceededError:
    self.redirect("/hush/cc")
except e:
    print "exception"
    logging.exception(str(e))
Пример #2
0
# introduce nickname on old users

from google.appengine.ext import db
from wtmb import AppUser
import logging

for user in AppUser.all().fetch(100):
    user.change_nickname(user.display_name())
    logging.debug("new nick: " + user.wtmb_nickname)
    user.put()