db0_events.py 615 Bytes
Newer Older
1 2 3 4
# -*- coding: utf-8 -*-
""" events

"""
5 6 7 8 9
tp_data = \
T("Define the data model. " 
"At each property is associate a type or a default value. " 
"Valid type are boolean, date, number and string.")
 
10
db.define_table("events",
11 12
    Field("event", "string", length=255, notnull=True, unique=True),
    Field("category", "string", length=255, notnull=True),
13
    Field("definition", "text"),
14
    Field("data", "json", comment=tp_data, label="Model"),
15 16 17
    migrate="events.table")

db.events._before_delete.append(INHIBIT_CASCADE_DELETE)
18 19 20

# NOTE: we have to remove the json validator to work !!
db.events.data.requires = None