Пример #1
0
def full_text_search_without_word():
    query = view.specified_input(
        'word', 'Enter your word to be absent in the document:')
    data = model.full_text_search_without_word(query)
    view.print_entities(
        f'Documents without word=`{query}`', data)
    view.press_enter()
    display_main_menu()
Пример #2
0
def full_text_search_by_phrase():
    query = view.specified_input(
        'phrase', 'Enter your phrase to be found in document:')
    data = model.full_text_search_by_phrase(query)
    view.print_entities(
        f'Documents with phrase=`{query}`', data)
    view.press_enter()
    display_main_menu()
Пример #3
0
def search_questions_by_answer_is_valid():
    query = view.specified_input(
        'is_valid', 'Enter answer.is_valid value:'
    ).lower() in ['true', 't', 'yes', 'y', '+']

    data = model.search_questions_by_answer_is_valid(query)
    view.print_entities(
        f'Questions which where answered with answer.is_valid={query}:', data)
    view.press_enter()
    display_main_menu()
Пример #4
0
def search_users_by_question_date():
    dates = view.specified_input(msg='Enter datetime range divided in format <dd/mm/yyyy hh:mm:ss>-<dd/mm/yyyy hh:mm:ss>:').split('-')
    data = model.search_users_by_question_date(dates)
    view.print_entities(f'User who wrote questions in date range={dates}', data)
    view.press_enter()
    display_main_menu()
Пример #5
0
def select(table):
    query = view.multiple_input(table, 'Enter requested fields:')
    data = model.get(table, query)
    view.print_entities(table, data)
    view.press_enter()
    display_secondary_menu(table)