(request, domain)
return back_to_main(*main_args)
Adds an app to the database
Adds an app to the database
Adds an app to the database
def new_app(request, domain):
    "Adds an app to the database"
    lang = 'en'
    type = request.POST["type"]
    cls = app_doc_types()[type]
    form_args = []
    if cls == Application:
        app = cls.new_app(domain, "Untitled Application", lang=lang)
        module = Module.new_module("Untitled Menu", lang)
        app.add_module(module)
        form = app.new_form(0, "Untitled Form", lang)
        form_args = [module.id, form.id]
    else:
        app = cls.new_app(domain, "Untitled Application", lang=lang)
    if request.project.secure_submissions:
        app.secure_submissions = True
    app.save()
    clear_app_cache(request, domain)
    main_args = [request, domain, app.id]
    main_args.extend(form_args)

    return back_to_main(*main_args)
def new_app ( request , domain ) : lang = 'en' type = request . POST [ "type" ] cls = app_doc_types ( ) [ type ] form_args = [ ] if cls == Application : app = cls . new_app ( domain , "Untitled Application" , lang = lang ) module = Module . new_module ( "Untitled Menu" , lang ) app . add_module ( module ) form = app . new_form ( 0 , "Untitled Form" , lang ) form_args = [ module . id , form . id ] else : app = cls . new_app ( domain , "Untitled Application" , lang = lang ) if request . project . secure_submissions : app . secure_submissions = True app . save ( ) clear_app_cache ( request , domain ) main_args = [ request , domain , app . id ] main_args . extend ( form_args ) return back_to_main ( * main_args )