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 an admin interface for a product catalog with customized form generation and layout.
Create a Flask application with an admin interface for managing products. The application should:
Define a Product model with these fields:
Create an admin view for the Product model with the following customizations:
created_at field from the create formdescription field use a textarea widget with 5 rowsname fieldsku fieldprice is greater than 0stock_quantity is not negativeOrganize the form layout into sections:
@generates
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
# Create Flask app and database instance
app = Flask(__name__)
db = SQLAlchemy(app)
# Product model
class Product(db.Model):
"""Product model with catalog information"""
pass
# Custom ProductAdmin view
class ProductAdmin(ModelView):
"""Admin view for Product model with form customizations"""
pass
# Initialize admin
admin = Admin(app, name='Product Catalog', template_mode='bootstrap4')
admin.add_view(ProductAdmin(Product, db.session))Provides admin interface framework with form generation and customization capabilities.
Provides SQLAlchemy integration for Flask.
Provides form validation support (used by Flask-Admin).