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 simple product catalog admin interface that allows administrators to manage products with image uploads. The system should handle product images with automatic thumbnail generation, file validation, and proper storage management.
Create a Product model with the following attributes:
id: Integer primary keyname: String (required, max 100 characters)description: Text (optional)price: Decimal (required, 2 decimal places)image: Image file path (optional, stored in 'uploads/products' directory)Image Validation:
Thumbnail Generation:
Image Management:
Create an admin view that:
@generates
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_admin import Admin
from flask_admin.contrib.sqla import ModelView
app = Flask(__name__)
db = SQLAlchemy()
class Product(db.Model):
"""Product model with image support"""
pass
class ProductAdmin(ModelView):
"""Admin view for Product model with image upload"""
pass
def create_app():
"""Initialize and configure the Flask application with admin interface"""
passProvides the admin interface framework with model views and file upload capabilities.
Provides SQLAlchemy integration for database models.
Provides image processing capabilities for thumbnail generation and validation.