WTForms-SQLAlchemy
SQLAlchemy tools for WTForms
Decision gist · record as of 2026-08-14
Yes. Low install friction, active maintenance, permissive BSD license, and no known vulnerabilities make this a safe choice. Install it if you're building WTForms-based applications with SQLAlchemy models and want to avoid manual form field definition or need database-backed select fields.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; sqlalchemy and wtforms must be installed.
- Low install friction with just two runtime dependencies (sqlalchemy and wtforms).
- Actively maintained as of 2026-04-23 with stable production status.
License · maintenance · safety
permissive license (permissive) — BSD license (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2024-10-25 (658 days) · last repo commit 2026-04-23 · 104 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 122,365 downloads/mo, #11,954 on PyPI
Alternatives
Verify before relying
pip install WTForms-SQLAlchemy
from wtforms_sqlalchemy.orm import model_form
from wtforms_sqlalchemy.fields import QuerySelectField
# Generate a form class from a SQLAlchemy model
MyForm = model_form(MyModel)
# Or use QuerySelectField for database-backed dropdowns
class MyForm(Form):
user = QuerySelectField(query_factory=lambda: User.query)- Whether QuerySelectField and QuerySelectMultipleField support async SQLAlchemy sessions or only synchronous queries.
- Compatibility with the latest major versions of sqlalchemy (2.0+) and wtforms (3.x).
- Whether model_form supports all SQLAlchemy column types or has known limitations.
What it is and what it does
WTForms-SQLAlchemy bridges WTForms and SQLAlchemy by providing form generation and database-aware form fields. It was forked from WTForms' deprecated sqlalchemy extension to maintain independent development and release cycles. The package offers two main features: automatic form generation from SQLAlchemy models via model_form(), and specialized form fields (QuerySelectField, QuerySelectMultipleField) that populate dropdown lists directly from database queries.
The package is designed for web applications that need to build forms tied to database models without manually defining each field. It's commonly used in Flask applications where forms need to display related records as choices. With low install friction and active maintenance, it integrates cleanly into projects already using both WTForms and SQLAlchemy.
Use it for
- Auto-generate form classes from SQLAlchemy ORM models to reduce boilerplate in CRUD interfaces.
- Populate dropdown fields with live database queries (e.g., user lists, category selections) using QuerySelectField.
- Build multi-select form fields backed by database relationships without writing custom query logic.
- Simplify form validation and data binding when working with SQLAlchemy model instances.
- Create admin interfaces or data entry forms that stay synchronized with model schema changes.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Low install friction, active maintenance, permissive BSD license, and no known vulnerabilities make this a safe choice. Install it if you're building WTForms-based applications with SQLAlchemy models and want to avoid manual form field definition or need database-backed select fields.
Install
wtforms-sqlalchemy on PyPI
Before you install
Low install friction with just two runtime dependencies (sqlalchemy and wtforms). Actively maintained as of 2026-04-23 with stable production status.
Requires Python 3.9 or later; sqlalchemy and wtforms must be installed.
License in practice
BSD license (permissive) — you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install WTForms-SQLAlchemy
from wtforms_sqlalchemy.orm import model_form
from wtforms_sqlalchemy.fields import QuerySelectField
# Generate a form class from a SQLAlchemy model
MyForm = model_form(MyModel)
# Or use QuerySelectField for database-backed dropdowns
class MyForm(Form):
user = QuerySelectField(query_factory=lambda: User.query)
Verify before relying
- Whether QuerySelectField and QuerySelectMultipleField support async SQLAlchemy sessions or only synchronous queries.
- Compatibility with the latest major versions of sqlalchemy (2.0+) and wtforms (3.x).
- Whether model_form supports all SQLAlchemy column types or has known limitations.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagessqlalchemywtforms |
| Maintenance | Actively maintained 658 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 122,365 / month, #11,954 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Internet :: WWW/HTTP :: WSGITopic :: Internet :: WWW/HTTP :: WSGI :: ApplicationTopic :: Software Development :: Libraries :: Application Frameworks |
Evidence: wtforms_sqlalchemy-0.4.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “sqlalchemy form generation”
- WTForms-SQLAlchemyGenerates WTForms forms from SQLAlchemy models and provides form…
- WTForms-AlchemyAutomatically generates WTForms form classes from SQLAlchemy model…
- flask-appbuilderFlask App Builder is a framework that generates database-backed web…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also WTForms-Alchemy · WTForms · WTForms-Components · flask-mongoengine · Flask-SQLAlchemy · sqladmin · Flask-WTF · Bootstrap-Flask · sqlbag · WTForms-JSON