Ctrl + k

or run

tessl search
Log in

Version

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

tessl/pypi-flask-admin

tessl install tessl/pypi-flask-admin@1.6.0

Simple and extensible admin interface framework for Flask

Agent Success

Agent success rate when using this tile

86%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.3x

Baseline

Agent success rate without this tile

66%

task.mdevals/scenario-6/

Multilingual Product Admin Interface

Create a simple product management admin interface for a Flask application that supports multiple languages (English and Spanish). The interface should allow users to view and manage products, with all UI elements properly translated based on the user's language preference.

Requirements

Build a Flask-Admin interface with the following features:

  1. Product Model: A simple product model with the following fields:

    • name (text)
    • description (text)
    • price (decimal)
    • in_stock (boolean)
    • created_at (datetime)
  2. Admin Interface: Create an admin view for the Product model with:

    • List view showing all product fields
    • Create and edit forms
    • Column labels that display in Spanish when the user's locale is 'es'
    • Form field labels that display in Spanish when the user's locale is 'es'
  3. Language Support: The application should support:

    • English (default language)
    • Spanish (locale code 'es')
    • Translations for these UI elements: "Name", "Description", "Price", "In Stock", "Created At"
  4. Test Implementation: Write tests to verify:

    • Column labels appear in Spanish when locale is set to 'es' @test
    • Form field labels appear in Spanish when locale is set to 'es' @test
    • Column labels appear in English when locale is set to 'en' (default) @test

Implementation Files

@generates

API

from flask import Flask
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
from flask_sqlalchemy import SQLAlchemy

class ProductView(ModelView):
    """
    Admin view for Product model with internationalization support.

    Should configure column_labels with translated strings for supported languages.
    Should use appropriate translation functions to enable language switching.
    """
    pass

def create_admin_interface(app: Flask, db: SQLAlchemy) -> Admin:
    """
    Create and configure the Flask-Admin interface with i18n support.

    Args:
        app: Flask application instance
        db: SQLAlchemy database instance

    Returns:
        Configured Admin instance with ProductView registered
    """
    pass

Dependencies { .dependencies }

flask-admin { .dependency }

Provides admin interface framework with internationalization support.

flask-babel { .dependency }

Provides internationalization and localization support for Flask applications.

flask-sqlalchemy { .dependency }

Provides SQLAlchemy integration for Flask.