Example #1
0
def objects(engine):
    objects = VersionedJSONSerializableObjectTables(
        'objects', object_type=Object
    )
    objects.bind = engine

    # create the object tables
    objects.metadata.create_all(engine)
    return objects
Example #2
0
def objects(engine):
    objects = VersionedJSONSerializableObjectTables(
        'objects',
        object_type=Object,
        user_id_column=User.id,
        action_id_column=Action.id,
        action_schema_column=Action.schema,
        data_validator=lambda data, schema: jsonschema.validate(data, schema),
        schema_validator=lambda schema: jsonschema.Draft4Validator.
        check_schema(schema))
    objects.bind = engine

    # create the object tables
    objects.metadata.create_all(engine)
    return objects