flask-sqlalchemy
flask-sqlalchemy copied to clipboard
Adds SQLAlchemy support to Flask
The underly implementation of `first_or_404` and `one_or_404` is use `scalar()` and `scalar_one()`. I think it will be more clear to rename them to `scalar_or_404` and `scalar_one_or_404`, so users won't expect...
Fix issue #1312: Type (typehint) error when calling `db.Model` subclass constructor with parameters
Fix the typehint inconsistence of initializing a subclass of `db.Model`. - fixes #1312 - Fix an issue when tox p fails because mypy is forbidden (necessary for passing tests) -...
Fix the typehint inconsistence of `db.relationship(...)`. Rebased on the branch [`3.1.x`](https://github.com/pallets-eco/flask-sqlalchemy/tree/3.1.x). This work is continued from #1319 - fixes #1318 - Fix an issue when tox p fails because mypy...
## Problem Description The typehint of ```python db.relationship("...", secondary=..., back_populates="...") ``` should be `sq_orm.Relationship[...]`, not `sq_orm.RelationshipProperty[...]`. The mismatch of the typehint causes the manual annotation supported by `sqlalchemy` fails: ##...
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish). Updates `actions/checkout` from 4.1.6 to 4.1.7 Release notes Sourced from actions/checkout's releases. v4.1.7 What's Changed Bump the minor-npm-dependencies group across...
Bumps the python-requirements group in /requirements with 4 updates: [mypy](https://github.com/python/mypy), [pyright](https://github.com/RobertCraigie/pyright-python), [pytest](https://github.com/pytest-dev/pytest) and [tox](https://github.com/tox-dev/tox). Updates `mypy` from 1.10.0 to 1.10.1 Changelog Sourced from mypy's changelog. Mypy 1.10.1 Fix error reporting...
Fix #1348
The naming convetion mentioned in [docs](https://flask-sqlalchemy.palletsprojects.com/en/3.1.x/models/#initializing-the-base-class) is useful in some migration situations, would it be better to set it as default?
I'd like to make a PR for adding `sqlalchemy` namespace as `sa` to `flask shell`, what do you think?
In this code https://github.com/pallets-eco/flask-sqlalchemy/blob/main/src/flask_sqlalchemy/pagination.py#L132 When per_page = 0, it will be set to 20 if error_out = False. ``` if per_page < 1: if error_out: abort(404) else: per_page = 20...