db0_controllers.py 945 Bytes
Newer Older
1 2 3
# -*- coding: utf-8 -*-
""" controllers
    
LE GAC Renaud's avatar
LE GAC Renaud committed
4
    The table my_authors, controllers and harvesters are used 
5 6 7 8 9 10 11 12 13 14
    by the harvesters tool.

    It define the relation between harvester controllers and 
    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 25 26 27 28 29
db.controllers.controller.filter_in = dbui.CLEAN_SPACES

# NOTE: 
#
# 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.
#
30
db.controllers.controller.requires = IS_IN_SET(CONTROLLERS)