Example #1
0
def senses_relations_history(page):
    filter_form = SenseRelationsHistoryForm()

    users = get_user_name_list()
    relations = get_sense_relation_list()

    cache_key = 'lurh-count-{}_{}_{}_{}_{}'.format(
        request.args.get('date_from', ''),
        request.args.get('date_to', ''),
        request.args.get('sense_id', ''),
        request.args.get('user', ''),
        request.args.get('relation_type', '')
    )

    paginated_senses = TrackerSenseRelationsHistory.query.filter(
        TrackerSenseRelationsHistory.search_by_form_filter(
            request.args.get('date_from', ''),
            request.args.get('date_to', ''),
            request.args.get('sense_id', ''),
            request.args.get('user', ''),
            request.args.get('relation_type', '')
        )
    )

    pagination = paginate(paginated_senses, page, 50, cache_key)

    return render_template(
        'sense/sense-relations-history.html',
        form=filter_form,
        users=users,
        relations=relations,
        history=pagination,
        keycloak=KeycloakServiceClient()
    )
Example #2
0
def synsets_history(page):
    filter_form = SynsetHistoryForm()

    users = get_user_name_list()

    paginated_synsets = TrackerSynsetsHistory.query.filter(
        TrackerSynsetsHistory.search_by_form_filter(
            request.args.get('date_from', ''), request.args.get('date_to', ''),
            request.args.get('synset_id', ''), request.args.get('user', '')))
    cache_key = "sh-count-{}_{}_{}_{}".format(
        request.args.get('date_from', ''),
        request.args.get('date_to', ''),
        request.args.get('synset_id', ''),
        request.args.get('user', ''),
    )

    pagination = paginate(paginated_synsets, page, 50, cache_key)

    return render_template('synset/synset-history.html',
                           form=filter_form,
                           users=users,
                           synsets=pagination)
Example #3
0
def senses_history(page):

    filter_form = SenseHistoryForm()
    users = get_user_name_list()

    paginated_senses = TrackerSenseHistory.query.filter(
        TrackerSenseHistory.search_by_form_filter(
            request.args.get('date_from', ''),
            request.args.get('date_to', ''),
            request.args.get('sense_id', ''),
            request.args.get('user', ''),
            request.args.get('pos', ''),
            request.args.get('status', '')
        )
    )
    cache_key = 'luh-count-{}_{}_{}_{}_{}_{}'.format(
        request.args.get('date_from', ''),
        request.args.get('date_to', ''),
        request.args.get('sense_id', ''),
        request.args.get('pos', ''),
        request.args.get('status', ''),
        request.args.get('user', '')
    )

    pagination = paginate(paginated_senses, page, 50, cache_key)

    return render_template(
        'sense/sense-history.html',
        form=filter_form,
        users=users,
        sense_history=pagination,
        status=status(),
        pos=parts_of_speech(),
        domain=domain(),
        keycloak=KeycloakServiceClient()
    )
Example #4
0
def synsets_relations_history(page):
    filter_form = SynsetRelationsHistoryForm()

    users = get_user_name_list()
    relations = get_synset_relation_list()

    cache_key = 'srh-count-{}_{}_{}_{}_{}'.format(
        request.args.get('date_from', ''), request.args.get('date_to', ''),
        request.args.get('synset_id', ''), request.args.get('user', ''),
        request.args.get('relation_type', ''))

    paginated_synsets = TrackerSynsetsRelationsHistory.query.filter(
        TrackerSynsetsRelationsHistory.search_by_form_filter(
            request.args.get('date_from', ''), request.args.get('date_to', ''),
            request.args.get('synset_id', ''), request.args.get('user', ''),
            request.args.get('relation_type', '')))

    pagination = paginate(paginated_synsets, page, 50, cache_key)

    return render_template('synset/synset-relations-history.html',
                           form=filter_form,
                           users=users,
                           relations=relations,
                           history=pagination)