Exemplo n.º 1
0
def com_new(name, admin_id, state=ZSITE_STATE_VERIFY):
    name = name.replace('科技有限公司', '')
    com = zsite_new(name, CID_COM, state)
    com_id = com.id
    zsite_com_count.delete(CID_COM)
    mc_zsite_com_id_list.delete(CID_COM)
    return com
Exemplo n.º 2
0
def com_new(name, admin_id, state=ZSITE_STATE_VERIFY):
    name = name.replace('科技有限公司', '')
    com = zsite_new(name, CID_COM, state)
    com_id = com.id
    zsite_com_count.delete(CID_COM)
    mc_zsite_com_id_list.delete(CID_COM)
    return com
Exemplo n.º 3
0
def site_new(name, admin_id, state):
    if state not in ZSITE_STATE_SITE2CN_DICT:
        state = ZSITE_STATE_SITE_PUBLIC

    site = zsite_new(name, CID_SITE, state)
    site_id = site.id
    zsite_admin_new(site_id, admin_id)

    if state > ZSITE_STATE_SITE_SECRET:
        zsite_show_new(site_id, CID_SITE)

    mq_buzz_site_new(admin_id, site_id)
    search_new(site_id)
    return site
Exemplo n.º 4
0
def zsite_book_new(
    name,
    douban_id,
    pic_id,
    author,
    translator,
    pages,
    publisher,
    isbn,
    rating,
    rating_num,
    author_intro,
    txt,
):
    if douban_id:
        book = ZsiteBook.get(douban_id=douban_id)
        if book:
            return book.id
    if isbn:
        book_id = zsite_book_id_by_isbn(isbn)
        if book_id:
            return book_id
    zsite = zsite_new(name, CID_BOOK)
    id = zsite.id
    if isbn:
        mc_zsite_book_id_by_isbn.set(isbn, id)

    txt_new(id, txt)
    book = ZsiteBook.get_or_create(id=id)
    book.douban_id = douban_id
    book.douban_pic_id = pic_id
    book.author = author
    book.translator = translator
    book.pages = pages
    book.publisher = publisher
    book.isbn = isbn
    book.rating = rating
    book.rating_num = rating_num
    book.author_intro = author_intro
    #print author_intro,"author_intro"
    book.save()
    return id
Exemplo n.º 5
0
def zsite_book_new(
    name,
    douban_id,
    pic_id,
    author, translator, pages,
    publisher, isbn,
    rating, rating_num,
    author_intro, txt,
):
    if douban_id:
        book = ZsiteBook.get(douban_id=douban_id)
        if book:
            return book.id
    if isbn:
        book_id = zsite_book_id_by_isbn(isbn)
        if book_id:
            return book_id
    zsite = zsite_new(name, CID_BOOK)
    id = zsite.id
    if isbn:
        mc_zsite_book_id_by_isbn.set(isbn, id)

    txt_new(id, txt)
    book = ZsiteBook.get_or_create(id=id)
    book.douban_id = douban_id
    book.douban_pic_id = pic_id
    book.author = author
    book.translator = translator
    book.pages = pages
    book.publisher = publisher
    book.isbn = isbn
    book.rating = rating
    book.rating_num = rating_num
    book.author_intro = author_intro
    #print author_intro,"author_intro"
    book.save()
    return id