-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
6 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,12 +18,13 @@ | |
# Nadzeya Hutsko <[email protected]> | ||
"""Functions to validate the whole models (not just specific field)""" | ||
|
||
from sqlalchemy import select | ||
from sqlalchemy import select, event | ||
from sqlalchemy.engine.base import Connection | ||
from sqlalchemy.orm import Mapper | ||
from .models import Stage, Family, Artefact | ||
|
||
|
||
@event.listens_for(Artefact, "before_insert") | ||
def validate_artefact( | ||
mapper: Mapper, connection: Connection, artefact: Artefact # noqa: ARG001 | ||
) -> None: | ||
|