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

✨ Add Collection to Project and Reference #6

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ourprojects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from lnschema_core.models import (
Artifact,
CanCurate,
Collection,
Feature,
LinkORM,
Record,
Expand Down Expand Up @@ -88,6 +89,10 @@ class Meta(Record.Meta, TracksRun.Meta, TracksUpdates.Meta):
Artifact, through="ArtifactProject", related_name="projects"
)
"""Artifacts labeled with this Project."""
collections: Collection = models.ManyToManyField(
Collection, related_name="projects"
)
"""Collections labeled with this project."""


class Reference(Record, CanCurate, TracksRun, TracksUpdates, ValidateFields):
Expand Down Expand Up @@ -159,6 +164,10 @@ class Meta(Record.Meta, TracksRun.Meta, TracksUpdates.Meta):
Artifact, through="ArtifactReference", related_name="references"
)
"""Artifacts labeled with this reference."""
collections: Collection = models.ManyToManyField(
Collection, related_name="references"
)
"""Collections labeled with this reference."""


class ArtifactReference(Record, LinkORM, TracksRun):
Expand Down
Loading