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-2/

User Profile Admin with Custom Form Layout

Build an admin interface for managing user profiles with a custom form layout that organizes fields into logical sections.

Requirements

Create a Flask application with an admin interface for a User model that includes the following fields:

  • username (string, required)
  • email (string, required)
  • first_name (string)
  • last_name (string)
  • bio (text)
  • birth_date (date)
  • phone (string)
  • address (string)
  • city (string)
  • country (string)
  • active (boolean)

The form layout must be customized to organize these fields into three distinct sections:

  1. Account Information section containing: username, email, and active status
  2. Personal Details section containing: first_name, last_name, bio, and birth_date arranged with first_name and last_name on the same row
  3. Contact Information section containing: phone, address, city, and country

Additionally, the edit form should have a different layout than the create form:

  • The create form should show all sections as specified above
  • The edit form should not display the username field (since it should be immutable after creation)

Test Cases

  • When accessing the create form, all three sections should be present with fields organized as specified @test
  • When accessing the edit form, the Account Information section should not contain the username field @test
  • The first_name and last_name fields should appear on the same horizontal row in the form @test

Implementation

@generates

API

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

# Flask application with admin interface
app = Flask(__name__)
db = SQLAlchemy()

# User model with all specified fields
class User(db.Model):
    pass

# Admin view with custom form layout
class UserAdmin:
    pass

Dependencies { .dependencies }

flask-admin { .dependency }

Provides admin interface framework with form layout customization capabilities.