Esempio n. 1
0
        code_lib.add_obj(new_code)
        rstring['alias'] = alias
        return [0, rstring]
    elif src_type == 'math':
        math_lib = AF_Object.equation_lib
        alias = get_max_alias(math_lib.load_all().keys())
        new_math = Equation()
        new_math.set_propertys(**{'alias':alias, 'name':title, 'equation':body, 'mode':math_type})
        math_lib.add_obj(new_math)
        rstring['alias'] = alias
        return [0, rstring]
    elif src_type == 'table':
        table_lib = AF_Object.tableform_lib
        alias = get_max_alias(table_lib.load_all().keys())
        new_table = Tableform()
        new_table.set_propertys(**{'alias':alias, 'name':title, 'tableform':body})
        table_lib.add_obj(new_table)
        rstring['alias'] = alias
        return [0, rstring]
    else:
        return [1,'本站尚不支持此类型资源,我们将继续改进!']



def fun_new_article_pic(user, article_id=0, article_type='blog', title='', url='', thumb='', father_id=0, group_id='-1'):
    isnew = 0
    if article_type not in Article_Type:
        return [1, '不支持当前文章类型!']
        
    if article_type == "about":
        AF_Object = About(_id=user.about._id)
Esempio n. 2
0
        new_math.set_propertys(**{
            'alias': alias,
            'name': title,
            'equation': body,
            'mode': math_type
        })
        math_lib.add_obj(new_math)
        rstring['alias'] = alias
        return [0, rstring]
    elif src_type == 'table':
        table_lib = AF_Object.tableform_lib
        alias = get_max_alias(table_lib.load_all().keys())
        new_table = Tableform()
        new_table.set_propertys(**{
            'alias': alias,
            'name': title,
            'tableform': body
        })
        table_lib.add_obj(new_table)
        rstring['alias'] = alias
        return [0, rstring]
    else:
        return [1, '本站尚不支持此类型资源,我们将继续改进!']


def fun_new_article_pic(user,
                        article_id=0,
                        article_type='blog',
                        title='',
                        url='',
                        thumb='',