This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
generated from communitiesuk/funding-service-design-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump flask-sqlalchemy from 3.0.3 to 3.1.1 (#146)
* Bump flask-sqlalchemy from 3.0.3 to 3.1.1 Bumps [flask-sqlalchemy](https://github.com/pallets-eco/flask-sqlalchemy) from 3.0.3 to 3.1.1. - [Release notes](https://github.com/pallets-eco/flask-sqlalchemy/releases) - [Changelog](https://github.com/pallets-eco/flask-sqlalchemy/blob/main/CHANGES.rst) - [Commits](pallets-eco/flask-sqlalchemy@3.0.3...3.1.1) --- updated-dependencies: - dependency-name: flask-sqlalchemy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * updating marshmallow imports for newer version --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sarah Sloan <[email protected]> Co-authored-by: srh-sloan <[email protected]>
- Loading branch information
1 parent
e828d32
commit 2f3db2a
Showing
6 changed files
with
20 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
from marshmallow import fields | ||
from marshmallow.fields import Function | ||
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema | ||
from marshmallow_sqlalchemy import auto_field | ||
|
||
from db import ma | ||
from db.models.account import Account | ||
|
||
|
||
class AccountSchema(ma.SQLAlchemySchema): | ||
class AccountSchema(SQLAlchemyAutoSchema): | ||
class Meta: | ||
model = Account | ||
|
||
id = fields.UUID(data_key="account_id") | ||
email = fields.String(data_key="email_address") | ||
full_name = ma.auto_field() | ||
azure_ad_subject_id = ma.auto_field() | ||
roles = ma.Function(lambda obj: [role.role for role in obj.roles]) | ||
highest_role_map = ma.Function(lambda obj: obj.highest_role_map) | ||
full_name = auto_field() | ||
azure_ad_subject_id = auto_field() | ||
roles = Function(lambda obj: [role.role for role in obj.roles]) | ||
highest_role_map = Function(lambda obj: obj.highest_role_map) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
from db import ma | ||
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema | ||
from marshmallow_sqlalchemy import auto_field | ||
|
||
from db.models.role import Role | ||
|
||
|
||
class RoleSchema(ma.SQLAlchemyAutoSchema): | ||
class RoleSchema(SQLAlchemyAutoSchema): | ||
class Meta: | ||
model = Role | ||
include_fk = True | ||
|
||
role = ma.auto_field() | ||
role = auto_field() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters