예제 #1
0
파일: 024.py 프로젝트: mightymau/hubspace
def sync_joinus_field(): 
    """Copy the existing joinus text to the joinConfirm page
    """
    from hubspace.model import Page
    for joinus_page in Page.selectBy(path_name='joinus.html'):
        Page.selectBy(path_name='joinConfirm',
                      location=joinus_page.location)[0].content = joinus_page.content
예제 #2
0
파일: 028.py 프로젝트: mightymau/hubspace
def migrate_lists():
    from hubspace.model import Page, List, ListItem, Location
    from hubspace.microSite import list_types
    
    for location in Location.select():
        results = Page.selectBy(location=location, path_name='index.html')
        if results.count() == 0:
            continue;
        else:            
            indexpage = results[0] 

        for list_name, data in list_types.items():
            object_types = ','.join(data['object_types'])
            mode = data['mode']
            thelist = List(list_name=list_name,
                           object_types=object_types,
                           mode=mode,
                           page=indexpage,
                           location=location,)
            for listitem in ListItem.selectBy(location=location,list_name=list_name):
                listitem.list = thelist