common/lib/aframe_utils.py
def import_form(jd):
    """
    Imports an input_from from serialized json data
    :param jd: json_data object generated from the export_input_form function
    :return: id of the input form or id of the input form if it already exists
    """
    template_options = jd["template"]
    form_options = jd["form"]

    if not ConfigTemplate.objects.filter(name=template_options['name']).exists():
        template = ConfigTemplate()
        template.name = template_options["name"]
        template.description = template_options["description"]
        template.action_provider = template_options["action_provider"]
        template.action_provider_options = template_options["action_provider_options"]
        template.type = template_options["type"]
        template.template = unquote(template_options["template"])
        logger.info("Imported template: %s" % template.name)
        template.save()
    else:
        print('ConfigTemplate %s already exists' % template_options['name'])

    if not InputForm.objects.filter(name=form_options['name']).exists():
        input_form = InputForm()
        input_form.name = form_options["name"]
        input_form.description = form_options["description"]
        input_form.instructions = form_options["instructions"]
        input_form.json = unquote(form_options["json"])
        input_form.script = template

        logger.info("Import input form: %s" % input_form.name)
        input_form.save()
    else:
        print('Input form %s already exists' % form_options['name'])
        input_form = InputForm.objects.get(name=form_options['name'])

    return input_form.id

    Imports an input_from from serialized json data
    :param jd: json_data object generated from the export_input_form function
    :return: id of the input form or id of the input form if it already exists
    
Imports an input_from from serialized json data
Imports an input_from from serialized json data
def import_form(jd):
    template_options = jd["template"]
    form_options = jd["form"]
    if not ConfigTemplate.objects.filter(name=template_options['name']).exists():
        template = ConfigTemplate()
        template.name = template_options["name"]
        template.description = template_options["description"]
        template.action_provider = template_options["action_provider"]
        template.action_provider_options = template_options["action_provider_options"]
        template.type = template_options["type"]
        template.template = unquote(template_options["template"])
        logger.info("Imported template: %s" % template.name)
        template.save()
    else:
        print('ConfigTemplate %s already exists' % template_options['name'])
    if not InputForm.objects.filter(name=form_options['name']).exists():
        input_form = InputForm()
        input_form.name = form_options["name"]
        input_form.description = form_options["description"]
        input_form.instructions = form_options["instructions"]
        input_form.json = unquote(form_options["json"])
        input_form.script = template
        logger.info("Import input form: %s" % input_form.name)
        input_form.save()
    else:
        print('Input form %s already exists' % form_options['name'])
        input_form = InputForm.objects.get(name=form_options['name'])
    return input_form.id
def import_form ( jd ) : template_options = jd [ "template" ] form_options = jd [ "form" ] if not ConfigTemplate . objects . filter ( name = template_options [ 'name' ] ) . exists ( ) : template = ConfigTemplate ( ) template . name = template_options [ "name" ] template . description = template_options [ "description" ] template . action_provider = template_options [ "action_provider" ] template . action_provider_options = template_options [ "action_provider_options" ] template . type = template_options [ "type" ] template . template = unquote ( template_options [ "template" ] ) logger . info ( "Imported template: %s" % template . name ) template . save ( ) else : print ( 'ConfigTemplate %s already exists' % template_options [ 'name' ] ) if not InputForm . objects . filter ( name = form_options [ 'name' ] ) . exists ( ) : input_form = InputForm ( ) input_form . name = form_options [ "name" ] input_form . description = form_options [ "description" ] input_form . instructions = form_options [ "instructions" ] input_form . json = unquote ( form_options [ "json" ] ) input_form . script = template logger . info ( "Import input form: %s" % input_form . name ) input_form . save ( ) else : print ( 'Input form %s already exists' % form_options [ 'name' ] ) input_form = InputForm . objects . get ( name = form_options [ 'name' ] ) return input_form . id
Imports an input_from from serialized json data
Imports an input_from from serialized json data
"""
    Imports an input_from from serialized json data
    :param jd: json_data object generated from the export_input_form function
    :return: id of the input form or id of the input form if it already exists
    """
id of the input form or id of the input form if it already exists
id of the input form or id of the input form if it already exists
jd
json_data object generated from the export_input_form function
json_data object generated from the export_input_form function