def delete_expire_oauth(): exceed_date = datetime.datetime.now() + datetime.timedelta(seconds=10*60) expire_oauth_list = OAuthStorage.get(date__lte=exceed_date) for oauth in expire_oauth_list: delete_oauth(oauth)
def get_oauth(**kwargs): return OAuthStorage.get(**kwargs)