Skip to content
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

Merged
merged 4 commits into from
Dec 6, 2023
Merged

SQLAlchemy 1.4 #12

merged 4 commits into from
Dec 6, 2023

Conversation

bouttier
Copy link
Contributor

@bouttier bouttier commented Nov 9, 2023

No description provided.

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
src/pypn_habref_api/models.py 100.00% <100.00%> (ø)

📢 Thoughts on this report? Let us know!

@@ -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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
overlaps="lists",
viewonly=True,

@@ -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")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@@ -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),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).

@bouttier bouttier force-pushed the feat/update-dependencies branch from fdbb514 to 14cc5b1 Compare November 10, 2023 17:23
@jacquesfize jacquesfize merged commit 07b41a9 into develop Dec 6, 2023
@bouttier bouttier deleted the feat/update-dependencies branch December 21, 2023 12:29
jacquesfize added a commit that referenced this pull request Jan 29, 2024
*  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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants