xia_editor_flask.editor.XiaEditorFlask

class xia_editor_flask.editor.XiaEditorFlask

Bases: object

XIA Editor Module for Flask

__init__()

Methods

__init__()

compile_static_files(template_location, ...)

Save the template and javascript to the specified location

get_editor_blueprint(path_name, ...[, ...])

Get Editor Blueprint

Attributes

BASE_DEFAULT

HTML_DEFAULT

JS_DEFAULT

classmethod compile_static_files(template_location: str, base_name: str, editor_name: str, js_location: str)

Save the template and javascript to the specified location

Parameters
  • template_location – where html file should be stored

  • base_name – base html name

  • editor_name – editor html name

  • js_location – where the javascript file could be found

Notes

We don’t overwrite the files for static file types

classmethod get_editor_blueprint(path_name: str, resource_mapping: dict, editor_html_location: str, js_location: str, editor_prefix: str, api_prefix: str, schema_prefix: str, public_resource: Optional[list], token_manager: Optional[Type[FlaskToken]] = None, debug: bool = False)

Get Editor Blueprint

Parameters
  • path_name – sub flask path name of the parent app

  • resource_mapping – resource path to object mapping

  • editor_html_location – where the template html is stored

  • js_location – where the javascript file could be found

  • token_manager – Token Management Class, should be a subclass of FlaskToken

  • editor_prefix – the url path or editor

  • api_prefix – the url path for api call

  • schema_prefix – the url path from where the json editor schema could be found

  • public_resource – The list of public resource

  • debug – debug mode

Returns: