diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-13 16:22:38 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-04-13 16:22:38 -0700 |
commit | a1d236466a471aa8d43740e4bcd6aa686faaa17d (patch) | |
tree | 1f3a1dbb98cad4cbc01bcf9fa4de500cdd3c62db | |
parent | 13f7b0f5ff574171ae2a35b48d637d57906871cd (diff) | |
download | fatcat-a1d236466a471aa8d43740e4bcd6aa686faaa17d.tar.gz fatcat-a1d236466a471aa8d43740e4bcd6aa686faaa17d.zip |
simplify for now by removing creators from works
-rw-r--r-- | fatcat/models.py | 13 | ||||
-rw-r--r-- | fatcat/sql.py | 2 |
2 files changed, 0 insertions, 15 deletions
diff --git a/fatcat/models.py b/fatcat/models.py index 210d71a6..43e0bfea 100644 --- a/fatcat/models.py +++ b/fatcat/models.py @@ -17,16 +17,6 @@ from fatcat import db ### Inter-Entity Relationships ############################################### -class WorkContrib(db.Model): - __tablename__ = "work_contrib" - work_rev= db.Column(db.ForeignKey('work_rev.id'), nullable=False, primary_key=True) - creator_ident_id = db.Column(db.ForeignKey('creator_ident.id'), nullable=False, primary_key=True) - type = db.Column(db.String, nullable=True) - stub = db.Column(db.String, nullable=True) - - creator = db.relationship("CreatorIdent") - work = db.relationship("WorkRev") - class ReleaseContrib(db.Model): __tablename__ = "release_contrib" release_rev = db.Column(db.ForeignKey('release_rev.id'), nullable=False, primary_key=True) @@ -70,9 +60,6 @@ class WorkRev(db.Model): work_type = db.Column(db.String) primary_release_id = db.Column(db.ForeignKey('release_ident.id'), nullable=True) - creators = db.relationship('WorkContrib', lazy='subquery', - backref=db.backref('works', lazy=True)) - class WorkIdent(db.Model): """ If rev_id is null, this was deleted. diff --git a/fatcat/sql.py b/fatcat/sql.py index 6ca56b46..45980925 100644 --- a/fatcat/sql.py +++ b/fatcat/sql.py @@ -222,14 +222,12 @@ def hydrate_work(wid): primary = None if work.revision.primary_release_id: primary = hydrate_release(work.revision.primary_release_id) - creators = [c.creator_id for c in WorkContrib.query.filter(WorkContrib.work == work).all()] #releases = [r.id for r in ReleaseIdent.query.filter(ReleaseIdent.revision.work_id==work.id).all()] releases = [] hydro.update({ "work_type": work.revision.work_type, "title": work.revision.title, "primary": primary, - "creators": creators, "releases": releases, }) return hydro |