# -*- coding: utf-8 -*- """ harvesters The table my_authors, controllers and harvesters are used by the harvesters tool. """ tp_collections = \ T("List of collections separated by comma: LHCb Papers, LHCb Talks") tp_host = \ T("Address of the invenio store where the search is performed.") tp_ratio = \ T("Parameter for fuzzy string search.") tp_scan = \ T("Authorize automatic scan.") db.define_table("harvesters", Field("id_teams", "reference teams", label='Team', notnull=True), Field("id_projects", "reference projects", label='Project', notnull=True), Field("controller", "string", length=255, comment=tp_controller, label='Category', notnull=True), Field("host", "string", length=255, comment=tp_host, default=STORES[0], label='Store', notnull=True), Field("collections", "string", length=255, comment=tp_collections, notnull=True), Field("ratio", "double", comment=tp_ratio, default=1.0, notnull=True), Field("id_categories", "reference categories", comment=tp_category, label='Code', notnull=True), Field("scan", "boolean", comment=tp_scan, default=False), 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') db.harvesters.host.requires = IS_IN_SET(STORES) db.harvesters.ratio.requires = IS_FLOAT_IN_RANGE(0., 1.0)