Skip to content

[42] participant and hacknight model relationship #45

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

Conversation

kristhina
Copy link
Member

No description provided.

hacknights = db.relationship("Hacknight",
secondary=participant_hacknight,
lazy='subquery',
backref=db.backref('participants', lazy=True))

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like bidirectional many to many relationship. So either you should remove one relationship (from child class), or use back_populates instead of backref if you would like to keep this two directions.

'participant_hacknight',
db.Column('participant_id', db.Integer, db.ForeignKey('participant.id')),
db.Column('hacknight.id', db.Integer, db.ForeignKey('hacknight.id'))
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Association table should be before participant and hacknight models

@OtisRed OtisRed changed the title [WIP][42] participant and hacknight model relationship [WIP] participant and hacknight model relationship (fixes #42) May 8, 2019
@OtisRed OtisRed changed the title [WIP] participant and hacknight model relationship (fixes #42) [WIP] [42] participant and hacknight model relationship May 8, 2019
@kristhina kristhina changed the title [WIP] [42] participant and hacknight model relationship [42] participant and hacknight model relationship May 15, 2019
participants = db.relationship("Participant",
secondary=participant_hacknight,
lazy='subquery',
backref=db.backref('hacknights', lazy=True))
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this indentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to fix it in #43

participants = db.relationship("Participant",
secondary=participant_hacknight,
lazy='subquery',
backref=db.backref('hacknights', lazy=True))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to fix it in #43

@stanislawK stanislawK merged commit f90eb40 into CodeForPoznan:master May 22, 2019
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