Beispiel #1
0
def upgrade_visit_all_blogs():
    from base import get_group_database, get_user_database, commit_upgraded_versioneds
    
    count = 0
    item_count = 0
    for group_id, group in get_group_database().root.iteritems():
        for item in group.get_blog().get_items():
            item_count += 1
        
        for page_name, page in group.get_wiki().pages.iteritems():
            for item in page.blog.get_items():
                item_count += 1
        
        count += 1
        commit_upgraded_versioneds()
        print "Touched %d groups, %d items, %s" % (count, item_count, group_id)
        
    
    count = 0
    item_count = 0
    for user_id, user in get_user_database().root.iteritems():
        for item in user.get_blog().get_items():
            item_count += 1

        if count % 500 == 0:
            print "Touched %d users, %d items" % (count, item_count)
            commit_upgraded_versioneds()
        count += 1

    commit_upgraded_versioneds()
Beispiel #2
0
 def finish_successful_request(self, request):
     """Commit any version upgrades that might have happened."""
     from base import commit_upgraded_versioneds
     
     commit_upgraded_versioneds()
     DulcineaPublisher.finish_successful_request(self, request)