-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLAlchemy 1.4 #12
SQLAlchemy 1.4 #12
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
📢 Thoughts on this report? Let us know! |
src/pypn_habref_api/models.py
Outdated
@@ -126,4 +126,5 @@ class AutoCompleteHabitat(DB.Model): | |||
primaryjoin=(cor_list_habitat.c.cd_hab == cd_hab), | |||
secondary=cor_list_habitat, | |||
secondaryjoin=(cor_list_habitat.c.id_list == BibListHabitat.id_list), | |||
overlaps="lists", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overlaps="lists", | |
viewonly=True, |
src/pypn_habref_api/models.py
Outdated
@@ -109,7 +109,7 @@ class BibListHabitat(DB.Model): | |||
__table_args__ = {"schema": "ref_habitats"} | |||
id_list = DB.Column(DB.Integer, primary_key=True) | |||
list_name = DB.Column(DB.Unicode) | |||
habitats = DB.relationship("Habref", secondary=cor_list_habitat) | |||
habitats = DB.relationship("Habref", secondary=cor_list_habitat, overlaps="lists") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
habitats = DB.relationship("Habref", secondary=cor_list_habitat, overlaps="lists") | |
habitats = DB.relationship("Habref", secondary=cor_list_habitat, back_populates="lists") |
Rajouter également back_populates="habitats"
sur la relationship Habref.lists
.
src/pypn_habref_api/models.py
Outdated
@@ -126,4 +126,5 @@ class AutoCompleteHabitat(DB.Model): | |||
primaryjoin=(cor_list_habitat.c.cd_hab == cd_hab), | |||
secondary=cor_list_habitat, | |||
secondaryjoin=(cor_list_habitat.c.id_list == BibListHabitat.id_list), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
secondaryjoin=(cor_list_habitat.c.id_list == BibListHabitat.id_list), |
Cette condition de join peut être déterminé automatiquement par SQLAlchemy (pas la première car SQLAlchemy s’attend à associé le cd_hab
de cor_list_habitat
avec Habref.cd_hab
et non avec AutoCompleteHabitat.cd_hab
).
fdbb514
to
14cc5b1
Compare
* init branch + change models for SQLA 1.4 * ci: remove Debian 10, add Debian 12 --------- Co-authored-by: Pierre Narcisi <[email protected]> Co-authored-by: Jacques Fize <[email protected]>
No description provided.