(request, domain, app_id, form_unique_id)
return HttpResponse(json.dumps(data, **kw))
Get data schema

    :returns: A list of data source schema definitions. A data source schema
    definition is a dictionary. For details on the content of the dictionary,
    see https://github.com/dimagi/Vellum/blob/master/src/datasources.js
Get data schema
Get data schema
def get_form_data_schema(request, domain, app_id, form_unique_id):
    """Get data schema

    :returns: A list of data source schema definitions. A data source schema
    definition is a dictionary. For details on the content of the dictionary,
    see https://github.com/dimagi/Vellum/blob/master/src/datasources.js
    """
    data = []

    app = get_app(domain, app_id)
    form = app.get_form(form_unique_id)

    try:
        data.append(get_session_schema(form))
        if form.requires_case() or is_usercase_in_use(domain):
            data.append(get_casedb_schema(form))
        if form.requires_case() and module_loads_registry_case(form.get_module()):
            data.append(get_registry_schema(form))
    except AppManagerException as e:
        notify_exception(request, message=str(e))
        return HttpResponseBadRequest(
            str(e) or _("There is an error in the case management of your application. "
            "Please fix the error to see case properties in this tree")
        )
    except Exception as e:
        notify_exception(request, message=str(e))
        return HttpResponseBadRequest("schema error, see log for details")

    data.extend(item_lists_by_domain(domain))
    kw = {}
    if "pretty" in request.GET:
        kw["indent"] = 2
    return HttpResponse(json.dumps(data, **kw))
def get_form_data_schema ( request , domain , app_id , form_unique_id ) : data = [ ] app = get_app ( domain , app_id ) form = app . get_form ( form_unique_id ) try : data . append ( get_session_schema ( form ) ) if form . requires_case ( ) or is_usercase_in_use ( domain ) : data . append ( get_casedb_schema ( form ) ) if form . requires_case ( ) and module_loads_registry_case ( form . get_module ( ) ) : data . append ( get_registry_schema ( form ) ) except AppManagerException as e : notify_exception ( request , message = str ( e ) ) return HttpResponseBadRequest ( str ( e ) or _ ( "There is an error in the case management of your application. " "Please fix the error to see case properties in this tree" ) ) except Exception as e : notify_exception ( request , message = str ( e ) ) return HttpResponseBadRequest ( "schema error, see log for details" ) data . extend ( item_lists_by_domain ( domain ) ) kw = { } if "pretty" in request . GET : kw [ "indent" ] = 2 return HttpResponse ( json . dumps ( data , * * kw ) )