Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advanced_orm_relations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brady James Garvin
advanced_orm_relations
Commits
9de72116
Commit
9de72116
authored
6 years ago
by
Brady James Garvin
Browse files
Options
Downloads
Patches
Plain Diff
Fixed transposition error.
parent
6b2f2a30
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
database.py
+4
-4
4 additions, 4 deletions
database.py
with
4 additions
and
4 deletions
database.py
+
4
−
4
View file @
9de72116
...
@@ -43,12 +43,12 @@ class Person(Persisted):
...
@@ -43,12 +43,12 @@ class Person(Persisted):
# Note that all of these conditions are written in terms of classes, OO fields, and Python operators, not tables,
# Note that all of these conditions are written in terms of classes, OO fields, and Python operators, not tables,
# DB fields, or SQL operators.
# DB fields, or SQL operators.
reviewers
=
relationship
(
'
Person
'
,
uselist
=
True
,
secondary
=
'
reviewerships
'
,
reviewers
=
relationship
(
'
Person
'
,
uselist
=
True
,
secondary
=
'
reviewerships
'
,
primaryjoin
=
'
Reviewership.reviewer_id == Person.person_id
'
,
secondaryjoin
=
'
Reviewership.reviewee_id == Person.person_id
'
,
back_populates
=
'
reviewees
'
)
reviewees
=
relationship
(
'
Person
'
,
uselist
=
True
,
secondary
=
'
reviewerships
'
,
primaryjoin
=
'
Reviewership.reviewee_id == Person.person_id
'
,
primaryjoin
=
'
Reviewership.reviewee_id == Person.person_id
'
,
secondaryjoin
=
'
Reviewership.reviewer_id == Person.person_id
'
,
secondaryjoin
=
'
Reviewership.reviewer_id == Person.person_id
'
,
back_populates
=
'
reviewees
'
)
reviewees
=
relationship
(
'
Person
'
,
uselist
=
True
,
secondary
=
'
reviewerships
'
,
primaryjoin
=
'
Reviewership.reviewer_id == Person.person_id
'
,
secondaryjoin
=
'
Reviewership.reviewee_id == Person.person_id
'
,
back_populates
=
'
reviewers
'
)
back_populates
=
'
reviewers
'
)
# If we want to be able to access the join table's pairs themselves, we write a standard one-to-many relationship
# If we want to be able to access the join table's pairs themselves, we write a standard one-to-many relationship
# with extra information.
# with extra information.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment