Skip to content

Incompatibility with the web2py task scheduler

  • The task scheduler create new tables. Some default values are reference to a function / method for few fields.
  • A Ext JS store configuration is created for this table and send to the client. In this process, the store configuration is transformed as a JSON string.
  • The transformation failed since the method json.dumps do not know how to serialize a reference to a function or to a method.
  • On the client side default value pointing to a function or a method make no sense. Therefore a possible fix is the following. Replace the line 763-764 of the file modules/plugin_dbui/converter.py by:
    default = field.default
    default_type = type(default)
    if default and default_type != 'function' and 'method' not in default_type:
        field_cfg['defaultValue'] = default
  • It has been tested and its work in that case.