db1_harvesters.py 1.45 KB
Newer Older
1 2 3
# -*- coding: utf-8 -*-
""" harvesters

4
    The table my_authors, controllers and harvesters are used
5 6 7 8
    by the harvesters tool.

"""
tp_collections = \
9
T("List of collections separated by comma: LHCb Papers, LHCb Talks")
10 11 12 13 14 15 16

tp_host = \
T("Address of the invenio store where the search is performed.")

tp_ratio = \
T("Parameter for fuzzy string search.")

17 18 19
tp_scan = \
T("Authorize automatic scan.")

20 21 22
db.define_table("harvesters",
    Field("id_teams", "reference teams", label='Team', notnull=True),
    Field("id_projects", "reference projects", label='Project', notnull=True),
23
    Field("controller", "string", length=255, comment=tp_controller, label='Category', notnull=True),
24
    Field("host", "string", length=255, comment=tp_host, default=STORES[0], label='Store', notnull=True),
25
    Field("collections", "string", length=255, comment=tp_collections, notnull=True),
26
    Field("ratio", "double", comment=tp_ratio, default=1.0, notnull=True),
27
    Field("id_categories", "reference categories", comment=tp_category, label='Code', notnull=True),
28
    Field("scan", "boolean", comment=tp_scan, default=False),
29 30 31 32 33 34 35
    migrate="harvesters.table")

db.harvesters.collections.filter_in = dbui.CLEAN_SPACES
db.harvesters.controller.filter_in = dbui.CLEAN_SPACES
db.harvesters.host.filter_in = dbui.CLEAN_SPACES

db.harvesters.controller.requires = IS_IN_DB(db, 'controllers.controller')
36
db.harvesters.host.requires = IS_IN_SET(STORES)
37
db.harvesters.ratio.requires = IS_FLOAT_IN_RANGE(0., 1.0)