db0_controllers.py 1.04 KB
Newer Older
1 2
# -*- coding: utf-8 -*-
""" controllers
3 4

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

7
    It define the relation between harvester controllers and
8 9 10 11 12 13 14
    publication categories.

"""
tp_category = \
T("Publication category associated to the found records.")

tp_controller = \
15
T("The name of the harvester.")
16 17

db.define_table("controllers",
18
    Field("controller", "string", length=255, comment=tp_controller, label='Harvester', notnull=True),
19 20 21
    Field("id_categories", "reference categories", comment=tp_category, default=undef_id, label='Category'),
    migrate="controllers.table")

22 23 24
db.controllers._before_insert.append(INHIBIT_CONTROLLER_INSERT)
db.controllers._before_update.append(INHIBIT_CONTROLLER_UPDATE)

25 26
db.controllers.controller.filter_in = dbui.CLEAN_SPACES

27
# NOTE:
28 29 30 31 32
#
# the list of controllers corresponds to those defined in the harvest_tools.
# The method get_harvester_tool defines the relation between the controller
# and the harvester class.
#
33 34
db.controllers.controller.requires = IS_IN_SET(CONTROLLERS)