예제 #1
0
파일: mock.py 프로젝트: nubela/unifide-plop
def gen_articles(total_items=20):
    for _ in range(total_items):
        basic_attr = {
            "name": loremipsum.sentence(max_char=choice(range(10, 20))),
            "image": None,
            "description": loremipsum.paragraph(),
        }
        publish_datetime = __gen_random_datetime(MOCK_DATE_RANGE_DAYS)
        items.save_item(basic_attr, ARTICLE_PATH, publish_datetime)
예제 #2
0
def save_article(attr_dic):
    return items.save_item(attr_dic, ARTICLE_PATH)