Exemple #1
0
         },
         {
             "name": "Flask-RESTful",
             "value": "restful",
             "disabled": "Not yet supported",
         },
         {
             "name": "None",
             "value": "none"
         },
     ],
     "when":
     lambda answers: has_answers(
         answers,
         not_have={
             "application_type": "web_only",
             "database": "mongodb;none",
         },
     ),
     "validate":
     lambda answer: "You must choose at least one topping."
     if len(answer) == 0 else True,
 },
 {
     "type":
     "list",
     "message":
     "Select your API Framework",
     "name":
     "api_framework",
     "choices": [
Exemple #2
0
    },
    {
        "type":
        "list",
        "message":
        "Select the Authentication Framework",
        "name":
        "api_auth_framework",
        "choices": [
            {
                "name": "Flask-JWT-Extended",
                "value": "jwt_extended"
            },
            {
                "name": "Flask-Praetorian",
                "value": "praetorian",
                "disabled": "Not yet supported",
            },
            {
                "name": "None",
                "value": "none"
            },
        ],
        "when":
        lambda answers: has_answers(answers, have={"have_api": True}),
        "validate":
        lambda answer: "You must choose at least one topping."
        if len(answer) == 0 else True,
    },
]
             "value": "login_web",
             "disabled": "Not supported yet",
         },
         {
             "name": "Flask-BasicAuth",
             "value": "basicauth_web",
             "disabled": "Not supported yet",
         },
         {
             "name": "None",
             "value": "none",
             "disabled": "Not supported yet"
         },
     ],
     "when":
     lambda answers: has_answers(answers,
                                 have={"application_type": "web_only"}),
     "validate":
     lambda answer: "You must choose at least one topping."
     if len(answer) == 0 else True,
 },
 {
     "type":
     "list",
     "message":
     "Select the Authentication Framework",
     "name":
     "auth_framework",
     "choices": [
         {
             "name": "Flask-JWT-Extended",
             "value": "jwt_extended"
Exemple #4
0
             "name": "Cache (Flask-Caching)",
             "value": "caching"
         },
         {
             "name": "Rate Limiting (Flask-Limiter)",
             "value": "limiter"
         },
         {
             "name": "Flask-DebugToolbar",
             "value": "debugtoolbar"
         },
     ],
     "when":
     lambda answers: has_answers(
         answers,
         have={"have_api": False},
         not_have={"database": "none"},
     ),
 },
 {
     "type":
     "checkbox",
     "message":
     "Select some more features for your project",
     "name":
     "features",
     "choices": [
         {
             "name": "Cache (Flask-Caching)",
             "value": "caching"
         },
Exemple #5
0
             "name": "Cache (Flask-Caching)",
             "value": "caching"
         },
         {
             "name": "Rate Limiting (Flask-Limiter)",
             "value": "limiter"
         },
         {
             "name": "Flask-DebugToolbar",
             "value": "debugtoolbar"
         },
     ],
     "when":
     lambda answers: has_answers(
         answers,
         have={"application_type": "web_only"},
         not_have={"database": "none"},
     ),
 },
 {
     "type":
     "checkbox",
     "message":
     "Select some more features for your project",
     "name":
     "features",
     "choices": [
         {
             "name": "Cache (Flask-Caching)"
         },
         {
Exemple #6
0
features_questions = [
    {
        "type": "checkbox",
        "message": "Select some more features for your project",
        "name": "features",
        "choices": [
            {"name": "Migrations (Flask-Migrate)", "value": FLASK_MIGRATE},
            {"name": "Admin Interface (Flask-Admin)", "value": FLASK_ADMIN},
            {"name": "Cache (Flask-Caching)", "value": FLASK_CACHING},
            {"name": "Rate Limiting (Flask-Limiter)", "value": FLASK_LIMITER},
            {"name": "Flask-DebugToolbar", "value": FLASK_DEBUGTOOLBAR},
        ],
        "when": lambda answers: has_answers(
            answers,
            have={"have_api": False},
            not_have={"database": f"{NONE};{MONGODB}"},
        ),
    },
    {
        "type": "checkbox",
        "message": "Select some more features for your project",
        "name": "features",
        "choices": [
            {"name": "Cache (Flask-Caching)", "value": FLASK_CACHING},
            {"name": "Rate Limiting (Flask-Limiter)", "value": FLASK_LIMITER},
            {"name": "Flask-DebugToolbar", "value": FLASK_DEBUGTOOLBAR},
        ],
        "when": lambda answers: has_answers(
            answers, have={"have_api": False, "database": NONE},
        ),