(request)
return render(request, "parts/form_field_render.html", context=context)
Renders and returns an HTML field based on the incoming toml data.
Renders and returns an HTML field based on the incoming toml data.
Renders and returns an HTML field based on the incoming toml data .
def field_render(request):
    """
    Renders and returns an HTML field based on the incoming toml data.
    """

    demo = """
    [demo]
    label = "Demo"
    display = "INTEGER"
    value = 10000000
    """
    text = request.POST.get("toml", demo)

    # Get the project uid
    uid = request.POST.get('recipe')
    recipe = Analysis.objects.filter(id=uid).first()
    try:
        data = toml.loads(text)
    except Exception as exc:
        return HttpResponse(exc)

    form = RecipeInterface(request, json_data=data, analysis=recipe)

    context = dict(form=form)

    return render(request, "parts/form_field_render.html", context=context)
def field_render ( request ) : demo = """
    [demo]
    label = "Demo"
    display = "INTEGER"
    value = 10000000
    """ text = request . POST . get ( "toml" , demo ) # Get the project uid uid = request . POST . get ( 'recipe' ) recipe = Analysis . objects . filter ( id = uid ) . first ( ) try : data = toml . loads ( text ) except Exception as exc : return HttpResponse ( exc ) form = RecipeInterface ( request , json_data = data , analysis = recipe ) context = dict ( form = form ) return render ( request , "parts/form_field_render.html" , context = context )