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

284 add contributor role #292

Merged
merged 6 commits into from
Aug 8, 2023

Conversation

mnuzzose
Copy link
Collaborator

@mnuzzose mnuzzose commented Aug 2, 2023

No description provided.

mnuzzose and others added 6 commits July 24, 2023 14:25
url = db.Column(db.Text)
contact_email = db.Column(db.Text)
reported_incidents = db.relationship(
'Incident', backref='organization', lazy="select")
Copy link
Collaborator

Choose a reason for hiding this comment

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

The backref here should still be source.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we're renaming Source to Organization on the back end for consistency with the front end, the database should also reflect that for consistency.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, but the back reference is about the relationship between the entities so it should reflect what that relationship is.

If you have users and channels the users are subscribers to the channel.

Similarly, you have users as members of an organization while the incident sees the organization as its source. Different relationships to the same entity.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The relationship of an organization to an incident is still going to be that of a source -> Incident. The backref on org and the labelling here should stay mostly the same.

@@ -59,10 +59,10 @@ class Incident(db.Model, CrudMixin):
"""The incident table is the fact table."""

id = db.Column(db.Integer, primary_key=True, autoincrement=True)
source_id = db.Column(
Copy link
Collaborator

Choose a reason for hiding this comment

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

These should be reverted.

@@ -131,8 +131,8 @@ def __repr__(self):
# case_id = db.Column(db.Integer) # TODO: foreign key of some sort?


class SourceDetails(db.Model):
id = db.Column(db.Integer, primary_key=True) # source details id
class OrganizationDetails(db.Model):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is still going to be SourceDetails.

@DMalone87 DMalone87 marked this pull request as ready for review August 8, 2023 23:30
@DMalone87
Copy link
Collaborator

Gonna go ahead and merge this and make the changes after.

@DMalone87 DMalone87 merged commit f5a1be9 into codeforboston:main Aug 8, 2023
2 checks passed
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.

2 participants