CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-flask-wtf

tessl install tessl/pypi-flask-wtf@1.2.0

Form rendering, validation, and CSRF protection for Flask with WTForms.

Agent Success

Agent success rate when using this tile

72%

Improvement

Agent success rate improvement when using this tile compared to baseline

0.91x

Baseline

Agent success rate without this tile

79%

rubric.jsonevals/scenario-1/

{
  "context": "This criteria evaluates how well the engineer uses Flask-WTF and Flask-Babel to implement internationalization for form validation messages. The focus is on proper integration of these packages to create a multi-language contact form with translated validation errors.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "FlaskForm usage",
      "description": "Uses FlaskForm class from flask_wtf to create the contact form with proper field definitions (StringField, EmailField or StringField with EmailValidator, TextAreaField)",
      "max_score": 20
    },
    {
      "name": "Form validators",
      "description": "Implements WTForms validators (DataRequired, Email, Length) on form fields to enforce the validation requirements specified (required fields, valid email, minimum 10 characters for message)",
      "max_score": 15
    },
    {
      "name": "Flask-Babel initialization",
      "description": "Properly initializes Flask-Babel by creating a Babel instance and configuring it with the Flask app using Babel(app) or babel.init_app(app)",
      "max_score": 15
    },
    {
      "name": "Locale selector",
      "description": "Implements a locale selector function using @babel.localeselector decorator that detects language from the 'lang' query parameter and returns appropriate locale ('en' or 'es')",
      "max_score": 20
    },
    {
      "name": "Translation setup",
      "description": "Creates translation files or uses Flask-Babel's gettext functionality to enable translation of validation messages and success messages for both English and Spanish locales",
      "max_score": 15
    },
    {
      "name": "Form validation integration",
      "description": "Uses form.validate_on_submit() or form.validate() to trigger validation and properly handles validation errors, allowing Flask-Babel to automatically translate WTForms validation messages",
      "max_score": 10
    },
    {
      "name": "Template rendering",
      "description": "Renders form fields and validation errors in the template, ensuring that error messages are displayed and will be shown in the language determined by the locale selector",
      "max_score": 5
    }
  ]
}

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/flask-wtf@1.2.x
tile.json