tessl install tessl/pypi-flask-admin@1.6.0Simple 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%
Build a Flask application with an admin interface for managing product inventory. The admin interface should handle form validation and display appropriate error messages to users.
Create a Flask application with a single model Product that has the following fields:
id: Integer, primary keyname: String, required, maximum 100 characterssku: String, required, must be unique, maximum 50 charactersprice: Float, required, must be positivequantity: Integer, required, must be non-negativeemail: String, optional, must be a valid email format when providedImplement an admin interface that:
@generates
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
# Initialize Flask app and database
app = Flask(__name__)
db = SQLAlchemy()
# Product model
class Product(db.Model):
"""Product model for inventory management."""
pass
# Configure and initialize admin interface
def setup_admin(app, db):
"""Set up the admin interface with proper validation."""
passWeb framework for Python
Provides admin interface framework with form validation support
Provides SQLAlchemy integration for Flask
Provides form handling and validation (used by Flask-Admin)